bouncy-ball | :red_circle: Compare web animation techniques by bouncing a ball with each one | Animation library
kandi X-RAY | bouncy-ball Summary
kandi X-RAY | bouncy-ball Summary
This project compares web animation techniques by recreating a simple animation (a bouncing ball) with each one. It's kind of like TodoMVC, but for web animation.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of bouncy-ball
bouncy-ball Key Features
bouncy-ball Examples and Code Snippets
Community Discussions
Trending Discussions on bouncy-ball
QUESTION
Here is the link to my project so far.
I want to make a ball(an ellipse) bounce around all four walls of the canvas and as this happens I would also like to change the colour of the ball and speed after each bounce(randomly of course). P.S I want the ball to continue bouncing around the canvas off all four walls. Thanks for the help!!
This is the code I have tried. It gets the ball across the y-axis from top to bottom and keeps going, but I don't know how to get it to bounce off the left and right sides. I would just like the ball to bounce on all four sides in a clockwise direction(left wall, top, right wall, bottom, etc etc.)
EDITED
...ANSWER
Answered 2017-Oct-11 at 15:52You have some problems with your code. The curly brace that closes the first if was typed in the wrong place. To make the ball bounce, just multiply your speed by -1. Take a look:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install bouncy-ball
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page