Featured Site
» Posted in the Flash Kit Links section
» Title: Atlantis Media Ltd
» Comments: Greg Rudman new media creative & website design - Atlantis Media Ltd
BBM.net is designed to save you time and deliver the highest quality royalty-free music for your multimedia projects. Features include: over 450 Music Loop Packages from some of the best composers in the business, our music search engine to speed your selection process, alternate music versions & bonus sounds to use for rollovers or transitions, free technical support and free consulting.
OK, that's alot of code. Basically(if that word means something this time) We loop through all the baddys. If the character hits a baddy and the character isn't invincible, we check to see which powers the character has. If he has a power called goodBaddy, he gets energy instead of losing it. If he has a power called touchBaddy, then the baddy dies. Otherwise, the player loses energy according to the baddy's power. Note that the player gains energy according to the baddy's power if goodBaddy is true. Then we check to see if the baddy hits the bullet and he's not dead. If this is true, the baddy dies(Note that whenever a baddy dies, one is added to the defeated variable) Then we check to see if the helper hits the baddy, the baddy isn't dead, and the helper is activated(the helper is a powerUp that you can get) We do the same thing we do when the baddy gets hit by a bullet. Now that we've looped through all the baddys and checked for all the collisions possible, let's do the same thing with the powerUps. First we check to see if the character hits the powerUp. if he does, then the power he already has is set to false. Then we set the currentPower variable to equal the number frame that the powerUp is, inside the powerList array. That's the trick i told you about. You can use it in just about any game! Now we set the number power to equal the frame of the powerUp that the character hit. Then we set the timer equal to how much time you get in the current level. We also set the powerUpTimerGo variable to true. Later we subtract from the powerUpTimer variable if the powerUpTimerGo variable is true. Now let's do even more coding to make the game better!