Oleksii-Kshenskyi / runger

A hunger games style genetic simulation/game/research in Rust + Bevy.
The Unlicense
1 stars 0 forks source link

Implement the kill mechanics for players #7

Closed Oleksii-Kshenskyi closed 7 months ago

Oleksii-Kshenskyi commented 3 years ago

The players should be able to kill and eat other players.

Oleksii-Kshenskyi commented 7 months ago

Initial implementation over, but for now this is blocked by #22 because with the existing implementation of player action processing, it's impossible to mutably pull components for two separate player entities due to Rust's borrowing rules.

Oleksii-Kshenskyi commented 7 months ago

The #22 refactor has solved the mutable borrow issue, and the Kill action is working as intended. There is a difference between dying from hunger and dying from another player: when players are killed, they drop food (corpse), but when they die from hunger they essentially become "deactivated" and do not drop food.

I thought about reworking the death from hunger behavior into dropping food too, but logically, if someone dies from hunger, they die emaciated and therefore that creature is not a good meal anymore. So for now, I'll leave this behavior as is.

Due to the kill action working as intended, this can be closed now.