How do I generate random colors?

Get help using Construct 2

Post » Fri Jan 13, 2012 12:04 pm

how can i generate random colors in construct 2 please?
B
1
Posts: 1
Reputation: 327

Post » Fri Jan 13, 2012 1:26 pm

you can make a gray sprite and set the tint to rgb(random(255),random(255),random(255))
B
83
S
21
G
15
Posts: 1,039
Reputation: 15,134

Post » Fri Jan 13, 2012 3:37 pm

Nope you can't unless you use the Canvas plugin, there you can set any pixel you want like "draw point at x,y with color "rgb("&random(255)&","&random(255)&","&random(255)&",1)"

@7Soul must be in a construct classic dream right now :D don't wake him up
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Fri Jan 13, 2012 7:37 pm

Yeah I never used rgb(r,g,b) I just use a little math calculation but I thought that would work :P
B
83
S
21
G
15
Posts: 1,039
Reputation: 15,134

Post » Sat Jan 14, 2012 12:28 pm

well basically what we really need is a game with 3 colours only, and it randomly generates on of those three in random sequence..sort of guitar hero...do u know how pls...or use the same concept? thnks
B
4
G
1
Posts: 1
Reputation: 527

Post » Sat Jan 14, 2012 7:54 pm

@amj, @alexia: then you should have a look at this topic providing capx of a simon game.
Colors are defined as object, and the game sets a sequence that the player has to reproduce.
I think this is close in theory to what you want to do.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793


Return to How do I....?

Who is online

Users browsing this forum: ManuelPerez and 24 guests