Makecode Arcade Classic 'food From the Sky' Game With a Twist
by R-Z Lorinc in Circuits > Software
441 Views, 2 Favorites, 0 Comments
Makecode Arcade Classic 'food From the Sky' Game With a Twist
Just a small and simple game to kill some time. Easy to make and upgrade. You can try it out here
Supplies
You'll only need the arcade makecode website which is available here.
Assets
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
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
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
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
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
Destroy the food and add 1 to the score.
Collisions: Player - Enemy
Destroy the enemy, decrease hp and roast the player.
Collisions: Check - Food
Destroy the food, decrease the hp and roast the player.
Collisions: Check - Enemy
If the enemy touches the bottom of the screen, destroy it, and add 1 to the score
Roasting the Player
Choose a random roast and say it. You can add more roasts and get more, well... creative.