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
20
S
6
G
7
Posts: 639
Reputation: 5,335

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
373
S
218
G
84
Posts: 23,444
Reputation: 186,078

Post » Wed May 09, 2012 3:06 pm

Thanks, I think this helps.
B
20
S
6
G
7
Posts: 639
Reputation: 5,335


Return to How do I....?

Who is online

Users browsing this forum: 20170217, alajajm, hyem, Lancifer, LukeW, Per3za and 4 guests