Featured FLA
» Author: Bugra Ozden
» Title: Skatalog v9 - product catalog
» Description: Create your product catalog easly and publish on your website or Create your image gallery, documents list, portfolio. Fully XML Driven
» More by Bugra Ozden
Featured Site
» Posted in the Flash Kit Links section
» Title: Creative DW Image Show PRO
» Description: Creative DW Image Show PRO is a Dreamweaver extension which enables the user to create multimedia presentations. It combines the features of the popular Creative DW Image Show with the ability to add professional text effects to slides (similar to After Effects). The product is very customizable: the user can choose the duration of the transition effects, the slide motion start and end position, zoom and panning type for both images and texts.
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!