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
22
G
15
Posts: 1,039
Reputation: 15,219

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
64
S
22
G
14
Posts: 1,482
Reputation: 16,457

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
22
G
15
Posts: 1,039
Reputation: 15,219

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
276
S
103
G
84
Posts: 7,289
Reputation: 83,098


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 12 guests