How to Make a Zombie Survival Game in Scratch!!!

by InsaneMadness in Circuits > Software

3937 Views, 14 Favorites, 0 Comments

How to Make a Zombie Survival Game in Scratch!!!

Survive The Zombie Apocalypse Game in Scratch!!
How to make a Zombie Survival Game in Scratch!!
Screenshot from 2023-02-26 13-43-47.png
Screenshot from 2023-02-26 13-48-45.png

CAN YOU SURVIVE THE ZOMBIE APOCALYPSE? Play the game to find out!!

Supplies

To make this game you only need scratch!!

So start coding!!!

Code the Player

Screenshot from 2023-02-26 13-08-48.png

The first thing we do is code the movement of the player.

After this we make 2 blocks named reset and invincibility for easy coding.

The reset block resets the player and the invincibility block adds special effects to the player when its getting bitten by a zombie.

We need to make a variable called Health.

Now u code the player so that if it touches the zombie, its health decreases by 1.

If the player health is less than 1, the game is over and you lose.

We also want that when we click the mouse, a bullet shoots out of the gun.


Code the Zombie

Screenshot from 2023-02-26 13-26-03.png
Screenshot from 2023-02-26 17-38-36.png
Screenshot from 2023-02-26 17-39-09.png
Screenshot from 2023-02-26 17-37-16.png

We first make a block for the zombie's position.

This block makes sure that the zombie spawns at random places so that the game is unpredictable.

Then you code the zombie so that it keeps cloning itself after a few seconds and moves towards the player.

Make a variable called zombie health. If the zombie touches the bullet, we want its health to decrease by 1.

If a zombie's health is less than 1, the clone gets deleted.

We will add some special effects to this to make it attractive.


Code the Bullet and the Muzzle Flash

Screenshot from 2023-02-26 13-39-11.png
Screenshot from 2023-02-26 13-40-32.png

We code the bullet so that it moves towards the mouse pointer and if it touches a zombie, the clone gets deleted.

The muzzle flash adds special effects to the game which make it appealing to the player.

The size of the muzzle flash should be randomised and it should point towards the player.

Code the Power Up

Screenshot from 2023-02-26 13-56-58.png
Screenshot from 2023-02-26 13-58-16.png
Screenshot from 2023-02-26 13-58-52.png

We want the power up to create a clone of itself if the power ups on the screen are less than 3.

Make a block called collect, this block specifies what will happen to the power up if the player touches it.

We add some effects to make it look like a pro game.

Now, if a player touches the power up, the player's health resets back to 5.

Code the Heart and the Buttons

Screenshot from 2023-02-26 14-09-32.png
Screenshot from 2023-02-26 14-09-20.png
Screenshot from 2023-02-26 14-25-04.png
Screenshot from 2023-02-26 14-25-23.png
Screenshot from 2023-02-26 14-25-28.png

THE HEART


We want the player to have 5 lives, which means 5 hearts, hence we clone the heart 5 times.

You can also add some special effects to the hearts so that when the player loses 1 life, the heart goes away in style.


THE BUTTONS


Start button- We want the button to broadcast a message called start when its clicked. This makes it easier for the game to switch the backdrop to the playing screen.

Instructions button- We want the button to broadcast a message called instructions when its clicked so that the screen can change to the instructions screen.

Back button- When this button is clicked we go back to the home pg/initial screen.


Add Sounds and Code Backdrops

Screenshot from 2023-02-26 17-45-25.png
Screenshot from 2023-02-26 14-33-59.png
Screenshot from 2023-02-26 17-41-56.png
Screenshot from 2023-02-26 14-34-28.png

Add sounds to make your game interesting.

Make sure the switch between your backdrops is smooth.

Finished!!

Enjoy your game!

You can add your own special touches to this game and make it unique.

You can play the game by clicking here.