Makecode Arcade Classic 'food From the Sky' Game With a Twist

by R-Z Lorinc in Circuits > Software

378 Views, 2 Favorites, 0 Comments

Makecode Arcade Classic 'food From the Sky' Game With a Twist

kép_2023-02-20_010256427.png

Just a small and simple game to kill some time. Easy to make and upgrade. You can try it out here

Supplies

kép_2023-02-20_010613608.png

You'll only need the arcade makecode website which is available here.

Assets

kép_2023-02-20_090947201.png
kép_2023-02-20_091106107.png

Both the plate and the background are available in the 'gallery' so you don't have to draw them yourself. 'Check' is a 160x1 sprite at the bottom of the screen. It will be used to detect items touching the bottom of the screen.

Variables

kép_2023-02-20_011205618.png

check - the check sprite. used for detection.

fall - will be used in the creation of falling objects.

fallist - list of the images of falling things.

intensity - the speed of the game and the time between the creation of objects. This is a pretty weird name, because ​ ​ the smaller the intensity, the faster the game.

list, mySprite - default variables. You don't actually need them.

plate - the plate sprite

tmp -temporary value used to choose what kind of object will be created.

tmp2 - temporary value used to select the roast the game will tell you if you lose a hp.

Start Function

kép_2023-02-20_011053369.png
kép_2023-02-20_092022570.png

First, you print the instructions. Then you set starting values (hp, score, locations) and create the player and the check sprite. The player sprite should be somewhere at the bottom and the check sprite at the very bottom. Then you set the images of the falling objects in the 'fallist'. The food should be at the beginning and the other things should be at the end. Remember how many food sprites are on the list, because we will need them later. And lastly, We play a sound indicating the start of the game.

Loops

kép_2023-02-20_093018611.png
kép_2023-02-20_093033570.png
kép_2023-02-20_093053744.png

Game update every 5000ms - We subtract 50 from the intensity every 5 seconds.

On game update - We move the player based on the inputs. We also check if the player needs encouragement.

On game update every intensity-ms - choose a random number from 0 to the length of the fallist - 1. Then we create a sprite based on the number we just picked. This sprite will automatically be labelled as food. Next, we position it and set its vertical speed to some value based on the intensity. Here, in this case, I have 10 food sprites on the list. I subtract 1 from it 10 - 1 = 9, and I check if the number of the item, that I just created is greater than 9. if it is, I label it as an enemy.

The B Button

kép_2023-02-20_094201606.png

If the player releases the 'B' button, we check if they have more than 10 points, and if they have, we subtract ten from the score and add 1 to the hp.

Collisions: Player - Food

kép_2023-02-20_094451836.png

Destroy the food and add 1 to the score.

Collisions: Player - Enemy

kép_2023-02-20_094557691.png

Destroy the enemy, decrease hp and roast the player.

Collisions: Check - Food

kép_2023-02-20_094859673.png

Destroy the food, decrease the hp and roast the player.

Collisions: Check - Enemy

kép_2023-02-20_094714259.png

If the enemy touches the bottom of the screen, destroy it, and add 1 to the score

Roasting the Player

kép_2023-02-20_095006873.png

Choose a random roast and say it. You can add more roasts and get more, well... creative.