How to instantiate a selected object ?

Get help using Construct 2

Post » Tue Jun 09, 2015 6:17 pm

Hi,

I'm working on a physics based side scroller car game. I have made a screen to select a car when clicked on one. In the gameplay screen I have assembled all the cars by attaching wheels to the body using joints. But I do not understand how to instantiate the chosen car at the right place inside the gameplay screen. How do I go about this ?

Thank you.
B
5
Posts: 8
Reputation: 241

Post » Tue Jun 09, 2015 10:41 pm

I think you can do this with pinning and turrets. The idea of a turret is something like a tank with a turret, but each of your parts could be a 'turret'. Dependent on exactly how C2 handles offset pin rotation, you may have to pad it out a bit.

If you think of a stack of cards which are mostly transparent, each card having one piece, all rotating around the centre point you might get the idea I mean :)
My tutorial through development blog is at http://myconstruct2dev.blogspot.co.uk/
B
12
S
3
Posts: 221
Reputation: 1,328

Post » Wed Jun 10, 2015 1:27 am

paulscottrobson wrote:I think you can do this with pinning and turrets. The idea of a turret is something like a tank with a turret, but each of your parts could be a 'turret'. Dependent on exactly how C2 handles offset pin rotation, you may have to pad it out a bit.

If you think of a stack of cards which are mostly transparent, each card having one piece, all rotating around the centre point you might get the idea I mean :)


Actually I have assembled the cars using revolute joints. Now all the cars are inside the gameplay screen. I just want to keep only the one I chose from the car selection menu and set its position to the right place in the track. I created a container which contains car body and wheels. But when I set the position of the car body the joints and wheels are misplaced. That's the issue I'm having. Is the a way I can change the position of a group of object which are connected using joints ?
B
5
Posts: 8
Reputation: 241

Post » Wed Jun 10, 2015 9:50 pm

Not an expert on joints, never used them. They're supposed to rotate though aren't they according to the forces ? I thought by using a turret system or taking control yourself with a bit of trigonometry then they will be stiff ?
My tutorial through development blog is at http://myconstruct2dev.blogspot.co.uk/
B
12
S
3
Posts: 221
Reputation: 1,328


Return to How do I....?

Who is online

Users browsing this forum: Christmas and 25 guests