hmmm well i just made one for school
so lemme see if i can answer some of these questions…
Powerups:
i am assuming your laser detection works and you know how to duplicate movie clips… soooo just when you do your if(hitTest, blah) thing… inside the if statement to see if the laser collides with an enemy, make a variable to hold a random number… and if the number is within a certain range, depending on what percent chance you want a powerup to generate, just have it duplicate a powerup movie clip in the same x and y location as the enemy ship, before you remove the enemy movie clip… or else it will have no x and y positions to assign, and within the powerup would probably be the best place to put detection code for the ship and modify whatever stats it will…
Level End:
ok… first determine what you want to make the level end, be it a boss or a death or a certain number of kills, whatever… you gotta have a conditional statement that is checked every enterframe (i am assuming you run this mostly out of 1 frame with code within movie clips) and if you condition is met… the easiest way i found was to say
_root.gotoAndStop(frame);
… “frame” being a frame on the main timeline with whatever you want to be next… so just when your condition is met have it go to a frame on the timeline to whatever is next in your game
Boss:
umm for my boss i did it with the same principals as the game ending or level ending. i had my conditional… which was if the kill count was above 200 (short game i know) it went to the next frame where the boss was. the way i had my layers set up everything stayed the same but in the next frame it just had an extra for the boss. so everything except the boss was extended with the f5 kind of extend… without the keyframe so everything isnt reset, and there is a new key frame with your boss in it… i hope that was clear…
Power Bar:
im assuming you mean like life bar or health bar of some sort… so umm what i did, which was pretty easy, is i made a movie clip with a shape tween that was 100 frames long, and the tween was the color within the box scaling down, so within my ship i had it on every enterframe to access teh movie clip of my health bar and have
_root.lifebar.gotoAndStop(_root.health);
“health” being a variable declared on my main timeline and accessed with root so that way its not local to just the ship, it just makes it easier to access. so anyway on every enter frame, i do the same detection for the ship and if it gets hit by a laser or enemy it changes the variable on the timeline and whatever the life is at (starting at 100 and subtracting when you get it) it will go to the corresponding frame within the life bar movie clip. (side note, when i changed my health variable i did Math.round(health); on the next line, to round it to the nearest whole number to eliminate any decimals in case flash put any in. because if there are decimals it wouldnt go to any frame)
i think thats about all your questions… im still working on my game, but i might post the FLA after im done if anybody wants… if you want to see it as it is its here for download (i know the sound effects suck) but im still getting more… not done yet ;)… and if you play it the circles with the S increase speed and those with H increase health. (boss after 200 kills)
so anyway, EnthesisInferno, if you still have questions ill try to answer them… or if anyone has any easier methods of doing things than i said, fill me in please 