Advertisement
otorp2

while with mouse.x

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