How To Create A Super Fun Adventure Game In Scratch

How To Create A Fun Space Adventure Game In Scratch: Simple Coding

By P.Vaishnavi
Home » Code for Kids Corner » How To Create A Fun Space Adventure Game In Scratch: Simple Coding

Coding is a type of computer programming that allows us to communicate with computers. Code tells a computer what to do, and writing code is similar to writing a set of instructions.

Text-based coding and block-based coding are the two main types of coding. Both have advantages, but block-based coding is especially useful for teaching coding to children.

Scratch is a well-known block-based coding platform with a community of millions of coders and creators. It enables children to create a wide range of games, animations, and other projects. 

A space adventure game in Scratch is one of the many interesting games that Scratchers can create. 

If you are someone who is interested in such games you’ve come to the right place. Just read on and you’ll find all the information on how to create an adventure game on Scratch.

What is Scratch Programming? 

Scratch is the world’s largest coding community for children and a coding language with a simple visual interface that allows young people to create digital stories, games, and animations.

Scratch promotes computational thinking and problem-solving skills; creative teaching and learning; self-expression and collaboration; and equity in computing. Therefore, Scratch coding for kids helps to improve their skills.

Math Games In Scratch

I’ve outlisted some of the importance and advantages of scratch programming below;

  • Scratch coding is fun, and interactive, and enables kids to trigger their creative side. 
  • Sharpens analytical skills and logic. 
  • Aesthetically appealing. 
  • Easy to understand. 
  • Stepping stone to high-level programming.

Project Explanation

The project we have created here is a Space adventure game. 

What is an adventure game?

An adventure game is a video game in which the player assumes the role of a protagonist in an interactive story driven by exploration and/or puzzle-solving. 

Adventure games contain a variety of puzzles, decoding messages, finding and using items, opening locked doors, or finding and exploring new locations.

How to create a Space Adventure game in Scratch

So let’s get right into creating our Space adventure game.

Step 1: Adding Sprites

  • To add the sprites click on the choose sprites (cat icon) on the right corner of the page
How To Create A Super Fun Adventure Game In Scratch
  • Go to sprites and choose a rocket.
How To Create A Super Fun Adventure Game In Scratch
  • Go to Choose sprite, select Paint, and paint the asteroid.
How To Create A Super Fun Adventure Game In Scratch

Step 2: Backdrops

  • Choose the backdrop stars.
How To Create A Super Fun Adventure Game In Scratch
  • Finally, draw the Game Over backdrop for the second backdrop.
How To Create A Super Fun Adventure Game In Scratch

Step 3: Coding

Now let’s start the coding for Rocket sprite.

  1. Drag the When clicked option from events which is the starting block also known as a run block.
  2. Then drag Switch backdrop from looks to switch the backdrop to Stars.
  3. Set the X position for the rocket to be placed permanently from the motion block.
  4. Drag play sound and add a sound of your choice for when the rocket moves.
  5. Set mouse to Y for the rocket to move according to the Y position of the mouse.
  6. Place all these blocks under the Repeat until block as it should repeat until Rocket touches the asteroid.
  7. Drag If () then condition block from control to place the condition. Add a different sound for the Rocket touching the asteroid from the sound block and switch the backdrop to Game Over backdrop to stop the game. 
  8. Drag the stop-all block from the control block to stop the Game. With this, we complete the coding for the Rocket.
How To Create A Super Fun Adventure Game In Scratch

Now let’s start the coding for Asteroid Sprite

  1. First Create the variables called Point and Speed. The point is for storing the score values and speed is to increase or decrease the speed of the rocket. Set the values of Points and speed to 0.
  2. Then drag the go-to XY option from the motion block to set the position of the asteroid.
  3. Drag repeat until from control block and touching block rocket from sensing. Inside repeat until block add change X by with the variable speed to change the speed (variable) of the X position (left to right position) of the asteroid.
  4. Inside the repeat until add if() then condition from control block. If its X position (from motion block) is less than some -250 (-x position), then set x (from motion block) position to 250 to start the asteroid from the left of the x position. Then set y (from motion block) position (from up to down position) randomly from 180 to -180 (from Y to –Y).
  5. Finally, change the speed by 1 and -1 accordingly. Then change the Point by 1 to get the score.
How To Create A Super Fun Adventure Game In Scratch

Step 4: In the end, click the green flag run button to play the code. To stop the code use the nearby red button.If you want to see this complete project in Scratch, click here!

How To Create A Super Fun Adventure Game In Scratch

Conclusion

Finally, we created and ran a large number of Scratch scripts, and by doing so, you learned how to program in the Scratch programming language.

You should have learned a lot of advanced programming concepts by doing this, such as variables, conditions, control, motion (position changing), and sensing.

Learn Scratch at BrightChamps with its specially designed curriculum that makes learning programming easy for students in Grade 1-12.

BrightChamps also teaches a variety of other programs that help kids build a foundation in computer programming through activities, interactive lessons, and other means.

Elevate your child’s learning journey with BrightChamps, the leading EdTech company offering a transformative blend of robotics, financial education, and coding courses.
To get your hands on more such articles, educational content, and free resources on coding for kids, robotics courses for kids, game development, etc., check out the BrightCHAMPS Blog Page now!

Frequently Asked Questions (FAQs)

What is the Repeat Until block in Scratch and where does it come from?

Repeat Until block is used to keep the process going until the condition is satisfied. It’s from the control block.

What is the purpose of set x in Scratch and where does it come from?

Set x is a motion block variable that is used to set the sprite’s x location.

What exactly are variables in Scratch?

Variables are used to hold values such as scores, points, and so on. They are similar to storage containers that are used to store items.

What does mouse Y stand for in Scratch?

The sprites will move according to the position of the mouse in the Y direction, which is up and down in this case.

What is the If Condition in Scratch?

If () then block is a control block. If its condition is true, the blocks held inside it will run, and then the script involved will continue. If the condition is false, the scripts inside the block will be ignored. 

P.Vaishnavi

⭐⭐⭐⭐⭐

As a coding tutor, I also enjoy writing articles on programming and technology. Working with BrightChamps allows me to share what I've learned and my goal is to help the kids become more tech savvy with each passing day. Learn from Me

Reach Us

Categories

General Sidebar Widget Coding

Get a Talent Discovery Certificate after trial class

100% Risk-Free. No Credit Card Required

Related Articles

Trending Articles