Added health bar and snail behavior enhancements

- Introduced a health bar for flowers, which updates based on the current GameState values.
- Enhanced snail behavior with eating and sleeping states. Snails now have a chance to switch to the sleeping state while eating.
- Improved mouse interaction with snails, allowing them to potentially switch to sleep mode when clicked.
- Refactored cursor management into its own class for better code organization and readability.
- Updated drone placement logic to use the new CursorManager class.
- Added functionality for bees to replenish flower nectar levels after a certain number of deposits.
This commit is contained in:
Dan 2024-05-15 13:57:31 +01:00
parent 2a9e78b52e
commit f0a7c5ca05
12 changed files with 167 additions and 33 deletions

15
utility/cursor_manager.gd Normal file
View file

@ -0,0 +1,15 @@
extends Node
class_name CursorManager
@onready var default_cursor : Resource = preload("res://resources/cursors/pointer_a.png")
@onready var place_cursor : Resource = preload("res://resources/cursors/target_round_b.png")
@onready var edit_cursor : Resource = preload("res://resources/cursors/message_dots_round.png")
func reset_cursor() -> void:
Input.set_custom_mouse_cursor(default_cursor, Input.CURSOR_ARROW, Vector2(8, 8))
func place() -> void:
Input.set_custom_mouse_cursor(place_cursor, Input.CURSOR_ARROW, Vector2(32, 32))
func edit() -> void:
Input.set_custom_mouse_cursor(edit_cursor, Input.CURSOR_ARROW, Vector2(32, 32))