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
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

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
47
S
18
G
84
Posts: 2,273
Reputation: 49,800

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
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

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: zenox98 and 29 guests

cron