Ball in a Box
For the "Make it Bounce Visual Effects" contest, I created a simple ball that slowly increases in size every time it bounces. The idea was inspired by several short videos online of balls becoming bigger and bigger within an enclosed space, and I wanted to create my own on Scratch (video can be downloaded below).
Supplies
Programming Software (I used Scratch here)
A plan and a little touch of creativity.
Creating the Sprites
The first order of business was to create the sprites needed. The main one being the ball and the background. I chose a contrast between black and white since it's a classic color setup that's not over the top, and it's simple to watch.
Setting Up the Basic Code
The first major step was making the ball move. By creating a simple "move step" block within a forever loop, the ball moves within a 45 degree angle every time it hits the edge of the screen (as shown below).
Changing the Size
The next step was having the ball slightly increase in size after each successive bounce. To do that, another Sprite will be created called "Border". Every time the ball touches the border, it'll change in size (as seen in the first image).
Then, an If statement is created where a message is broadcasted, whenever the Ball touches Border, to change its size.
Adding the Trail
Although the simulation is already done, a ball bouncing around without any effects would be boring. One cool effect would be duplicating the ball into clones that would then follow it, like a trail. By adding a "create clone of myself" block at the end of the bouncing script, a pattern of circles repeatedly follows and changes in size.
The ghost effect block makes the last few clones blur out, creating a snake-like trail.
Final Touches
Using the "change color effect" block, the ball and its clones glow a rainbow color which makes it stand out against the black background. This gives it a cool allusion once it reaches high speeds, almost like a hypnotic pattern. I also changed the starting direction so that the ball will randomly pick a side within a 360 degree angle.
Conclusion
This code is simple to make, yet it still creates some pretty neat patterns. While many people consider Scratch to be for beginners when it comes to coding, it has a lot of potential to create some cool animations/games if enough time is invested into it.
This basic ball animation can be tweaked to be even better. One idea could be creating an enclosed space that slowly shrinks as the ball touches it, or adding multiple balls in a box with collision physics to create something even more chaotic. I chose a simple design that's easy to follow along, but if given another chance, I'd do something more complex.