Zachary Hall 20dfc6ba71
Add hunger, hunger bar, and related functions on the Player struct. (#1210)
* Add hunger and hunger bar
 - New functions added to Player struct in game.zig to use and heal hunger.
 - If an attempt is made to use more hunger than there is available, the player is killed.
 - Hunger bar uses placeholder icons.
 - Hunger bar is based on the health bar
 -  Hunger bar is anchored to the left of the hotbar, rather than the right like the health bar.

* Don't kill player when hunger runs out.
- Don't use hunger when there's not enough to use
- Allow for code to know if hunger was used, so that is can handle not having enough hunger.

* New hunger textures

* Desaturate the highlight a little

* Return true if hunger was already true.

* Fix formatting

* Rename hunger to energy, and fix other issues.

* Make energy synchronized between client and server

Also removes the functions that add/remove energy on the game.Player struct

* Run formatter

* Fix incorrect formatting by formatter.

* Remove AddHunger struct and addHunger function

 - Keep base operation so things like accessories and food can use it when syncing

* Fix formatting again.

---------

Co-authored-by: Carrie <carriecapp9@gmail.com>
2025-03-23 17:06:21 +01:00
..
2023-03-19 23:25:31 +01:00
2024-07-14 21:18:16 +02:00
2024-07-14 21:18:16 +02:00
2024-07-14 21:18:16 +02:00
2023-03-19 23:25:31 +01:00