![]() A willingness to spend some time learning how to use Scratch In order to make a sonic.exe game on scratch, you will need the following: What do you need to make a sonic.exe game on scratch But hopefully this tutorial has given you a good foundation for creating your own fan-made Sonic games in Scratch! For example, you could add more enemy types, power-ups for Sonic to collect, or different level layouts. Now when you run your code and collide with an enemy sprite, you should lose a life:Ĭongratulations – you’ve now created a basic Sonic.exe game in Scratch! Of course, there’s still a lot more you can do to improve your game. This code will cause any clones of our Sonic sprite (i.e., any sprites that collide with him) to be deleted immediately. We’ll attach this block to our Sonic sprite and then insert a “delete this clone” block inside of it: This block will execute its attached code whenever its parent sprite (in this case, our Sonic sprite) is cloned – which happens whenever Sonic collides with an enemy sprite. To do this, open up the More Blocks category and find the “when I start as a clone” block. Now when we run our code, pressing the spacebar will cause both of our enemies to move – but they’re moving in different directions! Your game should now look something like this:įinally, let’s add some collision detection so that Sonic loses a life when he touches an enemy. To do this, we can change the value in the “y” field of our “change y by” block: However, this time we want our circle enemy to move 10 pixels downwards instead of 10 pixels to the right. Now let’s add another enemy – this time we’ll use a circle sprite:Īs before, we’ll add a “when key pressed” block attached to our circle enemy. This block will cause our enemy square to move 10 pixels to the right whenever the spacebar is pressed. ![]() This time, instead of attaching it to our Sonic sprite, we’ll attach it to our enemy square: Once your enemy sprite has been added, open up the Events blocks and drag out a “when key pressed” block. To add a new enemy sprite, click on the “Choose new sprite from file” button again and select a shape from your computer’s file explorer. For this tutorial, we’ll be using simple shapes like circles and squares for our enemies. Now our code is starting to come together! But there’s one more thing we need to do before our game is playable – we need to add some enemies for Sonic to avoid. This block will cause Sonic to reappear on the other side of the screen when he reaches an edge: ![]() But what happens when he reaches the edge of the screen? He just disappears! We can fix this by adding a “wrap around” block from the More Blocks category. Now when you run your code, pressing the left and right arrow keys will cause Sonic to move, and pressing the spacebar will make him stop. However, if you try running your code now, you’ll notice that Sonic doesn’t stop moving when you release the keys – he just keeps going off the edge of the screen! To fix this, we can add a “when key pressed” block that will cause Sonic to stop moving when the spacebar is pressed: These blocks will cause Sonic to move back and forth when you press the left and right arrow keys on your keyboard. Next, we’ll add a “when key pressed” block so that Sonic can move to the right: ![]() When this block is executed, it will cause Sonic to move 10 pixels to the left. We’ll start by adding a “when key pressed” block from the Events section and attaching it to our sprite: Now that we have our sprite, we need to give him some code so that he can move around and interact with his environment. You should now see Sonic appear in the editor window: Navigate to where you saved the Sonic.exe file and select it. This will open up your computer’s file explorer. To do this, click on the “Choose new sprite from file” button in the bottom left corner of the screen. The first thing we need to do is create a new sprite for Sonic. Once Scratch is installed, open it and you should see the following interface: While there are many different ways to create a Sonic.exe game, this tutorial will show you how to make one using Scratch, a free programming language developed by the Massachusetts Institute of Technology (MIT).īefore we get started, you’ll need to download Scratch from the official website. The object of the game is to guide Sonic through a series of levels, avoiding obstacles and enemies, and ultimately defeating Dr. Sonic.exe is one of the most popular fan-made games based on the Sonic the Hedgehog franchise.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |