How to make a Geometry Dash game using Scratch – a lesson for children

Geometry Dash is a computer game that harmoniously combines the basics of a 2D platformer and a rhythm game, where the basic component is musical accompaniment. We propose to carry out a similar project, but without music, and make a conditional clone of Geometry Dash in Scratch. Today's tutorial will help you with this.

We are in Pixel We use Scratch to teach block programming to young children and believe that it is an important step towards understanding the basics and principles of complex text languages. The fact is that, through the example of the practical use of bright blocks, preschoolers and primary schoolchildren begin to better understand what algorithms are, how to correctly write simple programs and why it is important to adhere to the laws of logic.

But that’s not what we’re talking about today: we suggest creating a copy of Geometry Dash in Scratch. The text instructions provided will help us. We will accompany it with pictures for a better understanding of the main actions.

At the end they published a video: it will be useful if you want to repeat all the steps after the teacher or the text seems complicated.

Note: We recommend this lesson for children who are familiar with the Scratch device and understand how to use the tools of the environment. Carrying out today's project from scratch will be relatively difficult.

Let's get started without any further digressions and complete the important steps: creating a character, backgrounds, obstacles, levels and more.

How to create a game in Scratch 3.0 using Geometry Dash as an example: basic steps

So let's create our game. Let's start with the basics and make a character, and then move on to more complex things: obstacles, coordinates, conditions, etc.

If you are a beginner who has decided to try your hand, be sure to check it out. introductory video.

1. Create a character – a conditional player

In our version of Geometry Dash in Scratch, let the character be a cube, as in the original version of the game. So, let's draw a hero in the built-in graphic editor:

  1. Choose a yellow color and make the outline black.

  2. We use a rectangle and hold down Shift, stretch the shape until we get a square.

  3. Apply blue color to create the mouth and eyes. Don't forget the black outline! We will need to draw three more small rectangles and place them on the plane of the yellow square to create the eyes and mouth.

  4. Select all the created shapes and use the Group tool. This is necessary so that the made elements become whole.

What should happen and where the grouping button is located is shown in the screenshot.

Creating a Geometry Dash in Scratch

Creating a Geometry Dash in Scratch

So, Sprite 1 is ready.

2. Create the background

To create a background, you will need to click on the empty window under the “Scene” inscription in the lower right side. A clear area will open.

Next:

  1. Again, select the black color, apply a rectangle and stretch it to the bottom of the scene. As a result, we get something like a platform for moving.

  2. Let's create another rectangle and cover the upper part of the work area with it. Let's choose blue color.

Our background is ready.

3. Create obstacles

Our Scratch game for kids requires adding obstacles just like the original. Let's get started:

  1. Let's go back to sprites.

  2. Let's draw black triangles in the form of thorns and place them on the field.

  3. Let's create 3 groups of obstacles and make different costumes. The basic one will need to be duplicated three times and unnecessary elements removed: it is necessary that only unique parts remain.

Important: you need to make exactly 3 groups of spines and name them like this: Sprite 2.

Now we need to create new obstacles. For this we need:

  1. Copy one of the already made spines and flip it horizontally.

  2. Create additional obstacles with different costumes, just like you did before.

Be sure to name each sprite appropriately. You can repeat the names shown in the screenshots.

4. Create a new sprite – the “Start” button

Let our button be bright. Let's use a color reminiscent of crimson. We suggest making the stroke light.

Now you need to click on the “Text” tool and write the word “Start”. Don't forget to place the inscription inside our bright rectangle.

5. Let's start writing code

We are getting closer to understanding how to make Geometry Dash in Scratch. We're done with drawing, so let's start coding. First, we want to briefly describe the steps, and we will demonstrate intermediate results using screenshots.

At the end of each section, visual examples of code were presented in the form of screenshots.

5.1. Programming the “Start” button

We need to program the following conditions:

  1. The flag is pressed, show up and go to coordinates 7 and 29, change the suit to the first one.

  2. Repeat the cycle.

  3. If, then: when you click on the “Start” button, its brightness should change to -15.

  4. Wait until. Let's use the “Not” operator and set the wait until the moment when the button is touched by the mouse pointer. Here we will set the brightness change to +15.

The code that should have turned out is shown in the screenshot below.

You can click on the green flag and check the program: we will see that the “Start” button changes color when interacting with the mouse pointer.

5.2. Programming additional elements and actions

This point will be the biggest, but don’t worry: we’ll tell you everything and accompany the instructions with screenshots.

Let's start with this part of the program:

  1. The sprite is pressed, an “if, then” construct is triggered.

  2. Provided that the suit number is 1, the game begins. In this case, all sprites should be active, and the “Start” button should disappear.

Now let's work with the cube. Let's turn to the first sprite and start writing code.

We would like to simplify the task and suggest you look at the following screenshots: they show what new parts of the program need to be done. You can also see that the cube is controlled by pressing the space bar.

Let's move on to the sprite of the spines pointing up. As in the previous case, we will not present the required commands in text to simplify the task: visual examples seem more successful.

Now let's go back to the start button and write a program as in the screenshot below.

Explanation (green arrow): after “showing up” at the bottom of the new program, you need to mark up the part of the code behind the “repeat always” at the top left (including this line) written earlier. This is necessary so that after the game is completed the “Start” button becomes active.

Let's go back to the dice script and change the hidden variable to “score”.

Next, you need to turn to the inverted thorns and insert into them a program written for basic obstacles of a similar type. We have to remove some parts and also change a number of lines.

What the code should look like is shown below.

Let's start the project. Something's wrong, don't you agree? Yes, it’s impossible to play: the cube cannot overcome all the obstacles. We have 2 ways:

  1. Reducing thorns.

  2. Increasing the jumping power of a cubic sprite.

Which option will work and why, we told in training video. Be sure to watch it and repeat the steps of the teacher: you will be able to check the Geometry Dash clone for errors and consolidate the knowledge gained.

If you couldn’t cope or everything worked out, but you want to move on, we invite you to Scratch course. Also you can look a selection of videos with interesting projects.

In conclusion, we want to know if you managed to create a copy of Geometry Dash yourself: share your experience in the comments.

The material was prepared by Pixel online school. We teach children and teenagers to write code in Scratch, Python, Lua and C#, as well as develop games, websites and model 3D objects.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *