diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/src/main.rs b/src/main.rs index b06e30c..136bb87 100644 --- a/src/main.rs +++ b/src/main.rs @@ -177,7 +177,8 @@ fn cosmonaut_detect( cursor_position.x -= (constants::WINDOW_WIDTH / 2.0) - constants::TILE_SIZE * constants::TILE_SCALE * 0.5; cursor_position.y -= - (constants::WINDOW_HEIGHT / 2.0) - constants::TILE_SIZE * constants::TILE_SCALE * 0.5; + (constants::WINDOW_HEIGHT / 2.0) + constants::TILE_SIZE * constants::TILE_SCALE * 0.5; + cursor_position.y *= -1.0; for (transform, sprite, texture_atlas_handle) in q.iter_mut() { if transform.translation.x < cursor_position.x && transform.translation.x + constants::TILE_SIZE * constants::TILE_SCALE @@ -210,7 +211,8 @@ fn mouse( cursor_position.x -= (constants::WINDOW_WIDTH / 2.0) - constants::TILE_SIZE * constants::TILE_SCALE * 0.5; cursor_position.y -= - (constants::WINDOW_HEIGHT / 2.0) - constants::TILE_SIZE * constants::TILE_SCALE * 0.5; + (constants::WINDOW_HEIGHT / 2.0) + constants::TILE_SIZE * constants::TILE_SCALE * 0.5; + cursor_position.y *= -1.0; for (cell, _, mut sprite) in q.iter_mut() { if cell.selected { @@ -290,16 +292,19 @@ pub fn main() { ..default() }), ) - .add_startup_system(setup) - .add_systems(( - cell::insert, - cell::falling, - cell::check, - cell::start_explosion, - mouse, - cosmonaut_detect, - animation, - star_spawning, - )) + .add_systems(Startup, setup) + .add_systems( + Update, + ( + cell::insert, + cell::falling, + cell::check, + cell::start_explosion, + mouse, + cosmonaut_detect, + animation, + star_spawning, + ), + ) .run(); } |