Advertisement
otorp2

b_ball w logical or

Dec 27th, 2015
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1.  
  2. extends Sprite
  3.  
  4. var circlex = 0
  5. var xspeed = 1
  6. var scr_height
  7. var scr_width
  8.  
  9. func _ready():
  10. set_process(true)
  11. pass
  12.  
  13. func _process(delta):
  14. update()
  15. pass
  16.  
  17.  
  18. func _draw():
  19. scr_height = 400
  20. scr_width = 400
  21. draw_circle(Vector2(circlex,scr_height/2),20,Color(255,0,0))
  22. circlex = circlex + xspeed
  23. print(circlex)
  24. if circlex > 400 || circlex < 0:
  25. xspeed = xspeed*-1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement