fork download
  1. extends Sprite
  2.  
  3. var vec = Vector2(0,0)
  4.  
  5. func _process(delta):
  6. #x位置が10を超えたら反転
  7. if vec.x < 10:
  8. vec.x -= 1
  9. if vec.x > -10:
  10. vec.x += 1
  11. self.translate(vec)
  12. print(vec.x)
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty