Enhanced snail interaction and sleep behavior

The update includes improvements to the snail's interactive behavior. Now, when the mouse hovers over a snail that is eating, it changes to a hand cursor. This change enhances user feedback during interaction.

Additionally, the sleeping state of the snail has been expanded. The snail now wakes up after a random interval between 15 and 25 seconds. A timer tracks this duration and triggers a state transition to "Eating" once elapsed.

A new hand cursor resource was also added to the CursorManager for use in these interactions.
This commit is contained in:
Dan 2024-05-15 14:47:28 +01:00
parent f0a7c5ca05
commit 7d47bdbf5a
3 changed files with 23 additions and 5 deletions

View file

@ -4,6 +4,7 @@ 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")
@onready var hand_cursor : Resource = preload("res://resources/cursors/hand_open.png")
func reset_cursor() -> void:
Input.set_custom_mouse_cursor(default_cursor, Input.CURSOR_ARROW, Vector2(8, 8))
@ -12,4 +13,7 @@ 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))
Input.set_custom_mouse_cursor(edit_cursor, Input.CURSOR_ARROW, Vector2(32, 32))
func hand() -> void:
Input.set_custom_mouse_cursor(hand_cursor, Input.CURSOR_ARROW, Vector2(32, 32))