Updated entity interaction and game state

Significant changes include:
- Disabled input pickability for DeathBox in Dog entity
- Simplified mouse click detection logic in Snail script
- Removed unnecessary conditions and actions from snail eating state
- Adjusted cursor hotspot position for hand cursor in Cursor Manager
- Reset flower nectar level upon game reset
This commit is contained in:
Dan 2024-05-16 12:33:24 +01:00
parent 7f5d9dc6fc
commit 84f07fde20
6 changed files with 15 additions and 34 deletions

View file

@ -18,7 +18,7 @@ func _ready() -> void:
# Detect mouse left click and trigger function
func _input(event : InputEvent) -> void:
if mouse_over and eating:
if mouse_over:
if event is InputEventMouseButton:
if (event is InputEventMouseButton && event.button_index == MOUSE_BUTTON_LEFT && event.pressed):
maybe_sleep()
@ -46,10 +46,8 @@ func get_random_target() -> Vector2:
return flowers.get_random_circumference_points()
func on_mouse_entered() -> void:
if eating:
mouse_over = true
CursorMgr.hand()
Log.pr("Mouse entered the snail!")
CursorMgr.hand()
mouse_over = true
func on_mouse_exited() -> void:
# Reset the cursor to the default