2019-11-21 11:28:48 +01:00
|
|
|
extends Spatial
|
2019-11-21 11:25:59 +01:00
|
|
|
|
2019-12-14 21:05:09 +01:00
|
|
|
var _animation: AnimationPlayer
|
2019-12-14 15:32:29 +01:00
|
|
|
|
|
|
|
|
|
|
|
func _ready():
|
2019-12-14 21:05:09 +01:00
|
|
|
_animation = get_parent().get_node("PillAnimationPlayer") as AnimationPlayer
|
|
|
|
assert(null != _animation)
|
2019-11-21 13:31:52 +01:00
|
|
|
|
2019-11-21 11:25:59 +01:00
|
|
|
|
|
|
|
func _process(delta):
|
|
|
|
# Taking a pill
|
|
|
|
if Input.is_action_just_pressed("take_pill"):
|
2019-12-27 18:10:09 +01:00
|
|
|
#Logger.info("Player took a pill, new level: %s" % [Pills.get_round_level()])
|
2020-01-26 22:30:39 +01:00
|
|
|
_animation.play("PillTaking")
|
|
|
|
yield(_animation, "animation_finished")
|
|
|
|
Pills.take_pill()
|