Page 1 of 1
[Solved]Stairs
Posted: Mon Sep 08, 2014 12:10 am
by Dr.Tyler O.
Basically if a body (the player) collides with another body (the stair) that is of a certain height then allow the player to move over the stair.
Edit: To my knowledge, Love won't allow a body to travel over another body regardless of how short the second body is. I could be wrong but from what I've experienced, that seems to be the case.
Re: Stairs
Posted: Mon Sep 08, 2014 7:02 am
by rmcode
Not sure what you are asking here ... ?
Re: Stairs
Posted: Mon Sep 08, 2014 8:19 am
by Dr.Tyler O.
rmcode wrote:Not sure what you are asking here ... ?
With all due respect, how is that difficult to understand? I want to know how to allow a body to travel over another body if the "stair" is at or below a certain height. Think of a flight of stairs in real life for instance, you couldn't step over a stair that was three feet tall. The problem being that
Love won't allow a body to travel over another body regardless of how short it is.
Re: Stairs
Posted: Mon Sep 08, 2014 8:32 am
by rmcode
Dr.Tyler O. wrote:rmcode wrote:Not sure what you are asking here ... ?
With all due respect, how is that difficult to understand?
With all due respect, using question marks and asking an actual question would've helped
Are you using box2d for collisions?
Re: Stairs
Posted: Mon Sep 08, 2014 8:57 am
by Dr.Tyler O.
No, I'm just using Love's physics system.
Re: Stairs
Posted: Mon Sep 08, 2014 9:02 am
by rmcode
Dr.Tyler O. wrote:No, I'm just using Love's physics system.
Then what you probably need is sensors:
http://www.iforce2d.net/b2dtut/sensors
and
https://love2d.org/wiki/Fixture:setSensor
IIRC there is also an example for this in the examples.love:
http://www.love2d.org/wiki/examples.love
Re: Stairs
Posted: Mon Sep 08, 2014 9:17 am
by Dr.Tyler O.
Thanks for pointing me in the right direction. Also the 0.9.0 example browser doesn't contain an example of this.
Re: Stairs
Posted: Mon Sep 08, 2014 9:18 am
by Plu
For completeness' sake, love.physics uses box2d, so they're basically the same.
Also, it really helps if you upload a .love file of what you've made so far, because from the description in the opening post you could've been using a lot of different things and we have no real way of figuring out what kind of help you need.