Open elro444 opened 1 month ago
A possible alternative can be to predefine a minimum and maximum interval per event type, and generate a random duration in that range each time it occurs. If we want the random value to be weighted, we can modify it with a sigmoid function (i.e to make "average" values more likely than "extreme" values) - That way having powerups spawn every 0.1 seconds can be allowed, but not as likely as every 2-3 seconds
We generate a random number each frame, and if it is bigger/lower than some value, we trigger an event. Because we have more FPS, we "roll the dice" more times per second, thus getting events more often than we should.
This affects: