Vegan wars
The goal : You’re a lonely pepper in the space and your mission is to fight for the expansion of veganism in the world ! To do this, you must blast the evil meat that will appear in front of you … Pay attention not to get hurt by these foes more than three times, otherwise the game will be over. Good luck ! (Tip : If you manage to survive long enough, get ready for a surprise…)
How to play : You can control the pepper by using the < (left) and > (right) arrow keys on your keyboard. In order to shoot, use the space bar or the up arrow key.
Behind the scenes :
To introduce our program’s script, we’ll use the boss’ script that appears once you eliminated 19 foes. Every time you click / catch on one of these, the program adds 1 to the variable called “score”. Once this variable reaches 19 (it means that you busted 19 meats), a message called “Summon the boss” is broadcast, meaning that all the blocks stacked with the “When I receive [Summon the boss]” message will execute. Here, there’s a bunch of blocks that execute when this message is broadcast : The popping rate of the meats is set to 2.2, their speed is set to 5, the boss points in direction -90 (downwards), goes to [0 ; 100], its size is set to 0% (very small) and a whirl effect is applied to 400. Then the program repeats 40 times to change the whirl effect by -10 and increase the size by 2. It creates a nice appearing animation when the boss is showed on the screen. The other variables that are set to 1 are just there in order to make sure that the meats aren’t showing up while the boss is summoning.
When the boss has finished to summon, the variable “boss lives” are set to 10 and the variable “summoning the boss” is set to 0, to indicate the boss finished it’s summoning animation, whenever it touches the ball shot by the player, the boss lives is changed by -1, and it’s size is reduced by -5%. Then it hides whenever lives fall to 0, or that the player lives fall to 0, it either shows the winning screen or the losing screen. To finish, until the boss lives fall to 0, it moves from left to right, and when the boss lives reaches 0, the player wins.