only triggers for under 50 % Pill level, otherwise there will be an conversation
17 lines
482 B
GDScript
17 lines
482 B
GDScript
extends Spatial
|
|
|
|
var _animationWalk: AnimationPlayer
|
|
|
|
|
|
func _ready():
|
|
_animationWalk = get_parent().get_node("PillAnimationPlayer") as AnimationPlayer
|
|
assert(null != _animationWalk)
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta):
|
|
# Taking a pill
|
|
if Input.is_action_just_pressed("take_pill"):
|
|
Pills.take_pill()
|
|
Logger.info("Player took a pill; new level: %s" % [Pills.get_round_level()])
|
|
_animationWalk.play("PillTaking") |