Generate a Random Number/Color

by ITB (PM)

See everything made by this user or team.

Current Language: English
Not enough votes.

How do we do this?

Simply go into the event that changes the color. For this tutorial, I'm going to change the color of an actors shirt when I step on a zone.


Your going to click the white box to the left of the color option. This window should come up click on Color, then double click on Make Color (RGB)



Once you're done with that, this window should come up:


Instead of adjusting on the bars, click the white box again. This time, go down to Math and click Random Number (Wholes). this box should come up:



Set the Minimum to 1, and the Maximum to 255 and click OK. You should return to this:



Do the same thing for the last 2 boxes. When you're done, it should look like this:


Click OK and return to the map editor.


Now when you step on the zone, the color of the object or sprite will change to a different color every time.


How can I use this?

 As long as you know the minimum and maximum values, you can generate a random value. You can also play with the maximum and minimum values to generate different colors. 

If you have something in your game that allows the player to edit their character, you could give them infinite possibilities by using this method.


That's it! Happy Game Making! Don't forget to rate this tutorial!

There's been a total of 3428 views(s).
There's been 2045 people that have viewed.