if place_meeting(x,y,playerKiller){
killPlayer();
}
if place_meeting(x,y,playerKiller) and !place_meeting(x,y,block) {
killPlayer();
}
This ensures that the player will not die when clipping inside a block.
Unless we want to muddy up one of our draw events (gross!) the only way we can ensure one collision check happens before another is by performing the checks in one or more of the 3 Step events.
E.g., we could do both checks in End Step, or do one in Step and another in End Step.
The downside of this is, we incur overhead when we perform a collision check in a Step event instead of using a collision event. (We also might have to rewrite the collision logic due to the change in locale.)
var blockInstance = instance_place(x, y, block);
var collidingWithSolid = false;
while (blockInstance != noone)
{
if (blockInstance.solid)
{
collidingWithSolid = true;
break;
}
ds_stack_push(reactivationStack, blockInstance);
instance_deactivate_object(blockInstance);
blockInstance = instance_place(x, y, block);
}
while (!ds_stack_empty(reactivationStack))
{
instance_activate_object(ds_stack_pop(reactivationStack));
}
if (!collidingWithSolid)
{
if (place_meeting(x,y,playerKiller))
{
killPlayer();
}
}