Random tint effect on tiles

Get help using Construct 2

Post » Sun Apr 07, 2013 2:47 pm

Hi. I've just followed UnrealMedias Tutorial "Generating a Random Tile Map":

https://www.scirra.com/tutorials/360/generating-a-random-tile-map

...and I want to add a new array wich contains a random rgb value for each tile and set each tile to this value on start of layout...

can some hero please explain how I do this?
Do I create a new array? Or can I add this random RGB value to the existing array?

Tim
B
5
S
1
G
3
Posts: 4
Reputation: 2,265

Post » Sun Apr 07, 2013 3:50 pm

At awesome balls (link at signature) I simply did

'on block created'
.. set tint variables to random color

Why do you need the array, you plan to save the colors for later use?
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Sun Apr 07, 2013 3:52 pm

Yes. I'm gonna use grayscale tiles and tint them different for each level wich will be "randomly" generated.

And that random level have to be saved so that you kind of create a new world every time. Timshark2013-04-07 15:54:32
B
5
S
1
G
3
Posts: 4
Reputation: 2,265

Post » Sun Apr 07, 2013 10:55 pm

Anyone else? This is about addiing a random rgb value to an already existing array and tint the object...Timshark2013-04-08 00:08:14
B
5
S
1
G
3
Posts: 4
Reputation: 2,265

Post » Mon Apr 08, 2013 7:07 am

[QUOTE=Timshark] Anyone else? This is about adding a random rgb value to an already existing array and tint the object...[/QUOTE]

I'd probably generate string with rgb values: round(random(0,200)) & ";"& round(random(0,200)) & ";" & round(random(0,200)). Then, you can save that to your array and fetch the proper values with tokenat() - expression.
B
24
S
8
G
7
Posts: 756
Reputation: 7,192


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, jeffige, LeFuji, plinkie, Radulepy and 0 guests