Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. ball.prototype.draw = function() {
  2. circle(this.x,this.y,3,true);
  3. };
  4.  
  5. ball.prototype.move = function() {
  6. +=this.xspeed;
  7.  
  8. this.y+=this.yspeed;
  9. };
  10.  
  11.  
  12. ball.prototype.checkcollison = function() {
  13. if(this.x < 0|| this.x > 200) {
  14. this.xspeed= -this.xspeed;
  15. }
  16. if(this.y < 0|| this.y > 200) {
  17. this.yspeed= -this.yspeed;
  18. }
  19. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement