How do I set Glob number random from variable sprite

Get help using Construct 2

Post » Sat Sep 24, 2016 2:36 am

i use only one spirte with method for 1 to 20 ,, system create sprite to X to Y , Sprite set MyNumber loopindex

Now we have 20 sprite With deference Variable "MyNumber". now i want the Global number GloBNumber = random sprite.MyNumber


i want Every X sec --system set ClobNumber to " choose random numbers from sprite.MyNumber"
B
15
S
7
G
7
Posts: 201
Reputation: 5,277

Post » Sat Sep 24, 2016 2:40 am

Image
Image
B
63
S
23
G
7
Posts: 1,480
Reputation: 10,796

Post » Sat Sep 24, 2016 2:41 am

Possibly every x seconds with condition pick random instance of sprite > set global variable to sprite.mynumber.

edit: yeah exactly that above...
B
45
S
15
G
73
Posts: 2,006
Reputation: 43,394

Post » Sat Sep 24, 2016 2:50 am

dam!! 3hour fighting to solve this :( and you replay in few min?? :) +1

ty this work perfect @korbaach @plinkie

"why i did see the pick random instance"? :/
B
15
S
7
G
7
Posts: 201
Reputation: 5,277

Post » Sat Sep 24, 2016 3:01 am

you can also try something like:

Every x seconds..set GloBNumber to Sprite(int(random(Sprite.Count))).MyNumber
Image
B
63
S
23
G
7
Posts: 1,480
Reputation: 10,796

Post » Sat Sep 24, 2016 3:20 am

@korbaach nice method.. where you learn all this? from c2 manual and forums watch? or you are programmer code html5 , c++ ,c# , java or what else ? :P

cause me i dont have any experience programming code..i learn all from here. :/
B
15
S
7
G
7
Posts: 201
Reputation: 5,277


Return to How do I....?

Who is online

Users browsing this forum: AekiroStudio, Linetaru and 8 guests