state.gd 505 B

1234567891011121314151617181920212223242526
  1. """
  2. Base interface for all states: it doesn't do anything in itself
  3. but forces us to pass the right arguments to the methods below
  4. and makes sure every State object had all of these methods.
  5. """
  6. extends Node
  7. signal finished(next_state_name)
  8. # Initialize the state. E.g. change the animation
  9. func enter():
  10. return
  11. # Clean up the state. Reinitialize values like a timer
  12. func exit():
  13. return
  14. func handle_input(event):
  15. return
  16. func update(delta):
  17. return
  18. func _on_animation_finished(anim_name):
  19. return