PDA

View Full Version : Frustrated Noob needs help with simple game.


DestinDave
03-23-2008, 01:35 AM
Hi all... I hope this is the right forum for this.

I am about as noob as a noob can be. I'm trying to set up a pretty basic game but can't get around this issue:

The game is basically where leprechauns pop up in various places around the stage. The object is to bop them on the head with a beer bottle. I have created one MC for the leprechaun and dragged 6 instances to the stage. I want them to pop up one at a time at random. I have tried lots of methods with no luck. My last attempt was with the tellTarget function but I failed. I've taken all the extra code out so now it's just the 6 instances showing up at once and the scene stops.

Can someone help me with the "random" one at a time appearance of the leprechauns. I haven't added the "hotspot" mc over their head yet but that's is how I intend to do a hitTest testing against the beer-bottle MC.

Thanks for any help...
(I thought I could attach the .fla file but that's not an option, huh?)

bluemagica
03-23-2008, 11:54 AM
I made a simple example fla for you, look at it ....but remember, if you dont want to faint of shock, then dont look at the terrible graphics...lol
Example (http://www.savefile.com/files/1457899)

DestinDave
03-25-2008, 02:36 PM
Hey - thanks a ton! That's pretty much exactly what I needed. The target on the top right never pops up but I'm guessing it's because you assigned 5 as the high number for the variable when it should be 6, right?

Thanks again!
Dave

bluemagica
03-27-2008, 03:19 AM
yes...i left in a few bugs so that you can try to fix them, and hence learn from it.....
this one can be solved by using 6, or Math.round() instead of Math.floor()