Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit 9306967

Browse files
committed
done
2 parents 2591cb8 + 60d6511 commit 9306967

24 files changed

+245
-54
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ Core libraries:
3232
- [`serde`](https://serde.rs/)
3333
- [`serialstudio-rs`](https://github.com/Ewpratten/serialstudio-rs)
3434

35+
Sound Samples:
36+
- [JavierZumer](https://freesound.org/people/JavierZumer/sounds/257236/)
37+
- [Noted451](https://freesound.org/people/Noted451/sounds/531015/)
38+
3539
### VSCode Setup
3640

3741
If using VSCode, disable the `Rust` extension, and install everything in the **Workspace Recommendations** (You will see this list by searching `@recommended` in the extensions panel)

assets/audio/succ.mp3

24.2 KB
Binary file not shown.

assets/audio/swimSong.mp3

-3.4 MB
Binary file not shown.

assets/audio/zap.mp3

24.4 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.

assets/worlds/mainworld.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,19 @@
276276
"stun_timer": 0.0,
277277
"puffer_state": "SmallIdle"
278278

279+
},
280+
{
281+
"position" : {
282+
"x":260,
283+
"y":1472
284+
},
285+
"is_knocking_back": false,
286+
"time_knocking_back": 0.0,
287+
"inflate_timer": 0.0,
288+
"is_large": false,
289+
"stun_timer": 0.0,
290+
"puffer_state": "SmallIdle"
291+
279292
}
280293

281294
]

src/entities/enemy/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ pub trait EnemyBase {
1010
resources: &mut GlobalResources,
1111
dt: f64,
1212
);
13-
fn handle_logic(&mut self, player: &mut Player, dt: f64);
13+
fn handle_logic(&mut self, player: &mut Player, dt: f64) -> u8;
1414
fn handle_getting_attacked(&mut self, stun_duration: f64, current_time: f64);
1515
}

src/entities/enemy/jellyfish.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,14 @@ impl EnemyBase for JellyFish {
7777
&& !is_jelly_stunned;
7878
}
7979

80-
fn handle_logic(&mut self, player: &mut Player, _dt: f64) {
80+
fn handle_logic(&mut self, player: &mut Player, _dt: f64) -> u8 {
8181
// Handle stunning the player
8282
if self.do_stun_player {
8383
if self.position.distance_to(player.position).abs() <= JELLYFISH_STUN_REACH {
8484
player.set_stun_seconds(JELLYFISH_STUN_DURATION);
8585
}
8686
}
87+
return 0;
8788
}
8889

8990
fn handle_getting_attacked(&mut self, stun_duration: f64, _current_time: f64) {

src/entities/enemy/octopus.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,19 @@ impl EnemyBase for Octopus {
123123
}
124124
}
125125

126-
fn handle_logic(&mut self, player: &mut crate::player::Player, _dt: f64) {
126+
fn handle_logic(&mut self, player: &mut crate::player::Player, _dt: f64) -> u8 {
127127
if self.suck_air_time_remaining > 0.0 && !self.has_taken_air_from_player {
128128
if player.position.distance_to(self.current_position).abs() <= OCTOPUS_SUCK_AIR_RANGE {
129129
// Take air from the player
130130
player.breath_percent -= OCTOPUS_SUCK_AIR_AMOUNT;
131-
131+
132132
// Set the flag
133133
self.has_taken_air_from_player = true;
134+
135+
return 1;
134136
}
135137
}
138+
return 0;
136139
}
137140

138141
fn handle_getting_attacked(&mut self, stun_duration: f64, _current_time: f64) {

0 commit comments

Comments
 (0)