Adding another ball
A second, and slightly more complex way, of making your game more challenging would be to incorporate another moving ball into the mix. Let's do that here.
Getting ready
To prepare for this, import another ball sprite, perhaps the basketball or baseball. Give this new ball the same script that you gave to the first ball. Also name this ball Ball2
instead of Sprite1
.
Both balls will now bounce around the screen, but will seemingly do nothing special when they touch. Now the challenge becomes to make these balls bounce off of each other.
How to do it...
To accomplish this task, start with either sprite's script area. Ultimately, we'll add the same script to the other sprite too.
Tip
Note that you can right-click on a sprite and click on Duplicate to save time.
Drag over a second green flag block.
Thus we're starting another sequence of code.
Drag a forever block underneath the previous block.
Inside our forever loop, drag an if () then block, also from the Control category.
Inside...