I MADE A ZOMBIE GAME IN SCRATCH ☠️
Tags: webdev, javascript, beginners, scratch
Published: 2024-05-22 07:01:29

Scratch, the drag and drop programming language developed at the MIT for little children below 10 years. Well well well, today that is going to be my challenge to create a game in scratch. First things guys, scratch has no APIS, LIBRARIES, NPM PACKAGES AND MORE IMPORTANTLY you can play your game only inside scratch. You cannot export your project. Well, that never stopped me. The first thing I needed was a thought.

## IDEA 💡

I needed a good enough idea so that I can build upon it. I recently watched this netflix series, **ALL OF US ARE DEAD**. I thought, WHY NOT.

So I got my idea. I will be making a zombie shooter game

<img src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExdTlsbHNheDQ0bm1mbWhlZG1kbjNwbWllMzJxaGoxcWloN2tkd3AwcSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/26BRsMORsLfckuBTa/giphy.gif"/>

## PLAYER

I gotta get the player in order to start. Before starting to dive inside scratch. I watched GRIFFPATCH, ZONXSCRATCH AND SHIFTCLICKLEARN channel videos. They were sincerely useful guys. I thought I want a nice circle as a player. So, I drew out a simple yellow circle with eyes and not mouth. I got 5 costumes an idle one and one for every movment. I gave a smooth movment. Thanks to zonxscratch. Next up I needed a gun

<img src="https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExeXUzemJ4eDh0MjM0ajZ6aGxscjFkZHVvcGZob3U4b281NXhiemFsdCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/13Vb4FWqXtjP3y/giphy.gif"/>

## Gun

I simply made a gun using some geometrical figures. (* secret: I am good in geometry but bad in algebra *). Then I used the go to block to go to the player in a forever game loop. They I made it like this so that it would always point towards the mouse pointer. After all this I took a good night's rest and started day 2 freshly

<img src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYzN0dHVsazMwZGZiaWVtOHpwY3RtZmZoNDkwaWc1OTU2cDlzNDZ5cCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/WnMOl2Ogz2x35sPJMk/giphy.gif"/>

## Bullet

I made a simple bullet, which in my sense looks good. I keep it hidden all the time. Whenever the player presses the key space I would create a clone of the bullet. When the bullet starts as clone using the same go to block I would make it go to the gun and point towards the gun. Then I would make it move a number of steps according to the gun variable. You will understand about the gun variable after some time. Good now the bullet does not work. What have I done. OH ! I forgot to show the bullet when it starts as a clone. oof bro.

<img src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExd3NucDRpOWt4bjR1ZW9tc3hoY29pM2Uyd3NwN3Fscjl0NmZuOXFzeiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/QS0KOjNRG0tfG/giphy.gif"/>


## Enemies

Now for the enemies we need zombies that would march towars cheong san. What should I do......

<img src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExZDl6emZlNDVyZjdxdnp2dGFsMG5wb2piMXJ1NjczMTg0OG1jMTkxMCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/nhklNniaxTXoI/giphy.gif"/>

Ah ! Make a zombie costume

Since, I making this game in scratch it should be cute. So I drew a cute zombie circle and made it point towards the player and move ten steps inside the game loop. Then whenever the zombie touches the bullet. The clone gets deleted and whenever the zombie touches the player I decided to stop all. And now I have a fully functional zombie shooter game

## Backdrop

For some reason, In scratch background is called backdrop. I quickly created a really ugly backdrop. Well, I hade no ideas !

<img src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExaXdic2NmYjRkdnM4dTQxbnpwNnFqaXJ6N3JsbWhqdGYxNGF3aDIzMSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/xUPGcIXRbDWVdNAucg/giphy.gif"/>

## More enemies and score

I made a bunch more enemies and made the costumes change randomly and also I added a score, so people would compete with each other. Finally, with the high score the game was better

<img src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExdjA1ajhudGU5bGszMWluMms2eno5bDljdXNiODZhM2F4OGkyN3AzeSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/d641Vw8qFrNI8rMNZG/giphy.gif"/>

## Thumbnail and end screen

I watched a youtube video and set a simple thunbnail and scratch. I also added a game over screen. so that you know you die

<img src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExMG94YWw1dWsyMDN6OHJvam90dmM2dW9heXVxY3ZkbmoxbTFtYWEyNiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/t1HJXy5Q5NKA8/giphy.gif"/>

## TWEAKS

I gave different end screens for different number of kills. There are awesome end screens when you cross 50 kills. So do it. I added some sound affects and animation to the gun. The zombie would scream when you kill it. The player would scream if he dies. I added an inventory of guns using the gun variable we used earlier. The game is complete and the game is now online. Please try it guys

<img src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExZWZkaWdrOXhtMDg4bTRvdTJwaDl4ZXZrc3Y4OXE2MGRwdmpnanNwdCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/heIX5HfWgEYlW/giphy.gif"/>

(❁´◡`❁)

[CLICK ME TO TRY THE GAME](https://scratch.mit.edu/projects/1022672044)

Guys, you made it to the end of the screen. Now it's shoutout time.

<img src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExczgyczRxOWNwN3Fjbm1jeTNmZnQ4Y2txdjhoZWF0MmhzdjVqZTYyYSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/33dyVSDTJxk21qdV9k/giphy.gif"/>

Shoutout to my followers:

@stepuravg 
@zkils999
@cnavarro06 

Take a look at [my website](https://citeal.web.app)

Follow my:

[DAILY.DEV](https://dly.to/GVlr2WEZS3Q)
[CODEPEN](https://codepen.io/Gitguy2328_xprogram)
[SCRATCH](https://scratch.mit.edu/users/Mince_Creator/)

Have a nice day