Skip to content

Commit

Permalink
pendejo waves
Browse files Browse the repository at this point in the history
  • Loading branch information
stillonearth committed Jan 3, 2024
1 parent 12eae4b commit 036d2f8
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions src/entities/pendejo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub fn create_pendejo_bundle(
}
.normalize(),
hit_at: None,
is_dummy: is_dummy,
is_dummy,
};

PendejoBundle {
Expand Down Expand Up @@ -195,7 +195,7 @@ pub fn update_pendejos_move_direction(
let angle = pendejo.move_direction.x.atan2(pendejo.move_direction.y)
- std::f32::consts::FRAC_PI_4;

let degree_angle = angle * 180. / std::f32::consts::PI;
let _degree_angle = angle * 180. / std::f32::consts::PI;

let mut normalized_angle = angle / std::f32::consts::FRAC_PI_2;
if normalized_angle < 0.0 {
Expand Down
42 changes: 21 additions & 21 deletions src/gameplay/waves.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ use crate::{entities::items::SpawnPizzaEvent, entities::mierda::SpawnMierdaEvent

#[derive(Clone)]
pub enum WaveEntry {
SpawnMierda { count: usize },
SpawnPizza { count: usize },
SpawnPendejo { count: usize },
Mierda { count: usize },
Pizza { count: usize },
Pendejo { count: usize },
}

#[derive(Clone)]
Expand Down Expand Up @@ -173,17 +173,17 @@ pub fn event_wave(
) {
for event in er_on_wave_change.iter() {
match event.wave_entry {
WaveEntry::SpawnMierda { count } => {
WaveEntry::Mierda { count } => {
ev_mierda_spawn.send(SpawnMierdaEvent {
count: count as u32,
});
}
WaveEntry::SpawnPizza { count } => {
WaveEntry::Pizza { count } => {
ev_pizza_spawn.send(SpawnPizzaEvent {
count: count as u32,
});
}
WaveEntry::SpawnPendejo { count } => {
WaveEntry::Pendejo { count } => {
ev_pendejo_spawn.send(SpawnPendejoEvent {
count: count as u32,
});
Expand Down Expand Up @@ -221,33 +221,33 @@ pub fn get_level_1_waves() -> Vec<Wave> {
vec![
Wave {
events: vec![
WaveEntry::SpawnPendejo { count: 15 },
WaveEntry::SpawnMierda { count: 15 },
WaveEntry::Pendejo { count: 15 },
WaveEntry::Mierda { count: 15 },
],
event_duration: Duration::from_secs(10),
wave_duration: Duration::from_secs(30),
},
Wave {
events: vec![
WaveEntry::SpawnMierda { count: 100 },
WaveEntry::SpawnMierda { count: 100 },
WaveEntry::SpawnMierda { count: 100 },
WaveEntry::Mierda { count: 100 },
WaveEntry::Mierda { count: 100 },
WaveEntry::Mierda { count: 100 },
],
event_duration: Duration::from_secs(20),
wave_duration: Duration::from_secs(60),
},
Wave {
events: vec![
WaveEntry::SpawnMierda { count: 200 },
WaveEntry::SpawnPizza { count: 3 },
WaveEntry::SpawnPendejo { count: 200 },
WaveEntry::SpawnMierda { count: 200 },
WaveEntry::SpawnPizza { count: 3 },
WaveEntry::SpawnPendejo { count: 200 },
WaveEntry::SpawnMierda { count: 200 },
WaveEntry::SpawnPizza { count: 3 },
WaveEntry::SpawnPendejo { count: 200 },
WaveEntry::SpawnPizza { count: 3 },
WaveEntry::Mierda { count: 200 },
WaveEntry::Pizza { count: 3 },
WaveEntry::Pendejo { count: 200 },
WaveEntry::Mierda { count: 200 },
WaveEntry::Pizza { count: 3 },
WaveEntry::Pendejo { count: 200 },
WaveEntry::Mierda { count: 200 },
WaveEntry::Pizza { count: 3 },
WaveEntry::Pendejo { count: 200 },
WaveEntry::Pizza { count: 3 },
],
event_duration: Duration::from_secs(20),
wave_duration: Duration::from_secs(200),
Expand Down
12 changes: 6 additions & 6 deletions src/sprites.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ pub fn animate_player_sprite(
);

if timer.just_finished() {
let spritesheet = match animated_character_sprite.animated_character_type {
AnimatedCharacterType::Player => spritesheets.player_atlas_1.clone(),
AnimatedCharacterType::Pendejo1 => spritesheets.pendejo_atlas_1.clone(),
AnimatedCharacterType::Pendejo2 => spritesheets.pendejo_atlas_2.clone(),
};

sprite.index = if (sprite.index >= indices.last) || (sprite.index < indices.first) {
// if attacking animation finished, go back to standing
if character_animation.animation_type == AnimationType::Attack
&& (sprite.index >= indices.last)
{
let spritesheet = match animated_character_sprite.animated_character_type {
AnimatedCharacterType::Player => spritesheets.player_atlas_1.clone(),
AnimatedCharacterType::Pendejo1 => spritesheets.pendejo_atlas_1.clone(),
AnimatedCharacterType::Pendejo2 => spritesheets.pendejo_atlas_2.clone(),
};

character_animation.animation_type = AnimationType::Stand;
texture_atlas.clone_from(&spritesheet);
}
Expand Down

0 comments on commit 036d2f8

Please sign in to comment.