How do I separate two object instances?

Get help using Construct 2

Post » Tue May 12, 2015 12:53 pm

The problem I'm having is with the 'tilt' and 'hinge' set of objects. As probably noticeable in the game, the 'tilt' platform is connected to the 'hinge' object via a distance joint. However, I want to use more of these two objects in the level. Whenever two of them are on the screen at once, they'll assume they're all connected to each other and not work.
How do I separate each instance of the variable and call only to a specific instance so each one works only with another specific one?
Also, any input and optimization to what I have at the moment would be greatly appreciated!

capx link: megafileupload[DOT] com /1UE4/tilt_game.capx
B
5
Posts: 26
Reputation: 285

Post » Tue May 12, 2015 1:31 pm

Putting the tilt and the hinge in a container would do the trick..

Another way would be for each tilt hinge pick nearest to tilt.x,tilt.y - create revolute joint..

Other ways would be to give them instance variables and check if they are the same..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue May 12, 2015 1:38 pm

LittleStain wrote:Putting the tilt and the hinge in a container would do the trick..


What do you mean by 'container'? As in a family or something different?
I'm also confused about how to pick a nearest for the x/y for tilt/hinge.
B
5
Posts: 26
Reputation: 285

Post » Tue May 12, 2015 2:02 pm

From the manual:

https://www.scirra.com/manual/150/containers

And if you could explain your confusion, it might be easier to take it away..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu May 14, 2015 9:02 am

LittleStain wrote:
And if you could explain your confusion, it might be easier to take it away..

Thanks for the link to the manual.

I'm confused in the sense that I'm not sure how I could express choosing the closest in code form.
B
5
Posts: 26
Reputation: 285

Post » Thu May 14, 2015 9:12 am

Create an event:

Sprite pick nearest to

It's just one of the many conditions
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu May 14, 2015 9:28 am

LittleStain wrote:Create an event:

Sprite pick nearest to

It's just one of the many conditions

Nice one, thanks.
I created a container for the objects and it seems to work perfectly. Thanks a lot man, you've been a huge help!
B
5
Posts: 26
Reputation: 285


Return to How do I....?

Who is online

Users browsing this forum: ezgaming420, marcinkowski, Tinimations, Tiradentes, Yahoo [Bot] and 2 guests