GameMaker - Platform

A simple platform game with objects that interact with the player.

Player

///Player Variables
grav = 0.2;
hsp = 0;
vsp = 0;
jspeed = 3;
jumpPad = 6;
mspeed = 2;

didPlayerJump = false
///Player Controller
key_left = -keyboard_check(ord("A"));
key_right = keyboard_check(ord("D"));
key_jump = keyboard_check_pressed(vk_space);
///Player Movement
move = key_left + key_right;    //1 or -1
hsp = move * mspeed;            //Trigger move speed

if(vsp < 10) {
    vsp += grav;
}

if(key_jump){
    didPlayerJump = true;
    sound_play(sound3_jump);
}

//Player Jump Pad
if(place_meeting(x,y+1,objJumpPlatform)){
   vsp = key_jump * -jumpPad;   //Trigger jump speed
}

script_execute(PlayerCollisionScript);

x += hsp;
y += vsp;
///Player Touched Enemy
if(place_meeting(x,y,objEnemy)){
    objHUD.didPlayerDie = true;
    instance_destroy()
}

Platform