Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Reimplement Jellyfish #895

Merged
merged 25 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
312863e
add static togglable jellyfish
nelson137 Dec 29, 2023
b264434
explode flappy when jellyfish is dropped while mounted
nelson137 Dec 29, 2023
4c72e1a
move flappy jellyfish behavior into its module
nelson137 Dec 31, 2023
f566668
minor fixes
nelson137 Jan 3, 2024
8e5d27c
fix: panic in jellyfish drop handler
nelson137 Jan 3, 2024
3eac72f
add drive player state for jellyfish
nelson137 Jan 4, 2024
cfc1400
use player controls to move flappy jellyfish
nelson137 Jan 4, 2024
fe09592
rework jellyfish status
nelson137 Jan 4, 2024
581e2b6
move flappy session setup into its module
nelson137 Jan 4, 2024
7bbc6d5
remove unnecessary component
nelson137 Jan 4, 2024
7f0e8c7
implement flappy explosion
nelson137 Jan 4, 2024
7366000
simplify meta handling
nelson137 Jan 4, 2024
e6556a9
reimpl killing flappy with a marker component
nelson137 Jan 5, 2024
f8b285c
kill flappy when outside the map
nelson137 Jan 5, 2024
50b90dd
disallow using jellyfish while not idle
nelson137 Jan 5, 2024
1a9b441
explode flappy on collision with player
nelson137 Jan 5, 2024
a0f7941
cleanup and add docs
nelson137 Jan 5, 2024
17abbdb
implement limited ammo for jellyfish
nelson137 Jan 5, 2024
94ba923
explode flappies when the driver dies
nelson137 Jan 5, 2024
b134d06
cleanup asset helper
nelson137 Jan 5, 2024
421ea12
rename driving jellyfish player state to be more explicit
nelson137 Jan 5, 2024
b4a5207
setup dev level 1
nelson137 Jan 3, 2024
e92ec77
revert dev level 1 changes
nelson137 Jan 5, 2024
a053c75
fix: map element entry
nelson137 Jan 5, 2024
572d66c
grab while driving jellyfish despawns the flappy
nelson137 Jan 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
image: ./explosion.png
tile_size: [144, 112]
rows: 1
columns: 11
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
image: ./flappy_jellyfish.png
tile_size: [34, 46]
rows: 1
columns: 3
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
atlas: ./flappy_jellyfish.atlas.yaml
body_size: [34, 46]
start_frame: 0
end_frame: 2
fps: 2

spawn_offset: [64, 64]

explosion_atlas: ./explosion.atlas.yaml
explosion_lifetime: 1.0
explosion_frames: 12
explosion_fps: 8
explosion_volume: 0.1
explosion_sound: ./explosion.ogg

damage_region_size: [60, 60]
damage_region_lifetime: 0.6
4 changes: 4 additions & 0 deletions assets/elements/item/jellyfish/jellyfish.atlas.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
image: ./jellyfish.png
tile_size: [30, 39]
rows: 1
columns: 1
3 changes: 3 additions & 0 deletions assets/elements/item/jellyfish/jellyfish.element.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: Jellyfish
category: Weapons
data: jellyfish.yaml
Binary file added assets/elements/item/jellyfish/jellyfish.png
Copy link
Member

@zicklag zicklag Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized that I think the second frame of this is meant for use as a hat, and it's probably supposed to be kind of crooked on the fishes head. So we should be able to make it look right by updating the player attachment component with the proper offset.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh that makes sense. I thought the same and got it up on top of the player's head with a PlayerBodyAttachment but didn't think to move it over. I'll try that and see how good it looks.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions assets/elements/item/jellyfish/jellyfish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
atlas: ./jellyfish.atlas.yaml
body_size: [30, 39]
throw_velocity: 6
angular_velocity: 0.1
fin_anim: grab_2
grab_offset: [0, 0]

max_ammo: 1

flappy_meta: ./flappy_jellyfish/flappy_jellyfish.yaml
1 change: 1 addition & 0 deletions assets/game.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ core:
- /elements/environment/slippery_seaweed/slippery_seaweed.element.yaml
- /elements/item/crate/crate.element.yaml
- /elements/item/grenade/grenade.element.yaml
- /elements/item/jellyfish/jellyfish.element.yaml
- /elements/item/kick_bomb/kick_bomb.element.yaml
- /elements/item/mine/mine.element.yaml
- /elements/item/musket/musket.element.yaml
Expand Down
5 changes: 2 additions & 3 deletions packs/devpack/maps/devlevel_1.map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1239,9 +1239,8 @@ layers:
element: core:/elements/item/sword/sword.element.yaml
- pos:
- 300.0
- 700.0
element: core:/elements/item/sword/sword.element.yaml
element: /items/blunderbass/element.yaml
- 710.0
element: core:/elements/item/jellyfish/jellyfish.element.yaml
- pos:
- 480.0
- 118.5
Expand Down
4 changes: 2 additions & 2 deletions src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ use crate::{prelude::*, settings::PlayerControlMapping};
pub mod prelude {
pub use super::{
attachment::*, audio::*, bullet::*, camera::*, damage::*, debug::*, editor::*, editor::*,
elements::prelude::*, elements::prelude::*, globals::*, input::*, item::*, lifetime::*,
map::*, map_constructor::*, metadata::*, physics::*, player::*, random::*, utils::*, FPS,
elements::prelude::*, globals::*, input::*, item::*, lifetime::*, map::*,
map_constructor::*, metadata::*, physics::*, player::*, random::*, utils::*, FPS,
MAX_PLAYERS,
};
}
Expand Down
27 changes: 15 additions & 12 deletions src/core/elements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ pub mod crab;
pub mod crate_item;
pub mod decoration;
pub mod fish_school;
pub mod flappy_jellyfish;
pub mod grenade;
pub mod jellyfish;
pub mod kick_bomb;
pub mod mine;
pub mod musket;
Expand All @@ -26,9 +28,9 @@ pub mod urchin;

pub mod prelude {
pub use super::{
crab::*, crate_item::*, decoration::*, fish_school::*, grenade::*, kick_bomb::*, mine::*,
musket::*, player_spawner::*, slippery::*, slippery_seaweed::*, snail::*, spike::*,
sproinger::*, stomp_boots::*, sword::*, urchin::*, *,
crab::*, crate_item::*, decoration::*, fish_school::*, grenade::*, jellyfish::*,
kick_bomb::*, mine::*, musket::*, player_spawner::*, slippery::*, slippery_seaweed::*,
snail::*, spike::*, sproinger::*, stomp_boots::*, sword::*, urchin::*, *,
};
}

Expand Down Expand Up @@ -290,23 +292,24 @@ macro_rules! install_plugins {
}

install_plugins!(
decoration,
urchin,
player_spawner,
sproinger,
sword,
grenade,
crab,
snail,
crate_item,
decoration,
fish_school,
grenade,
jellyfish,
kick_bomb,
mine,
musket,
stomp_boots,
crate_item,
player_spawner,
slippery_seaweed,
slippery,
snail,
spike,
sproinger,
stomp_boots,
sword,
urchin,
);

fn handle_out_of_bounds_items(
Expand Down
Loading
Loading