Scratch Idle Bouncing Ball Game

by NonameExperiments in Circuits > Software

694 Views, 2 Favorites, 0 Comments

Scratch Idle Bouncing Ball Game

Title.png

In this project, you make a game where the ball bounces around and you make money. You can buy more balls, upgrade how much you make, and increase the speed. It is a fun game, that you can learn to make in Scratch.

Supplies

All you need to do is open Scratch, and create a new project. Then, create variables called Balls, Money, New Ball Cost, Profit, Profit Cost, Speed, and Speed Cost.

The Stage Background

stagebackground.png

This is one of the premade stages called stars. Just add it to stage backgrounds and switch to it. Then, you will have the starry background.

The Stage Code

Stage.png

You will need to take the code above and add it to the stage.

The Ball Background

ball.png

Make a new sprite, and just make a circle with a black background

The Ball Code

Ball Code.png

Add this code to the ball you just made. It will control how much profit the ball makes when it bounces, the speed, and the amount of clones.

The New Ball Button Background

New Ball background.png

Just create a simple rectangle with the words in it that says new ball.

New Ball Button Code

New ball button.png

Then add this to the sprite you just made. When it is clicked, and will make a clone of the ball.

The Profit Button

profit background.png

Make a rectangle like the last one, but change the words to Profit.

The Profit Button Code

profit button.png

Just add this code to the profit button sprite. It will increase the money when you click on it.

The Speed Button

speed background.png

Make another rectangle like the last two, but change the words to Speed.

The Speed Button Code

speed button.png

Just add this code to Speed Button. It will increase the speed of the ball.

The Border

border.png

Just make a long rectangle across the top, and in the corner, write Money. This will be border where the buttons go, and where you can see you money.

The Border Code

border code.png

Then add this code to the Border.

Aligning Up the Variables

Title.png

You need to put the variables: speed cost, new ball cost, and profit cost to large readout by clicking on them and selecting large readout. Then, put them in front of the corresponding button. Take the money variable, put it at large read out, then put the money variable underneath the money word on the border. If you are confused, just look at the picture.

Troubleshooting

fixed.png

If the ball is not bouncing of the border with the buttons, then you will have to change a little code. Change if touching Sprite 3 to what ever your border is named.

The Finished Game

Title.png

Now, the game should be done. Hopefully, the game should work well, and you can find the game at https://scratch.mit.edu/projects/768103282/ .