daily pastebin goal
56%
SHARE
TWEET

Untitled

a guest Oct 12th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. var oldAnim = " "
  4.  
  5. onready var animator = get_node("../../../AnimationPlayer")
  6. var direction = "Up"
  7. var Speed = 0.3
  8. var Status = "ALIVE" setget setStatus, getStatus
  9.  
  10. func _ready():
  11.     set_fixed_process(true)
  12.  
  13. func _fixed_process(delta):
  14.     get_node("../../../PathFollow2D").set_offset(get_node("../../").get_offset() + Speed )
  15.     if(direction != oldAnim):
  16.         animator.play(direction)
  17.         oldAnim = direction
  18.  
  19. func stop_Player():
  20.     Speed = 0
  21.  
  22. func run_Player():
  23.     Speed = 0.3
  24.    
  25. func crazy_Player():
  26.     Speed = 1.5
  27.    
  28. var savedCurrentOffset
  29.  
  30. func quitPathFollow():
  31.     savedCurrentOffset = get_node("../../").get_offset()
  32.    
  33. func returnPathFollow():
  34.     get_node("../../../PathFollow2D").set_offset(0)
  35.    
  36. func changeDirection(dir):
  37.     direction = dir
  38.  
  39. func getDirection():
  40.     return direction
  41.    
  42. func setStatus(value):
  43.     Status = value
  44.     get_node("../Timer").set_wait_time(100)
  45.  
  46.    
  47. func getStatus():
  48.     return Status
  49.    
  50. func isDead():
  51.     animator.play("Dead")
  52.     get_node("../../../PathFollow2D/RigidBody2D").clear_shapes()
RAW Paste Data
Top