pub fn new_random() -> Self {
        let kind = EnemyType::random();
        Self {
            pos_y: 0,
            pos_x: utils::cap(
                utils::rand(80),
                if kind.bounds().0 > 1 { 0 } else { 1 },
                80 - kind.bounds().0 - if kind.bounds().0 > 1 { 0 } else { 1 },
            ),
            kind,
        }
    }
/// Create new enemy on random x-coordinate. This will check bounds to create enemies only there, where
/// they can be hit by projectiles.
Create new enemy on random x-coordinate. This will check bounds to create enemies only there, where
they can be hit by projectiles.
Create new enemy on random x - coordinate . This will check bounds to create enemies only there where they can be hit by projectiles .
pub fn new_random() -> Self {
        let kind = EnemyType::random();
        Self {
            pos_y: 0,
            pos_x: utils::cap(
                utils::rand(80),
                if kind.bounds().0 > 1 { 0 } else { 1 },
                80 - kind.bounds().0 - if kind.bounds().0 > 1 { 0 } else { 1 },
            ),
            kind,
        }
    }
pub fn new_random ( ) -> Self { let kind = EnemyType :: random ( ) ; Self { pos_y : 0 , pos_x : utils :: cap ( utils :: rand ( 80 ) , if kind . bounds ( ) . 0 > 1 { 0 } else { 1 } , 80 - kind . bounds ( ) . 0 - if kind . bounds ( ) . 0 > 1 { 0 } else { 1 } , ) , kind , } }
Create new enemy on random x-coordinate.
Create new enemy on random x - coordinate .