Damage rebalanced

This commit is contained in:
Rendo 2025-11-16 17:59:10 +05:00
commit 1aa45b2d57
3 changed files with 11 additions and 5 deletions

View file

@ -51,7 +51,7 @@ pub fn setup_asteroids(mut commands: Commands, asset_server: Res<AssetServer>) {
Sprite::from(sprite),
Transform::from_translation(position),
Collider::new(8.),
Damagable::new(20),
Damagable::new(200),
))
.observe(bump);
}

View file

@ -1,6 +1,11 @@
use bevy::prelude::*;
use crate::{collision::Collider, damagable::Damagable, ships::Factions, velocity::Velocity};
use crate::{
collision::Collider,
damagable::Damagable,
ships::{Factions, gun::Gun},
velocity::Velocity,
};
#[derive(Component)]
pub struct Enemy;
@ -8,11 +13,12 @@ pub struct Enemy;
pub fn spawn_enemy(commands: &mut Commands, sprite: Handle<Image>, at: Vec2) {
commands.spawn((
Enemy,
Gun::new(5, f32::to_radians(15.), 0.2),
Collider::new(8.),
Velocity::stopped(500., f32::to_radians(360.)),
Sprite::from(sprite),
Transform::from_xyz(at.x, at.y, 0.),
Damagable::new(10),
Damagable::new(100),
Factions::EnemyFaction,
));
}

View file

@ -23,12 +23,12 @@ pub fn spawn_player(commands: &mut Commands, sprite: Handle<Image>, at: Vec2) {
deceleration: 300.,
stop_epsilon: 50.,
},
Gun::new(1, f32::to_radians(15.), 0.2),
Gun::new(20, f32::to_radians(7.), 0.2),
Collider::new(8.),
Sprite::from(sprite),
Transform::from_xyz(at.x, at.y, 0.),
Factions::PlayerFaction,
Damagable::new(15),
Damagable::new(150),
));
}