Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to make a shooter game?
- TheBlubStudios
-
100+ posts
How to make a shooter game?
I want to make a Halloween themed shooter game but idk hiw
- EggDOG_MyNAME--Jeff
-
100+ posts
How to make a shooter game?
Well, here's one way to do it:
Make a sprite called “Enemies.” Then, in this sprite, draw whatever enemies you want to be in your game. For example, you may want a zombie, a bat, and a vampire. For this, you'd make a costume for each. Make a variable for this sprite only called “enemy health.” Then, put this code:
Now, make a sprite called “Player.” Draw the player in one costume. Then, make a variable for all sprites named “Health,” and then put the following code:
Make a sprite called “Enemies.” Then, in this sprite, draw whatever enemies you want to be in your game. For example, you may want a zombie, a bat, and a vampire. For this, you'd make a costume for each. Make a variable for this sprite only called “enemy health.” Then, put this code:
Keep in mind, the wait block doesn't have to be a pick random; just make it however long you want the game to wait before creating a new enemy. Also, you can customize how fast the enemy is by changing the value of the ‘move 5 steps’ block. The ‘change enemy health by -3’ block is how much damage the player does to the enemies. You can customize this, but just make sure to put a minus sign infront of any value you put in that block, or else will give the enemy health instead of taking it away.
Now, make a sprite called “Player.” Draw the player in one costume. Then, make a variable for all sprites named “Health,” and then put the following code:
After you've done this, make a new sprite named “Weapon.” This can be a gun, or anything else that shoots projectiles. But when you draw it's costume, make sure to make it point to the right, or the game will not work. Make everything you draw in your game point to the right, or else it will not work. You will also want to make another sprite called “Bullet.” In the gun sprite, put the following code:
The ‘wait 1 seconds’ block will be the cooldown on shooting. You can customize it to your liking. You can also just make the player shoot if the mouse is down, and not if the spacebar is pressed, and vice versa. Now, in the bullet sprite, put these scripts:
The ‘move 6 steps’ block is just how fast the bullet will move. You can customize this. But at the end, you MUST put the ‘wait 0 seconds’ block, or else the game will not work. That is it! You now can customize your game and make it look however you want it to.
Last edited by EggDOG_MyNAME--Jeff (Oct. 23, 2022 22:34:55)
- EggDOG_MyNAME--Jeff
-
100+ posts
How to make a shooter game?
Wait, it's not finished.I'm editing it now.
- EggDOG_MyNAME--Jeff
-
100+ posts
How to make a shooter game?
https://scratch.mit.edu/projects/750069216Nice game! However, I thought you were making more of a top down shooter lol.
If I'd known the type of game you wanted to make, I could've given you more fitting code. But I guess it all worked out in the end!

Last edited by EggDOG_MyNAME--Jeff (Oct. 24, 2022 04:41:41)
- Discussion Forums
- » Help with Scripts
-
» How to make a shooter game?