Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ball.prototype.draw = function() {
- circle(this.x,this.y,3,true);
- };
- ball.prototype.move = function() {
- +=this.xspeed;
- this.y+=this.yspeed;
- };
- ball.prototype.checkcollison = function() {
- if(this.x < 0|| this.x > 200) {
- this.xspeed= -this.xspeed;
- }
- if(this.y < 0|| this.y > 200) {
- this.yspeed= -this.yspeed;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement