fishfolk / jumpy

Tactical 2D shooter in fishy pixels style. Made with Rust-lang 🦀 and Bevy 🪶
https://fishfolk.org/games/jumpy/
Other
1.65k stars 121 forks source link

fix: Fix machine gun animation and musket #992

Closed DRuppFv closed 5 months ago

DRuppFv commented 5 months ago

The musket simply didn't call bullet_spawn_offset.y, no big deal.

The machine gun animation would get frozen when dropped. Had to add an "else" for when the item is not being held, because items_dropped.get is called only when in fact the item got dropped, and if the player gets killed while shooting, the animation would still froze, as it wouldn't be IN FACT dropped.

It even made me think about the ammunition reload system of all guns.

        if items_dropped.get(entity).is_some() {
            // reload gun
            gun.ammo = *max_ammo;
        }

Here, reloading will only take place if the item is dropped. This means that if you die holding a musket with half the ammo, the next player to pick it up will get it with half the ammo. Is that what we really want? Or do we want the ammo to be reloaded?

MaxCWhitehead commented 5 months ago

Good catch. I think we probably want the ammo to be reloaded when player dies and "drops" weapon so it is consistent with deliberately dropping.