Updated snail entity behavior

The snail entity's default state has been changed from 'Move' to 'Sleep'. Visibility and color modulation of certain sprites have been adjusted. The initial state of the StateMachine node is now set to 'Sleeping' instead of 'Eating'. In the snail sleeping script, the sleep timer update and state transition are now conditional on whether the level has started.
This commit is contained in:
Dan 2024-05-16 12:08:02 +01:00
parent b8f42a552e
commit 7f5d9dc6fc
2 changed files with 12 additions and 11 deletions

View file

@ -21,10 +21,13 @@ func exit() -> void:
pass
func update(delta : float) -> void:
sleep_timer += delta
if sleep_timer > wakes_up_in:
state_transition.emit(self, "Eating")
if GameState.level_started:
sleep_timer += delta
# Snail will only wake up if the level has started
if sleep_timer > wakes_up_in:
state_transition.emit(self, "Eating")
func physics_update(_delta : float) -> void:
pass