Created
May 19, 2018 06:48
-
-
Save ahmedghazi/9bcc806bac262cf6341ed8fc6c45e8b2 to your computer and use it in GitHub Desktop.
Screensaver anime
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.update = function() { | |
if (this.x + this.radius > ww || this.x - this.radius < 0) { | |
this.dx = -this.dx; | |
} | |
if (this.y + this.radius > wh || this.y - this.radius < 0) { | |
this.dy = -this.dy; | |
} | |
this.x += this.dx; | |
this.y += this.dy; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment