Spawn logic
This commit is contained in:
parent
1a11e0d670
commit
f56ae2bc04
4 changed files with 49 additions and 2 deletions
|
|
@ -17,6 +17,17 @@ pub struct Movable {
|
|||
pub max_rotation_speed: f32,
|
||||
}
|
||||
|
||||
impl Movable {
|
||||
pub fn new(max_linear_speed: f32, max_rotation_speed: f32) -> Movable {
|
||||
Movable {
|
||||
linear_speed: 0.,
|
||||
rotation_speed: 0.,
|
||||
max_linear_speed: max_linear_speed,
|
||||
max_rotation_speed: max_rotation_speed,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn movement_system(time: Res<Time>, query: Query<(&Movable, &mut Transform)>) {
|
||||
for (movable, mut transform) in query {
|
||||
transform.rotate_z(movable.rotation_speed * time.delta_secs());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue