I don't remember entirely how Game Maker handles solid objects, but I remember it being rather annoying. Don't they prevent almost all collisions with them? There's usually plenty of situations in a game where projectiles and whatnot are supposed to move through solids.
This might clash a bit with how you're trying to do things, but I always put solid collisions in the Step event rather than the Collision event, so as to avoid getting stuck in solids. Simply use collision_rectangle(bbox_left+horizontalOffset,bbox_top+verticalOffset,bbox_right+horizontalOffset,bbox_bottom+verticalOffset,YourSolidParent,1,1) to test for solid collisions, with one's offsets normally being one's speeds. Why, one could even use the same if statement for collisions with solids above and below the character, should the two situations not be that different. For example:
Code:
if (collision_rectangle(bbox_left,bbox_top+vspeed,bbox_right,bbox_bottom+vspeed,Solid,1,1) && vspeed != 0)
{
move_contact_all(270,vspeed);
if (vspeed > 0)
{
//Put all your code that refreshes all those double jump variables here
gravity = 0;
}
else
//Anything that only happens when bumping one's head on the ceiling
vspeed = 0;
}
I don't remember entirely how Game Maker handles solid objects, but I remember it being rather annoying. Don't they prevent almost all collisions with them? There's usually plenty of situations in a game where projectiles and whatnot are supposed to move through solids.
This might clash a bit with how you're trying to do things, but I always put solid collisions in the Step event rather than the Collision event, so as to avoid getting stuck in solids. Simply use collision_rectangle(bbox_left+horizontalOffset,bbox_top+verticalOffset,bbox_right+horizontalOffset,bbox_bottom+verticalOffset,YourSolidParent,1,1) to test for solid collisions, with one's offsets normally being one's speeds. Why, one could even use the same if statement for collisions with solids above and below the character, should the two situations not be that different. For example:
[code]
if (collision_rectangle(bbox_left,bbox_top+vspeed,bbox_right,bbox_bottom+vspeed,Solid,1,1) && vspeed != 0)
{
move_contact_all(270,vspeed);
if (vspeed > 0)
{
//Put all your code that refreshes all those double jump variables here
gravity = 0;
}
else
//Anything that only happens when bumping one's head on the ceiling
vspeed = 0;
}
[/code]