Is is possible to connect a large sensor circle to a smaller dynamic object?

Hi peeps,

I have a space-ship which is a dynamic object (its physics.addbody has a radius so it is circular). I want to connect a second larger circle which is a sensor using the center point of the space-ship. (I want my sensor circle to move around with my ship).

In other words I want my smaller dynamic circle to be within the larger sensor circle (and move them around together). Is this possible?

Note: I am not using the Graphics 2.0 version of Corona.

I have a “sensor circle” attached to my enemy tanks, I use it as a type of radar for detecting the player 'n such.
Since your parent object will be moving, just attach it via ‘weld’ joint.
Here is what I use in my game:
physics.newJoint( “weld”, tank.body, tank.radar, tank.body.x, tank.body.y )

Cheers!

-Saer

Edit: I also have not coverted to G2 yet, so your shouldn’t have any problems.

Hi Saer,

Thanks for your reply, I will try that.

Since you have done a tank game, do you happen to know how to do this?

http://forums.coronalabs.com/topic/41625-fixing-the-rotation-of-a-background-group-so-that-everything-rotates-around-the-display-center/

Panc posted examples for me, but although I could see where the code was that I wanted, I couldn’t decipher it as I am a beginner to Corona. Do you know of a much simpler solution I could use? With example code? Thanks in advance :slight_smile:

My game utilizes a camera module. Basically, I insert objects I want to track into the camera’s display-group and then set the player as the focus object.

Joystick
Camera

Sorry I can’t be of more help.

-Saer

I have a “sensor circle” attached to my enemy tanks, I use it as a type of radar for detecting the player 'n such.
Since your parent object will be moving, just attach it via ‘weld’ joint.
Here is what I use in my game:
physics.newJoint( “weld”, tank.body, tank.radar, tank.body.x, tank.body.y )

Cheers!

-Saer

Edit: I also have not coverted to G2 yet, so your shouldn’t have any problems.

Hi Saer,

Thanks for your reply, I will try that.

Since you have done a tank game, do you happen to know how to do this?

http://forums.coronalabs.com/topic/41625-fixing-the-rotation-of-a-background-group-so-that-everything-rotates-around-the-display-center/

Panc posted examples for me, but although I could see where the code was that I wanted, I couldn’t decipher it as I am a beginner to Corona. Do you know of a much simpler solution I could use? With example code? Thanks in advance :slight_smile:

My game utilizes a camera module. Basically, I insert objects I want to track into the camera’s display-group and then set the player as the focus object.

Joystick
Camera

Sorry I can’t be of more help.

-Saer