Remixing a Platformer Game - Power Up Higher Jump

power up higher jump

How to implement this Pattern in MakeCode

Create our power up sprite

To create a power up we will replicate the for element loop used to display the Food elements on our game. So the first step is to duplicate that and to make changes to the values. You can find more detailed instructions on how to do this is the create static enemies pattern. To start change your level Tilemap design to add a new colour tile to act as our power up and change the design to include an area that the player would not be able to access with their normal jump.

power up higher jump

Follow the code pattern shown in the screenshot below to make the power up appear in our game. power up higher jump

Create a new Variable

To be able to change the jump height of our player we will need to create a new variable for our game. This will then be used when the player presses the jump button. To do this create a new variable called jumpVelocity and and set it to the value you have in your on A button pressed input listener.

power up higher jump

Change Input Listener

You can now replace the original velocity y (vy) value with this new variable.

power up higher jump

Create the new Variable Value

Then we will add a condition listener to see when the player is overlapping this power up. When they do we can make the power up dissappear and increase the velocity of the players jump. By increasing the value of the variable that we have just created.

power up higher jump

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.

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.