This commit is contained in:
Rendo 2025-11-15 17:08:38 +05:00
commit 526caf91c7
4 changed files with 29 additions and 11 deletions

View file

@ -5,6 +5,12 @@ use crate::projectile::spawn_projectile;
pub mod enemy;
pub mod player;
#[derive(Component, PartialEq)]
pub enum Factions {
PlayerFaction,
EnemyFaction,
}
pub struct ShipsPlugin;
impl Plugin for ShipsPlugin {
@ -22,7 +28,7 @@ fn startup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn(Camera2d);
player::spawn_player(&mut commands, player_sprite, Vec2::new(0., 0.));
enemy::spawn_enemy(&mut commands, enemy_sprite.clone(), Vec2::new(100., 100.));
spawn_projectile(&mut commands, projectile, 1);
player::spawn_player(&mut commands, player_sprite, Vec2::new(100., 100.));
enemy::spawn_enemy(&mut commands, enemy_sprite.clone(), Vec2::new(0., 0.));
spawn_projectile(&mut commands, projectile, 1, Factions::PlayerFaction);
}