The Daily Click ::. Forums ::. Klik Coding Help ::. help with random item drop...im dumb
 

Post Reply  Post Oekaki 
 

Posted By Message

curtaineater



Registered
  12/06/2003
Points
  23
13th June, 2003 at 01:48:20 -

I know this is a newb. questions, ive used KNP forever and CNC alot too, but that was so long ago. Now i got back into it all and got MMF and have a Q.

How do i make an item(money or heart) drop from an obect(bush) randomly? I have it right now but it makes TONS of the item...

Also, without a plugin can you make a thing shoot faster than 100? thanks pancakes!

 
n/a

Santa



Registered
  19/05/2003
Points
  644
13th June, 2003 at 02:45:56 -

In my breakout game i make them using a counter, If the counter is = to a certain amount then a power up is droped and the counter is reset. Not the most efficient way though, just im am also a newbie, lol.

If you just want one power upjust add another event something like:
Negative - if powerpowerup animations is playing.

of if you want more than one set a alt value, say if alt value is less than 2 then make power up.

as for shooting plugins not too sure, try Bullet object by Akane http://objects.ebw.ca/index.php?view=category&sort=all not sure if that will do it, but ya might get lucky.

 
SAnTA - www.atnas.com

-------------------
www.create-games.com/download.asp?id=2918

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
13th June, 2003 at 03:28:46 -

There are a couple of methods of doing this. One way is to create an active object, then always set it's x pos and y pos to random numbers within the frame. Then set it's alterable value to a random variable, lower being more frequent. And when the value = a certain number, an object is created at the active. Btw the active should be transparent.

You can also use a counter and create the object off screen, then when it's flag 0 = off, it will be off because it was just created. Set the x and y pos, to random frame dimensions.

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
13th June, 2003 at 06:12:13 -

I'd do this (lets say there are 6 possible objects):

The objects are
1: Bomb
2: Mouse
3: Sword
4: Beans
5: Turnip
6: Peas

1. Object gets hit
.....make invisible
.....set flag 0 ON
.....set ALterable value A to 'random(6)'
2. IF flag 0 = ON
..+Value A = 1
.....Create bomb
3. IF flag 0 = ON
..+Value A = 2
.....Create mouse
4. IF flag 0 = ON
..+Value A = 3
.....Create sword
5. IF flag 0 = ON
..+Value A = 4
.....Create beans
6. IF flag 0 = ON
..+Value A = 5
.....Create turnip
7. IF flag 0 = ON
..+Value A = 6
.....Create peas
8. IF flag 0 = ON
.....Delete object

Explanation:
Line 1: When object has been hit, make it invisible, so it looks like it's gone, and set its flag 0 to ON (so we know if it's 'destroyed' or not), and choose a random value for AV:A.
Line 2-7: If Flag 0 is ON, then the object has been 'deleted', and so the new item which matches its random alterable value is chosen. So if AV:A is 4, it creates beans.
Line 8: Finally, if the object is 'deleted' (flag 0 is ON), it should now completely destroy the object.

That's how I'd do it.

 
191 / 9999 * 7 + 191 * 7

curtaineater



Registered
  12/06/2003
Points
  23
14th June, 2003 at 02:45:23 -

sweet nads. thanks for all the help dudes.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click