26 lines
510 B
GDScript

extends Reference
const NAME = "idle"
var ctx = null
func _init():
pass
func enter_from(state):
ctx.get_node("coin_machine").enabled = true
ctx.get_node("item_holder").add_enabled = true
func exit_to(state):
pass
func on_coin_machine_coin_requirement_met(player):
ctx.change_state(ctx.StateGrowing.new())
func on_grow_timer_timeout():
assert(false, "grow timer shouldn't trigger while idle")
func on_item_holder_item_changed(item):
assert(item != null)
ctx.change_state(ctx.StateBlocked.new())