Advertisement
Guest User

Untitled

a guest
Mar 6th, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. forever, do this {
  2. start measure time (in milliseconds)
  3. //physics part
  4. add deltaX to x
  5. add deltaY to y
  6. if x is bigger than the screen width, assign -deltaX to deltaX
  7. if y is bigger than the screen height, assign -deltaY to deltaY
  8. if x is less than 0, assign -deltaX to deltaX
  9. if y is less than 0, assign -deltaY to deltaY
  10.  
  11. //paint
  12. paint the ball at x, y
  13. stop measuring time, assign this to workTime
  14. make the thread sleep for (25 - workTime) milliseconds
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement