Pattern Name

mechanics space polish and systems

How to implement this Pattern in MakeCode

Step by Step instructions

This pattern is needed when you have player lives and enemies. There is often a side effect where a player can be overlapped with an enemy. The player needs to be made immune from enemies so that they cannot be harmed and they may also need to be moved. This tutorial assumes you have patrolling enemies and player lives patterns added to your game.

Add a delay and make Immunity obvious

In your overlap listener for the Bumper enemy type we will also play a sound to make it obvious that the player has been zapped.
We will also hange the look of the player sprite.

In the loop you will add in a pause when you lose a life. The pause means you cannot be zapped by players in this period.

make player immune

Test your Changes and Next Steps

Test your game to check that your changes have the desired behaviour and that there are no side effects. For examples if you have more than one type of enemy, like simple static enemies, you will need to add this code in those overlap listeners too.

To check that you are making the most of this pattern you can ask yourself the following questions:

This Game Pattern is one of many allowing you to make improvements to your platform game and to learn coding and wider computing concepts. Find more on the Game Pattern page.