My first game with Scratch

I’ve just completed the first assignment of CS50: to develop a project with Scratch, a programming language by MIT’s Media Lab to create interactive stories, games, and animations.

I’ve decided to create a game where a baseball player is preparing for the upcoming season and wants to eat in a healthy way. To this end, he needs to eat apples and bananas and stay away from cakes and donuts. Eating fruits adds up to his score and sweets make him lose points. The game finishes when he scores 40 points. You can play the game here.

A copy of the exported project can be also found in my GitHub repo.

To create the game in Scratch, I first set up the stage with some sound effects:

Screen Shot 2020-05-01 at 17.38.33.png

I created two different backdrops: one to show the introductory text and another one to play the game:

Screen Shot 2020-05-01 at 17.40.58.png

Screen Shot 2020-05-01 at 17.42.12.png

Then, I added 5 sprites, the main character (baseball player) and the foods that he has to avoid or eat:

Screen Shot 2020-05-01 at 17.43.27.png

Next, I defined the motion behavior for the cake, donut, apple and bananas, and the coordinates where they should be shown when the game starts. This is an example for the cake:

Screen Shot 2020-05-01 at 17.47.43.png

With this in place, I started working on the player sprite. First, I defined the commands to be used for moving the player:

Screen Shot 2020-05-01 at 17.51.19.png

Then, I defined how the instructions would be presented (in the form of a dialog). There is also a prompt to enter the user’s name:

Screen Shot 2020-05-01 at 17.52.33.png

Finally, I set the conditions to score points, to make the game more difficult as the user approaches 40 points and I configured how to end the game:

Screen Shot 2020-05-01 at 17.55.13.png

In this caption you see some sprite clones and a bigger player to increase the difficulty of the game:

Screen Shot 2020-05-01 at 18.09.06.png

I’ve learnt a lot about loops, conditions, and variables and have had a lot of fun while developing the game!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s