top of page
finished book.png
big piece of paper.png
big piece of paper.png

This is how the sliding on the wall part of the game works, using the vsp, vertical speed, and applying gravity to it, so when the player collides with a wall, it uses a different set of variables rather than gravity to make a slower descent.

I added the dash to the game at the same time as the wall jump since a lot of the code would end up getting changed if they were added separately. the function dash checks if the players pressed dash. It then changes the hsp using the move to determine the direction and the speed of the dash, which moves the character quickly in that direction for the duration of the dash, which is set to 10.

programming box.png

if (dashduration > 0) vsp = 0;
else if (onWall != 0) vsp = min(vsp + 0.2, 3); //flora is a nerd
else vsp = vsp + grv;

if (dashunlocked = true)
{if (dash && move != 0)
dashduration = 10;
hsp = move * dashspd;
}}

tape but again.png
iphone case_edited.png
big piece of paper.png
big piece of paper.png

This is how the player moves left and right as well as jumps. The hsp = move * walkspis constant as if move = 0 then the player wouldn't move. When the player presses jump it checks the conditions of where the player is such as on a wall or on the ground and checks what kind of jump the player would do. For example off the ground the vsp is changed to -12 which moves the player up. But on the wall we want it to do a different kind of jump. The double jump is also added here as, it then means its not needed to be added later. The double jump is very simple we just added a variable that counts the number of jumps and stops the player jumping if it passes 1

programming box.png

if (onGround = 1)
       {
vsp = -12;
       
jumps = 1;}
       
       
if (onWall != 0)
       {
vsp = -12
          jumps = 1;
         
hsp = onWall * walksp;
         
mvtlock = 10;
}}}

programming box.png

if (key_jump && jumps != jumpsmax
{

  image_angle = 0;
 
sprite_index = sPlayerJump;
       if (jumpsunlocked = true)
       
{
       if (jumps = 1)
       
{ vsp = -8;
         
jumps = 2;
       
}
       }

programming box.png

if (mvtlock <= 0 && dashduration <= 0) // stop the player from jumping
{

hsp = move * walksp;

bottom of page