Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var oldAnim = " "
- onready var animator = get_node("../../../AnimationPlayer")
- var direction = "Up"
- var Speed = 0.3
- var Status = "ALIVE" setget setStatus, getStatus
- func _ready():
- set_fixed_process(true)
- func _fixed_process(delta):
- get_node("../../../PathFollow2D").set_offset(get_node("../../").get_offset() + Speed )
- if(direction != oldAnim):
- animator.play(direction)
- oldAnim = direction
- func stop_Player():
- Speed = 0
- func run_Player():
- Speed = 0.3
- func crazy_Player():
- Speed = 1.5
- var savedCurrentOffset
- func quitPathFollow():
- savedCurrentOffset = get_node("../../").get_offset()
- func returnPathFollow():
- get_node("../../../PathFollow2D").set_offset(0)
- func changeDirection(dir):
- direction = dir
- func getDirection():
- return direction
- func setStatus(value):
- Status = value
- get_node("../Timer").set_wait_time(100)
- func getStatus():
- return Status
- func isDead():
- animator.play("Dead")
- get_node("../../../PathFollow2D/RigidBody2D").clear_shapes()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement