Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function update() {
- ball.x += ball.vx;
- ball.y += ball.vy;
- ball.vy += ball.g;
- if (ball.y > WINDOW_HEIGHT - ball.r) {
- ball.y = WINDOW_HEIGHT - ball.r;
- ball.vy = -ball.vy * 0.5;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement