G
Gino Collins
Guest
Hi everyone,
I'm very new to Gamemaker and GML. I've been stuck on this for a few hours now and feel like this should be obviously simple. I am making a 2D platformer and want the enemies to simply jump up and down, wait a few seconds and then repeat. I finally got the jumping part working but can't seem to get a delay in between jumps.
My jump code is:
vsp += grav;
if (place_meeting(x, y+vsp,objSolid))
{
while(!place_meeting(x,y+sign(vsp),objSolid))
{
y += sign(vsp);
}
vsp = -3;
}
y += vsp;
objSolid is just the floor. I've been messing with alarms and timelines and can't seem to get anything top work correctly. The closest I've got is for the enemy to jump and then it gets stuck in midair and doesn't move. So basically no progress.
What am I missing??
I'm very new to Gamemaker and GML. I've been stuck on this for a few hours now and feel like this should be obviously simple. I am making a 2D platformer and want the enemies to simply jump up and down, wait a few seconds and then repeat. I finally got the jumping part working but can't seem to get a delay in between jumps.
My jump code is:
vsp += grav;
if (place_meeting(x, y+vsp,objSolid))
{
while(!place_meeting(x,y+sign(vsp),objSolid))
{
y += sign(vsp);
}
vsp = -3;
}
y += vsp;
objSolid is just the floor. I've been messing with alarms and timelines and can't seem to get anything top work correctly. The closest I've got is for the enemy to jump and then it gets stuck in midair and doesn't move. So basically no progress.
What am I missing??