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
17
S
7
G
7
Posts: 205
Reputation: 5,335

Post » Sat Sep 24, 2016 2:40 am

Image
B
66
S
23
G
7
Posts: 1,513
Reputation: 10,937

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
46
S
16
G
76
Posts: 2,150
Reputation: 45,313

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
17
S
7
G
7
Posts: 205
Reputation: 5,335

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
B
66
S
23
G
7
Posts: 1,513
Reputation: 10,937

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
17
S
7
G
7
Posts: 205
Reputation: 5,335


Return to How do I....?

Who is online

Users browsing this forum: Elliott, kellehk, MadSpy, oosyrag, R0J0hound, totoe, Yahoo [Bot] and 38 guests