Advertisement
otorp2

sin value

Mar 14th, 2016
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1.  
  2. extends Sprite
  3.  
  4. # member variables here, example:
  5. # var a=2
  6. # var b="textvar"
  7. var amplitude = 100
  8. var step = 0
  9. var pos = get_pos()
  10. func _ready():
  11. # Called every time the node is added to the scene.
  12. set_process(true)
  13.  
  14. pass
  15.  
  16. func _process(delta):
  17. var pos = get_pos()
  18. step = step + .1
  19.  
  20. print(sin(step))
  21. set_pos(Vector2(sin(step)*amplitude,0))
  22.  
  23. print(pos.x)
  24. pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement