Using the native Corona Drawing/Joint Functions in conjunction with LD.

Hey all,

I have been working on a side-scroller using Corona and LD. LD is great and once you get accustomed to it it’s very powerful and easy to use.

I am having trouble implementing joints into my game. First off all, I want to work with a pivot joint. (seems like rope joints dont work yet - or they don’t have collision detection)  somewhat similar to the Corona Chains example. I need a rope that has collision detection. I have created the kind of joint I need using pure Corona. ie. fixed at one end while the other end experiences gravity and swings… it the rope attaching the 2 objects collides with another object then the trajectory is articled as the rope deforms around the object it collided with)

Now I want to set up these joints with objects loaded through LD.

Background: The rope will work as a grappling hook from a player to objects. I thought about having a generic joint floating around off screen in my Level and then changing it’s target when necessary. (Similar to how a bullet may work or the bird poo in potty bird). The strange thing is when i try to add a joint to my level nothing happens. I can’t add a joint object. I click on the add joint and i click on my layer and no joint object appears.

So not knowing if this floating joint idea will work (I actually need a series of pivot joints that are linked together (think chains example) with one end connected to the player and other to an object in the level) and not being able to make a joint in LD… I figured I could make the joint in pure Corona and then add it to the  game this way… outside of the level editor. Two things i am unsure about and hence my questions are:

  1. Can you add a graphics objects loaded through corona and not the LD to the same viewGroup as the Level? ie. can you easily draw over the level without messing with it too much? if so can you point me in the right direction to this?

  2. Is  the physics loaded through LD and the level compatible with the physics of objects I load outside of the Level. Ie. can I program joints in pure Corona that work with objects loaded through the LD. ie. collision detection and joint objects.

I am only wondering if anyone has tried (and succeeded?) with any of this or if it is even possible? I know that my other option is to play around with the LD library and edit it around my needs.

Any help or suggestions would be greatly appreciated.

Examples I would be looking for would be how to add a graphics object through corona and no the LD and have it interact in some way with an object loaded with LD… or have it draw "over top: of the level.

Maybe someone may be able to tell me why my joint button does not seem to work in LD? (this could be plain ignorance)

Lastly, joints programmed outside of the LD being used with LD objects… possible? yes/no? any possible avanues to check out on how to do this.

Thanks in advance.

Patrick

 

Hi,

Sorry for the delay, been travelling with work.

Have you made any progress with using joints in LD?

Once you have clicked on the Joint tool, you will need to click on two objects to add the joint between them (you should a visual representation of the joint as a line).

Make sure physics are setup on the two objects you have selected.

You can add non-LD objects quite easily by obtaining a layer view and inserting them or if you’re using the built in scrolling then you can use the createObject function.

See here for more details :  http://www.retrofitproductions.com/level-director/utility-library/

Let me know if this helps.

Thank you, yes I have the joints working now. My initial mistake when making joints directly in LD was to make them between objects in different layers. But I was able to add them in my Lua code using the getLayerObject commands of the Utility Library. Thanks I was finally able to develop the key game mechanic for the game.

Hi,

Sorry for the delay, been travelling with work.

Have you made any progress with using joints in LD?

Once you have clicked on the Joint tool, you will need to click on two objects to add the joint between them (you should a visual representation of the joint as a line).

Make sure physics are setup on the two objects you have selected.

You can add non-LD objects quite easily by obtaining a layer view and inserting them or if you’re using the built in scrolling then you can use the createObject function.

See here for more details :  http://www.retrofitproductions.com/level-director/utility-library/

Let me know if this helps.

Thank you, yes I have the joints working now. My initial mistake when making joints directly in LD was to make them between objects in different layers. But I was able to add them in my Lua code using the getLayerObject commands of the Utility Library. Thanks I was finally able to develop the key game mechanic for the game.