Hey there! I’m excited to show you how to make your very own open world game using Scratch. By the end of this guide, you’ll have a game where your character can explore a vast world and interact with other characters. Let’s dive in!
First, we need to pick a character for your game. Click on “Choose a Sprite” and select any character you like. For this example, I’ll use the Scratch Cat.
To make it look like your character is walking around a huge world, we’ll actually move the background instead of the character. Here’s how:
Once your map is ready, make sure it goes to the back layer when you click the green flag, so it’s behind your main character.
To make your map large enough for exploring, try this trick:
Let’s make the map move when you press the arrow keys:
Now, your character can walk all around the map!
To add more characters or objects to your world:
Remove the “Go to Back Layer” block so this character stays in front of the map. Switch the costume to your new character costume.
To make your character interact with others:
And there you have it! You’ve created an open world game in Scratch. Feel free to use the starter code linked in the description to get started. I can’t wait to see what amazing games you create. Happy scratching!
Choose a character for your game by clicking on “Choose a Sprite” in Scratch. Use your creativity to design a unique character or modify an existing one. Think about what makes your character special and how they will interact with the game world.
Paint a new Sprite to serve as your game’s background. Use the rectangle tool to draw an ocean and add land using the paintbrush tool. Experiment with colors and shapes to make your world interesting and engaging. Remember to send the background to the back layer so your character can explore it.
Make your map larger by creating a new costume with a tiny dot and setting its size to 1000%. Switch back to your original map costume to see your expanded world. This will give your character plenty of space to explore and discover new areas.
Use Scratch’s motion blocks to move the map with the arrow keys. Practice using “Change X by” and “Change Y by” blocks to simulate your character walking around the map. Test different values to see how they affect the movement speed and direction.
Duplicate the map Sprite to add new characters or objects. Design a new character in the costumes tab and place it on the map. Use the “When This Sprite Clicked” block to make your character interact with others. Think about what your characters will say or do when clicked.
Sure! Here’s a sanitized version of the YouTube transcript:
—
Hi everyone, it’s Zia here. Today I wanted to show you how to make an open world game in Scratch. By the end of this tutorial, you’ll be able to create your own game where you can have a character walking around in an endless world that you design, and they can interact with other characters and more. Let’s get started!
First, let’s pick a character to be the main character of your project. You can click on the button that says “Choose a Sprite” and pick any character you want. For this example project, I will choose the Scratch Cat.
Now, how do we make this character walk around a giant, seemingly endless background? Actually, the character in the middle won’t move. Instead, we’re going to create a giant Sprite to serve as the background, and that Sprite will move around. Let me show you how to do that.
We can create a Sprite by hovering over “Choose a Sprite” and clicking “Paint.” I like to click “Convert to Bitmap” to switch to bitmap mode, where it’s easier to draw directly on the canvas. My simple way of making a map is to use the rectangle tool, set the color to something in the blue range, and create a large rectangle to represent the ocean as the base of the map.
Next, I will set the color to green and use the paintbrush tool to draw random pieces of land on top of the ocean. It can really be anything you want; I’m not following any particular pattern. I can use the fill bucket to fill in any spaces I want to be land, which gives us a basic map. You can use whatever colors you prefer.
Now, I will make this map go to the back layer when the green flag is clicked so that it’s behind the main character. Now that we have our map, how can we make it large enough for our character to walk around? You can click on size here and try increasing it, but it won’t let you go past a certain point.
Here’s a trick: let’s go to the costumes tab, paint a new costume, and draw a tiny dot. This small costume will allow us to set a large size. If I go back to the code tab, switch the costume to the blank costume, and set the size to something really big, like a thousand percent, it lets me do that. Now I can switch back to the map costume, and there you go! Now you have a giant version of the map.
Next, let’s make it so that when the player presses the arrow keys, the map moves underneath the character. To make the map move, we can go to the motion category and use the blocks “Change X by 10” and “Change Y by 10.” Let’s drag out the block “Change Y by 10” and see what happens.
Okay, that makes the backdrop move this way, which looks like the player is walking downward. So, when the down arrow key is pressed, I can go to the events category, drag out a “When Space Key Pressed” block, choose “Down Arrow” from the menu, and place it on top. Now, when I click the down arrow, it looks like the player is walking down the map.
I can increase the number to 20 to make it move a bit more each time I press the button. If I drag out another “Change Y” block and set it to negative 20, that will make the backdrop move in the opposite direction, making it look like the character is moving upwards.
Now, let’s make it so the player can move left and right. If you drag out the block “Change X by 10,” that will make the map move sideways. Let’s set that to 20 and make it happen when the left arrow key is pressed. If you change X by negative 20, it goes the other way, so we can make that happen when the right arrow key is pressed. Now it looks like the character can walk all around the map!
I’ll make the map start at zero when the green flag is clicked. Now let me show you how to add a character or an object to the world that the player can find as they walk through it. I will duplicate the map Sprite so that this character has all the same code as the map, allowing it to move around as the map moves.
Next, I’ll go to the costumes tab, keep the blank costume (which helps with the size trick), delete the map costume, and draw a new costume. I’ll convert to bitmap mode again to avoid blurriness when scaling up. I’ll zoom in to draw at a small size, set the size to one, and create a simple character, like a blob.
To ensure this character moves exactly the same as the map, the borders of the Sprite need to match the borders of the map Sprite. You can use the rectangle tool to create thin rectangles around the edges of your character.
Let’s check if the code from the map will still work for this character. There are a couple of changes we need to make. Since this character should be in front of the map, we need to remove the “Go to Back Layer” block. Also, we want to switch the costume to “Costume 1” instead of the map costume.
Now, let’s try it out! I’ll click the green flag, and there we go! Our character is in the world, and we can interact with them. We could also make it so this character says something when we click on it. If we put the “When This Sprite Clicked” block on top, we can walk up to the character, and it will say hello.
Lastly, if you want to change the location of this character within the map, go to the costumes tab and adjust the location of the Sprite within the costume. Wherever you place it in the costume is where it will appear.
That’s what I wanted to show you today! If you want to use the starter code for this project, the link is in the description below. I can’t wait to see the open world games that you create. I’ll see you next time, and happy scratching!
—
This version maintains the instructional content while removing any informal language and ensuring clarity.
Scratch – A visual programming language used to create games and animations by connecting blocks of code. – In computer class, we used Scratch to make a fun game with moving characters.
Character – A symbol or letter that can be used in coding, or a figure in a game or animation. – I designed a new character for my game that can jump over obstacles.
Map – A layout or plan of a game level or environment that players can explore. – We created a map of the game world to help players find hidden treasures.
Sprite – A graphic or image that represents a character or object in a game or animation. – I chose a cat sprite to be the main character in my animation project.
Background – The image or color that appears behind the main objects or characters in a game or animation. – I changed the background to a sunny beach to make my game more colorful.
Costume – A different appearance or outfit for a sprite in a game or animation. – I gave my sprite a superhero costume to make it look more exciting.
Keys – Buttons on a keyboard that can be used to control actions in a game or program. – I programmed the arrow keys to move my character left and right.
Game – An interactive program designed for entertainment, often involving challenges or goals. – We worked in teams to create a new game that everyone could play on the computer.
Explore – To move around and discover different parts of a game or program. – I love to explore new levels in the game to find secret areas.
Interact – To engage with or respond to elements in a game or program. – In the game, you can interact with other characters to get clues and solve puzzles.