The Daily Click ::. Forums ::. Klik Coding Help ::. Logical powerup dropping?
 

Post Reply  Post Oekaki 
 

Posted By Message

Andy J



Registered
  25/04/2004
Points
  14
17th June, 2005 at 19:04:32 -

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?

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
17th June, 2005 at 19:12:07 -

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?

like:

counter < 50
counter > 0
-then-
* create medkit

etc. etc...

 
n/a

Andy J



Registered
  25/04/2004
Points
  14
17th June, 2005 at 19:27:46 -

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...

 
n/a

Rox Flame

Creative Talentician

Registered
  06/10/2004
Points
  383
17th June, 2005 at 19:59:13 -

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

Image Edited by the Author.

 
Current project:
Dynabrick (%70)

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
17th June, 2005 at 20:01:22 -

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.

 
n/a

Rox Flame

Creative Talentician

Registered
  06/10/2004
Points
  383
17th June, 2005 at 20:10:23 -

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

 
Current project:
Dynabrick (%70)

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
17th June, 2005 at 23:20:12 -

Psst: Look at Hell House, it's open source, and has an item spawning system you can look at.

 
Craps, I'm an old man!
   

Post Reply



 



Advertisement

Worth A Click