I am working on the classic platformer scenario when the ceiling is coming down and the floor is coming up and you are stuck in between. I want a crushing event of some sort. My player box is about 128px tall by 64px wide. I have three types of crushers where the ceiling comes down, (like in Mario) where the floor comes up, and where they both come together. I am controlling the moving crushers using Custom Movement. But, without a crushing event my playerbox gets teleported to a safe area instead of being crushed.
Currently i just deal with the teleporting problem as a temporary glitch. I think i can keep it from happening, i am just not sure how. I also have the same problem when my player is crouched and enters a lower area. If you release crouch then you teleport to the nearest solid play area. Its actually kind of neat, but it can be unpredictable.
I would like to give the player a bit of squish as the ceiling closes in, say 10px smaller than their bounding box. Then, after that point the player is crushed and killed. The bounding box is linked to crouching too so when he is crouched he should still be crushed. Maybe i could even force the player to crouch if the area is too small?
I am trying to find a good way to do this, and they all involve specific Y positions for every crushing object, along with a death zone trigger within the crush region. So basically if the player is in the crush region, and the Y position of the crushing block is beyond a certain point, then kill the player. I have to manually figure out for the Y position for each crusher. I want to find a way to use a single crusher object and just copy it. Now I am creating unique objects and writing specific events for each and every crusher. It works... but it is clumsy and difficult to manipulate.
Has anyone else done any work with crushing???
Anyway, any other input would be very useful!