Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- xpos = xpos + ( xspeed * xdirection );
- ypos = ypos + ( yspeed * ydirection );
- if (xpos > width-rad || xpos < rad) {
- xdirection *= -1;
- }
- if (ypos > height-rad || ypos < rad) {
- ydirection *= -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement