Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forever, do this {
- start measure time (in milliseconds)
- //physics part
- add deltaX to x
- add deltaY to y
- if x is bigger than the screen width, assign -deltaX to deltaX
- if y is bigger than the screen height, assign -deltaY to deltaY
- if x is less than 0, assign -deltaX to deltaX
- if y is less than 0, assign -deltaY to deltaY
- //paint
- paint the ball at x, y
- stop measuring time, assign this to workTime
- make the thread sleep for (25 - workTime) milliseconds
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement