• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Windows Fatal Error help?

S

snesicepuppy

Guest
Hey guys! First time user here, I've been watching Shaun Spalding's tutorial on making a platformed, so far everything has gone well, I copied almost exactly what the narrator, the only thing I changed was the name of my objects but for some reason I get the error code
Code:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of  Step Event0
for object obj_player:

Variable obj_player.jumpspeed(100011, -2147483648) not set before reading it.
 at gml_Object_obj_player_StepNormalEvent_1 (line 13) -     vsp = key_jump * -jumpspeed
############################################################################################
Here is what I put in my code

Code:
//Get the player's input
key_right = keyboard_check(vk_right);
key_left = -keyboard_check(vk_left);
key_jump = keyboard_check_pressed(vk_space);

//React to inputs
move = key_left + key_right;
hsp = move * movespeed;
if (vsp < 10) vsp += grav;

if (place_meeting(x,y+1,obj_ground))
{
    vsp = key_jump * -jumpspeed
}

//Horizontal Collision
if (place_meeting(x+hsp,y,obj_ground))
{
    while(!place_meeting(x+sign(hsp),y,obj_ground))
    {
        x += sign(hsp);
    }
    hsp = 0;
}
x += hsp;

//Vertical Collision
if (place_meeting(x,y+vsp,obj_ground))
{
    while(!place_meeting(x,y+sign(vsp),obj_ground))
    {
        y += sign(vsp);
    }
    vsp = 0;
}
y += vsp;
Can anyone explain what I'm doing wrong in the most simple way possible?
 
Top