Do anyone have a good way of dropping powerups? Right now i just got a bouncing ball that moves around the screen and drops a powerup when a random(500) counter hits 1. This is okay, but sometimes it drops a lot of powerups, and sometimes none at all. I need some ideas! I'm considering dropping powerups from a static place, like a tube at the top of the screen or something, or maybe several tubes. I also want some powerups to be rarer than others, so that "SUPERWEAPON!ATTACK OF DOOM!!" doesn't show up more than "Boring healing kit". I can do this with the randumb counter thing,of course, but i wanna know if anyone has a better way?
eh?... maybe you could make it so that if the counter hits anything between 0-50 it's a medkit, and if it hits 50-75 it's a gun, and only if it hits 76 it drops a super weapon of doom?
Yeah, that's what i've been thinking, but i kinda would like to do away with the whole random counter thing without having to go to the extreme of dropping something "every 02:00:00" or whatever. The main problem is that with random,it might not drop anything at all or too much. Hmm, maybe this is dumb, i'm kinda tired...
you could have a counter that is always counting down slowly like say... once per second. once it reaches zero, generate the powerup and set the countdown counter to something like Random(max difference in generation time)+(minimum seconds to wait).
That way you could mak it generate a powerup once between 1-3 mins by putting
counter reaches 0
-generate powerup
-set counter to random(120)+60
you need to figure out what you would like the genral drop rate to be.
if you right a vague script that drops somthing every 2 mins then thats whats gonna happen,
what you might want to do is have it drop every 30 secs but have no power ups at some points ie.
0-50=nothing 50-75=medi pack and so on. then the drops will look scattered and less time based
i dont know if this helps but ive used it and it works OK.
And to make it pick the powerup randomly with certain ones having better chances do what Agggge said before except have a seperate counter making the value that determines the weapon.
so instead you could do it like this...
counter reaches 0
-activate group "generate a powerup"
-set counter to random(120)+60
Group "generate a powerup"
only 1 action when event loops (putting this by itself will make it perform actions once each time you activate this group)
- set counter2 to random(20)
counter2 = (put in whatever number or number range you want)
- generate powerup health
counter2 = another value
-generate other type of powerup... etc
then as the last event in the "generate a powerup" group have this.
Always
-deactivate group "generate a powerup"
That a good way??
Theres probably easier ways but thats how i'd do it