Attaching objects and mouse stuff

For questions about using Classic.

Post » Thu Sep 02, 2010 3:59 pm

Hello everyone, :D
I am a graphic designer interested in indie game dev.
I have a few questions, since i am not good at english i draw some stuff to explain myself...
How can i physically attach sprite objects to another sprite object. Like attaching layers in After effects...

i want to attach three sprites to each other like this


and want them to move according to third attached object



And i want to rotate the a sprite object, according to the change in mouse y while holding cfirst button.

Any help or idea would be great thanks to all
B
1
G
2
Posts: 5
Reputation: 635

Post » Thu Sep 02, 2010 4:06 pm

I was wondering this one myself. I thought the only solution would be to get the original translation, and use that to reposition A and B in an Always event.
B
3
G
2
Posts: 26
Reputation: 727

Post » Thu Sep 02, 2010 4:11 pm

You have to create hinges with the physics behavior.Lucid is an expert in this field.So if you need pro advice ask Lucid.
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Post » Thu Sep 02, 2010 5:03 pm

sorry, gray lines was for illustrative purposes. I don't want them to be really there. Just wanted to say objects move according to another object
B
1
G
2
Posts: 5
Reputation: 635

Post » Thu Sep 02, 2010 5:29 pm

Ok ive created an exe demo file.You have to get the orbit plugin in order for the capfile to work.It's the orbiter plugin from chris Hackmann.

Here is the exe file.

[url:22e9pkut]http://dl.dropbox.com/u/7658043/orbit.exe[/url:22e9pkut]
B
22
S
3
G
6
Posts: 1,356
Reputation: 7,141

Post » Thu Sep 02, 2010 6:07 pm

Isn't there a way to do it without a plug-in?
B
3
G
2
Posts: 26
Reputation: 727

Post » Thu Sep 02, 2010 6:19 pm

One way to do it without plug-ins would be to give objects A and B two private variables each, storing their angle and distance from object C. Then just update A and B's position and angle every frame relative to object C.

Here's an example of that and mouse rotation:
[url:28jo9jmo]http://dl.dropbox.com/u/5426011/examples2/AttachObjectExample.cap[/url:28jo9jmo]
made in 0.99.94
B
79
S
24
G
53
Posts: 4,728
Reputation: 40,219

Post » Thu Sep 02, 2010 6:23 pm

That's exactly what I had in mind :P

What if I wanted to create a hinge or motor?
B
3
G
2
Posts: 26
Reputation: 727

Post » Thu Sep 02, 2010 7:52 pm

Thanks a lot everyone :D
B
1
G
2
Posts: 5
Reputation: 635

Post » Thu Sep 02, 2010 7:53 pm

nice diagrams btw
B
3
G
2
Posts: 26
Reputation: 727

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests