196
Programming Questions / Yuuutu engine block/platform death bug fix
« on: June 27, 2013, 12:39:49 PM »
Some of you may have noticed that you can die from weird circumstances in the Yuuutu engine (maybe in others too I havent tested) such as: standing on the edge of a miniblock when there's a spike there, standing on a platform with a spike just under it or on the same level, or that one pixel align in my game where the spike kills you through the miniblocks.
You may have also noticed this in several places in IWKTK2 (mainly the kill the guy room).
---------------------------------------------------
why this happens: gamemaker reads its events from top to bottom each step, the event for the player to be pushed out on top of miniblocks or platforms and be spared from death is after the playerkiller collision detection. normal blocks are before which is why it doesn't happen with them.
-------------------------------------
solution: since we cannot reorder the events in GM that easily we need to simulate playerkiller collision at the end of the step.
---------------------------------------------
code: in player object (and player2 if on yuuutu engine) go onto collision with playerkiller and delete the code in there.
add a step event and pick end step, put in the following code:
if place_meeting(x,y,playerKiller) { with(player){killPlayer();} }
---------------------------------------------------------
Hopefully this will help and isn't too much of a mess, I'm not great at writing such things up.
Thanks to Sephalos for giving me GML for the solution
You may have also noticed this in several places in IWKTK2 (mainly the kill the guy room).
---------------------------------------------------
why this happens: gamemaker reads its events from top to bottom each step, the event for the player to be pushed out on top of miniblocks or platforms and be spared from death is after the playerkiller collision detection. normal blocks are before which is why it doesn't happen with them.
-------------------------------------
solution: since we cannot reorder the events in GM that easily we need to simulate playerkiller collision at the end of the step.
---------------------------------------------
code: in player object (and player2 if on yuuutu engine) go onto collision with playerkiller and delete the code in there.
add a step event and pick end step, put in the following code:
if place_meeting(x,y,playerKiller) { with(player){killPlayer();} }
---------------------------------------------------------
Hopefully this will help and isn't too much of a mess, I'm not great at writing such things up.
Thanks to Sephalos for giving me GML for the solution