I am thinking about how to do a probability of spawning different sprites.
I have a set of 6 different sprites to spawn. Currently I am using int(random(5)) to get a random spawn of the sprites.
What I would like to do is to make the spawning of these sprites based on a probability?
Sprite 1 - 25%
Sprite 2 - 18%
Sprite 3 - 25%
Sprite 4 - 12%
Sprite 5 - 15%
Sprite 6 - 5%
And also I will like to be able to adjust the probability based on the events that happens during runtime.
A note also, is that currently my sprites are all stored within 1 sprite object with each sprite as a frame in the animation.
Hope to get advise from the community! Thanks