• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM [SOLVED] Top down rpg, how to efficiently check if a player is not on the ground.

S

ShuDiZo

Guest
I've got another method using collisions with objects, state system and alarms. But the player slides across the object instead of falling off.

Notice, this is not a platform game.

What I need help with specifically, is detecting the players physical x and physical y variable. Checking if the player is off the ground and if the player is in its dash state. Is there a better way of detecting the players position? Thank you in advance
 
M

muddman

Guest
I
What I need help with specifically, is detecting the players physical x and physical y variable. Checking if the player is off the ground and if the player is in its dash state. Is there a better way of detecting the players position? Thank you in advance
Are you using the Physics engine? I'm confused how you have a concept of a ground and falling on a top down RPG.
 
S

ShuDiZo

Guest
Are you using the Physics engine? I'm confused how you have a concept of a ground and falling on a top down RPG.
Engine? But yes, I am using physics in my game rooms. The physics world is ticked.
Collisions most collisions are using physics.

If you need an example, hyper light drifter's Player falling off platforms is a great example.
 
M

muddman

Guest
Engine? But yes, I am using physics in my game rooms. The physics world is ticked.
Collisions most collisions are using physics.

If you need an example, hyper light drifter's Player falling off platforms is a great example.
Are you following HeartBeasts tutorials? There's been some strong opinions here on the boards on his use of physics for movement in a non physics game. See here for more info https://forum.yoyogames.com/index.p...turn-on-the-physics-system.34292/#post-213378. I tend to agree. There are plenty of tutorials out there to come up with your own collision detection and movement schemas.

That said, your player is either at x, y (if not using physics) or at phy_position_x, or phy_position_y. I don't know of a better way to tell. With regard to your states, I think the technique to use is in your question, a state machine. Your player obj should know which state the player is currently in. Is it dashing, walking, falling, idle, etc. It's up to you to manage all of that.
 
S

ShuDiZo

Guest
Are you following HeartBeasts tutorials? There's been some strong opinions here on the boards on his use of physics for movement in a non physics game. See here for more info https://forum.yoyogames.com/index.p...turn-on-the-physics-system.34292/#post-213378. I tend to agree. There are plenty of tutorials out there to come up with your own collision detection and movement schemas.

That said, your player is either at x, y (if not using physics) or at phy_position_x, or phy_position_y. I don't know of a better way to tell. With regard to your states, I think the technique to use is in your question, a state machine. Your player obj should know which state the player is currently in. Is it dashing, walking, falling, idle, etc. It's up to you to manage all of that.
Although I am not following heart beast's tutorial, thank you for your help. I've found a solution.

I had the players x and y values saved as previous_x and previous_y before the dash state. At the same time, a line of code detects if the previous x and y values are colliding with any solid objects. If Yes, the previous x and y values will change to the closest empty position.
 
Top