diff --git a/assets/textures/icons.png b/assets/textures/icons.png new file mode 100644 index 0000000..1e0d10e Binary files /dev/null and b/assets/textures/icons.png differ diff --git a/src/game/components.rs b/src/game/components.rs index e4cf242..88fcf0b 100644 --- a/src/game/components.rs +++ b/src/game/components.rs @@ -188,3 +188,5 @@ pub struct Foreground; pub struct TextColor; #[derive(Component)] pub struct DropBombTimer(pub Timer); +#[derive(Component)] +pub struct MissileReserve(pub usize); diff --git a/src/game/mod.rs b/src/game/mod.rs index 87a9c7f..db91998 100644 --- a/src/game/mod.rs +++ b/src/game/mod.rs @@ -8,7 +8,7 @@ use self::{ effects::{flick_system, timed_removal_system}, prelude::stage_colors, systems::{ - animate_sprite_indices, animate_sprite_steps, change_colors, drop_bombs, + ammo_ui, animate_sprite_indices, animate_sprite_steps, change_colors, drop_bombs, explosion_event_listener_system, explosion_system, flame_engulf_system, game_keys, game_over_ui, gizmo_missile_trails, health_ui, missile_arrival_event_listner, move_cursor, move_missile, move_ufo, reset_game_listener, rotate_player, score_ui, setup_player, @@ -39,6 +39,7 @@ impl Plugin for GamePlugin { animate_sprite_steps, animate_sprite_indices, score_ui, + ammo_ui, ) .run_if(in_state(GameState::InGame).or_else(in_state(GameState::GameOver))), // run these systems if we are in the InGame state diff --git a/src/game/systems.rs b/src/game/systems.rs index 6dfb8ea..44e8034 100644 --- a/src/game/systems.rs +++ b/src/game/systems.rs @@ -14,8 +14,8 @@ use super::{ AnimationIndices, AnimationStep, AnimeRemoveOnFinish, Cannon, CannonBase, ChainedMeta, Cursor, DropBombTimer, Enemy, EnemySpawn, Engulfable, Explodable, Explosion, ExplosionEvent, ExplosionMode, FlameRadius, Foreground, Health, IdCounter, Missile, - MissileArrivalEvent, Player, Score, Scoring, SpawnPoint, SplitTimer, Stepper, TargetLock, - Ufo, DROP_BOMB_CHANCE, MAX_SPLIT, PLAYER_MISSILE_SPEED, SPLIT_CHANCE, + MissileArrivalEvent, MissileReserve, Player, Score, Scoring, SpawnPoint, SplitTimer, + Stepper, TargetLock, Ufo, DROP_BOMB_CHANCE, MAX_SPLIT, PLAYER_MISSILE_SPEED, SPLIT_CHANCE, }, effects::{Flick, TimedRemoval}, prelude::{color_from_vec, Stage, StageHandle}, @@ -28,7 +28,7 @@ pub fn game_keys( mut id_counter: ResMut, mut commands: Commands, images: Res, - player: Query<(Entity, With)>, + mut player: Query<((Entity, &mut MissileReserve), With)>, mut cannon_base: Query< (Entity, &mut Transform, Has), (With, Without), @@ -36,7 +36,7 @@ pub fn game_keys( time: Res