Hi
I’m spawning different colors based on random function:
local color = math.random(1,L.Stats.maxColors)
if color == 1 then color = "red"
elseif color ==2 then color = "blue"
elseif color ==3 then color = "green"
end
once the color is generated, the object with chosen color is spawned.
Problem is, that sometimes, one color is generated for about 5 times in a row. I’m trying to find a procedure that will decrease the probability of particular color once it is spawned. I think the correct way is to add a counter for each color to know, how many times it was spawned, but what’s next?
Does anyone has any ideas how to deal with that?
Thanks in advance [import]uid: 181861 topic_id: 33535 reply_id: 333535[/import]
[import]uid: 181861 topic_id: 33535 reply_id: 133338[/import]