How do I pin slave sprites to a master "instances"

Get help using Construct 2

Post » Wed Mar 05, 2014 3:02 am

Hi!

I could use your help.

Issue details:
A. Multiple instances.
B. Trying to create 1 master instance.
C. Trying to connect slaves instances to master. (for orbiting purpose)
D. All are instances of the same sprite.

Result would be: All slaves rotate the master instance.

This is a total mindblow for me.
Do u have the insight i need?

Kind regards.
Savvy001
B
59
S
21
G
14
Posts: 779
Reputation: 13,927

Post » Wed Mar 05, 2014 6:22 am

When an instance is pinned it's not moving at all. Try this:
Give the instances a variable, e.g. "flag".
Set "flag" for master to "master" and for "slaves" to slaves.
Now pin all slaves to another sprite (i always call this sprite "PinHelper", cause I had this problem before).
Now let PinHelper rotate.
B
14
S
3
G
1
Posts: 255
Reputation: 2,027

Post » Wed Mar 05, 2014 6:22 am

Can you use the pin behavior and spawn those slave objects on interval (until set amount) on an image point that is set outside the master instance? No idea on how to achieve the rotation... Sine maybe? Combined with bullet?
B
4
Posts: 26
Reputation: 250

Post » Wed Mar 05, 2014 6:31 am

Custom variables and variable comparison to create an SOL.

Craete a Family with your Sprite.
Add variable to Family called master, set the default to 0.
set your Family var master to 1 for the sprite that is the master.

then
compare Family.master =1
Pint Sprite to Family

and there you go. easy peasy
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,018


Return to How do I....?

Who is online

Users browsing this forum: DharmaOne, namaewayukidesu, Yahoo [Bot] and 12 guests