Spawn logic
This commit is contained in:
parent
1a11e0d670
commit
f56ae2bc04
4 changed files with 49 additions and 2 deletions
|
|
@ -1,4 +1,16 @@
|
|||
use bevy::prelude::*;
|
||||
|
||||
use crate::{collision::Collider, movable::Movable};
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct Enemy;
|
||||
|
||||
pub fn spawn_enemy(commands: &mut Commands, sprite: Handle<Image>, at: Vec2) {
|
||||
commands.spawn((
|
||||
Enemy,
|
||||
Collider::new(8.),
|
||||
Movable::new(500., f32::to_radians(360.)),
|
||||
Sprite::from(sprite),
|
||||
Transform::from_xyz(at.x, at.y, 0.),
|
||||
));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue