How do I set sprite position based on array values (0 or 1)

Get help using Construct 2

Post » Wed Dec 16, 2015 4:00 am

Hello, community
Is there a way to move or spawn sprites based on array values?
For instance, I have an 0-9 array;
On the start of layout I fill it with random 0 or 1;
there are two different sprites on scene (Sprite and Sprite2);
I want to move Sprite (the pink one) to fields with value 0 and Sprite2 (the green one) to fields with value 1.
I`ve made a little example showing what I`m trying to achieve.. Please check the capx!

any help would be appreciated!

cant post links so just copy and paste this "s/p5epy9to9yl9rzi/spriteToValue.capx?dl=0" after the dropbox adress dropbox...com/PASTE_HERE
B
7
Posts: 3
Reputation: 290

Post » Wed Dec 16, 2015 10:24 am

B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Thu Dec 17, 2015 9:43 am

Thank you, korbaach!
Works great!
B
7
Posts: 3
Reputation: 290


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests