If you use that method, you don't need to create extra variables, except maybe a single constant to define the probability
Yes that's how I do it. True it may never occur or may occur twice in a row, but hey, that's random numbers for you :-). Actually with something like If rand(1,100) < 10*Delta we know it occurs randomly 10% of the time (tested each logic iteration), so for a 200 frames per second logic loop we can say that it occurs 20 times per second. That's nice and easy to work out. Oops! Dodgy Random Numbers with Deltatime
BlitzMax Forums/BlitzMax Programming/Oops! Dodgy Random Numbers with DeltatimeThe forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.