One way platforms with isSensor

Could anyone explain to me how to create a one way platfom in lime. I add a platform object into the tiled map but how do I change its property dynamically in corona? [import]uid: 148866 topic_id: 32839 reply_id: 332839[/import]

i did a small sample for myself on this. I’ll look and see if I can find it somewhere, but here is the gist of what if did.

you need to keep track of your person to see if they are falling or jumping.

you do this by using a run time event listener and keeping track of the “y” position and previous y position of your character.

By using isSensor the character is able to collide with the platform but no collision actions happen and the character is able to pass through the platform, but because it is a sensor you can detect what is happening, speed, velocity, etc…

Based on if the character is falling or jumping you can then check when the character collides with the platform to determine weather to allow the character to continue and move through ( going up ) the platform or if they are falling down and hit the platform you then bounce them up with an impulse or something like that.

I hope this is not to confusing.

Larry Meadows [import]uid: 11860 topic_id: 32839 reply_id: 130538[/import]

Thats sort of what I have however it seems that you have to hit the platform first to switch the mode then it lets me go through it on the second collision? [import]uid: 148866 topic_id: 32839 reply_id: 130541[/import]

i did a small sample for myself on this. I’ll look and see if I can find it somewhere, but here is the gist of what if did.

you need to keep track of your person to see if they are falling or jumping.

you do this by using a run time event listener and keeping track of the “y” position and previous y position of your character.

By using isSensor the character is able to collide with the platform but no collision actions happen and the character is able to pass through the platform, but because it is a sensor you can detect what is happening, speed, velocity, etc…

Based on if the character is falling or jumping you can then check when the character collides with the platform to determine weather to allow the character to continue and move through ( going up ) the platform or if they are falling down and hit the platform you then bounce them up with an impulse or something like that.

I hope this is not to confusing.

Larry Meadows [import]uid: 11860 topic_id: 32839 reply_id: 130538[/import]

I did not have that issue, but I did that example a good while back.

its all very crude, I’ll search my drive for it and see if I can find it

Larry [import]uid: 11860 topic_id: 32839 reply_id: 130542[/import]

Thats sort of what I have however it seems that you have to hit the platform first to switch the mode then it lets me go through it on the second collision? [import]uid: 148866 topic_id: 32839 reply_id: 130541[/import]

I did not have that issue, but I did that example a good while back.

its all very crude, I’ll search my drive for it and see if I can find it

Larry [import]uid: 11860 topic_id: 32839 reply_id: 130542[/import]

Thanks for your help Larry [import]uid: 148866 topic_id: 32839 reply_id: 130544[/import]

Thanks for your help Larry [import]uid: 148866 topic_id: 32839 reply_id: 130544[/import]

Seem to have got around it by changing the player to isSensor true. [import]uid: 148866 topic_id: 32839 reply_id: 130549[/import]

Seem to have got around it by changing the player to isSensor true. [import]uid: 148866 topic_id: 32839 reply_id: 130549[/import]

Looking at the sample code from the platformer tutorial on LIME’s website helped me out when I was struggling with this. You need to decide which part of the platform the player is hitting and react accordingly. Easy to conceive, hard to implement, but the code there is very useful. [import]uid: 135394 topic_id: 32839 reply_id: 130556[/import]

Looking at the sample code from the platformer tutorial on LIME’s website helped me out when I was struggling with this. You need to decide which part of the platform the player is hitting and react accordingly. Easy to conceive, hard to implement, but the code there is very useful. [import]uid: 135394 topic_id: 32839 reply_id: 130556[/import]

What I couldn’t get is once I had defined the object in tiled how to address it in corona. So if you added say a new rectangle in corona it was a case of myRectangle.isSensor = true but still I cant understand how you do that to your tiled object? [import]uid: 148866 topic_id: 32839 reply_id: 130560[/import]

What I couldn’t get is once I had defined the object in tiled how to address it in corona. So if you added say a new rectangle in corona it was a case of myRectangle.isSensor = true but still I cant understand how you do that to your tiled object? [import]uid: 148866 topic_id: 32839 reply_id: 130560[/import]

In order to make an object a sensor in Tiled with Lime, set the Name field to isSensor, and the value to true. Remember to be careful in platformers with this, because collisions still register and if you have sprite changes set to listen for collisions, you’ll get weird results when you have your player jump through the sensor’ed object. Let me know if that helps. [import]uid: 135394 topic_id: 32839 reply_id: 130563[/import]

In order to make an object a sensor in Tiled with Lime, set the Name field to isSensor, and the value to true. Remember to be careful in platformers with this, because collisions still register and if you have sprite changes set to listen for collisions, you’ll get weird results when you have your player jump through the sensor’ed object. Let me know if that helps. [import]uid: 135394 topic_id: 32839 reply_id: 130563[/import]