We have the player, now we need a world to place it in. Since we are making a platformer, we are going to use two types of building block: a ground object and a platform object. The ground will be impassable to the player and will be used for the outer perimeter. The platform object will allow the player to jump through and then land upon it:
spr_Ground
, and load Chapter 5/Sprites/Ground.gif
with Remove Background not checked. Click OK.obj_Ground
, and assign spr_Ground
as the Sprite.BossArena
and change the Width to 800
. We will want a good size room to fight in.obj_Ground
around the border of the room. Also add a single instance of obj_Player
near the floor of the room.spr_Platform
, and load Chapter 5/Sprites/Platform.gif
with Remove Background not checked. Click on OK.obj_Platform
, and assign spr_Platform
as the Sprite.scr_Platform_EndStep
, with the following code:if (obj_Player.y < y) { solid= true; } else { solid= false; }
Here we compare the player's Y coordinate with the Y coordinate of the instance. If the player is above it, then the platform should be solid. Otherwise it is not solid and the player can jump through it.
obj_Platform
, add a Step | End Step event and apply this script. We run this code at the end of the step because we want to change only after the player has actually moved, but before it does another forecast.BossArena
and add some platforms for the player to jump onto. The player can only jump around 128 pixels, so make sure the platforms are placed appropriately, such as can be seen below.We have successfully developed a series of systems for a platforming game. It required us to separate common elements such as the animation system and controls into unique scripts. If we were to stop here, it may feel like we did a lot of extra work for nothing. However, as we start building our boss battle, we will start reaping the rewards for this effort.
3.144.9.169