ZainWD

Untitled

Apr 15th, 2021
859
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. extends Position2D
  2.  
  3. export var turn_start_move_distance: float = 40.0
  4. export var tween_duration: float = 0.3
  5.  
  6. onready var tween = $Tween
  7. onready var anim = $AnimationPlayer
  8. onready var position_start: Vector2
  9.  
  10. var blink: bool = false setget set_blink
  11.  
  12. func _ready():
  13.     hide()
  14.    
  15. func appear():
  16.     anim.play("appear")
  17.  
  18. func move_forward():
  19.     print("move forward")
  20.     print(position.x)
  21.     var direction = Vector2(-1, 0) if owner.playable else Vector2(1, 0)
  22.     position.x = 50 * 1
  23.     print(position.x)
  24.     #tween.interpolate_property(
  25.     #   self,
  26.     #   'position',
  27.     #   position_start,
  28.     #   position_start + turn_start_move_distance * direction,
  29.     #   tween_duration,
  30.     #   Tween.TRANS_QUAD,
  31.     #   Tween.EASE_OUT
  32.     #)
  33.     #tween.start()
  34.     #yield(tween, "tween_completed")
  35.  
  36. func set_blink(value):
  37.     blink = value
  38.     if blink:
  39.         anim.play("blink")
  40.     else:
  41.         anim.play("idle")
  42.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×