Legacy GM room restart if player between wall and vertical platform

  • Thread starter SonicTheHedgehog+123
  • Start date
S

SonicTheHedgehog+123

Guest
Hello everyone
I dont know wich code could be the function that I want.
My task is to make the player restart if he is between the wall and the y-axis of the vertcal platform.
Here is a picture:
Screenshot (7).png

This is a problem that I didnt find a solution on youtube or somewhere else.
It would be nice if someone could help me.:p
 
Last edited by a moderator:

Nocturne

Friendly Tyrant
Forum Staff
Admin
Just have the vertical object check and see if the player is underneath, and if it is, then check if the player is on the ground or not, and if that's true then restart. Check the collision function but place_meeting() will probably do what you want.
 
S

SonicTheHedgehog+123

Guest
Thanks for repliying.
But how do I put this in code. The only thing I could figure out so far is this code:

Object Vertical Platform

Collision Event with object player

if place_meeting(x,Fledermaus_Bild.y,Fledermaus_Bild)
{
room_goto(Restart)
}
 
S

SonicTheHedgehog+123

Guest
something like that:

if place_meeting(x,y,obj.player) && place_meeting(x,y,obj.wall)
{
room_goto(Restart)
}

but how should i define if the player is above or below the wall or the plattform?
 
S

SonicTheHedgehog+123

Guest
But how can I find out the position(that is when the player is meeting with the platform)?

srry for that many questions:oops:
 
S

SonicTheHedgehog+123

Guest
It didint work maybe because my platform is solid.
However now I must sleep.:bunny:
 
S

SonicTheHedgehog+123

Guest
I worked on the problem and it gets better but the only problem I have now is that my player gets stuck if the vertical platform is moving downwards. I dont know why.
Code:
if place_meeting(x,y+1,Beweger)&& place_meeting(x,y+1,Wand)
{room_goto(Restart)}
 

Yal

🐧 *penguin noises*
GMC Elder
If the platform moves downwards it's not at y+1 anymore next step
 
Top