How do I deal with selection?

Get help using Construct 2

Post » Wed May 09, 2012 12:37 pm

How do I create a sprite near a sprite with a certain variable?

The level has 5 identical square-sprites.
1 of them has variable "TheOne=1".
The sprites all get to be (randomly) TheOne=1. Also, the sprites move randomly.
I want to create a 6th one (and maybe later a 7th one).

I wonder how I make this work:
create new square sprite at sprite with variable TheOne=1.

Only thing I can think of is to use assist-tools, like adding an invisble sprite over sprite with variable TheOne, so that you can more easily tell the new sprite: be created at that invisible sprite.

Is there another (better?) way?rogerty2012-05-09 12:38:50
B
16
S
5
G
7
Posts: 599
Reputation: 5,000

Post » Wed May 09, 2012 2:15 pm

Remember expressions return values for the picked object.

+ Sprite: TheOne = 1
-> Create object at Sprite.X, Sprite.Y

Sprite.X and Sprite.Y return the values for the object where TheOne = 1.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Wed May 09, 2012 3:06 pm

Thanks, I think this helps.
B
16
S
5
G
7
Posts: 599
Reputation: 5,000


Return to How do I....?

Who is online

Users browsing this forum: blackhornet, TheHat and 1 guest