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, first thing's first. In the Actions panel for the root timeline, type in the following code:
stop()
level = 0
levels = {}
That's pretty simple. It stops the movie(duh!) Then creates a variable called level which is equal to zero. Then, we make an object called levels, that will store all the levels. Now let's look at the levels!
Look at each level. They all have variables called baddys, baddySpeed, baddyPower, powerUps, powerUpTypes, and powerUpTimer. This can be hard to understand, so i'll just explain it now. Baddys means how many bad guys are in the level. BaddySpeed is how fast they go. BaddyPower is how much energy you lose when you hit them. PowerUps is how many powerUps are in the level(things that let you do cooler things for a certain amount of time.) Then, PowerUpTypes is how many frames the powerUps are allowed to go to. And, PowerUpTimer is how long you can have a powerUp. Note that in a more complicated game, you should make a function that creates levels, or even a level editor. For instance, the function could be written like this:
As you can see, this would be a great way to make levels in a game faster, then create a function to load them(which would have to attach all the baddys to the screen according to their x and y positions in the array, and types) But we won't do that in this tutorial, because we create most of the positions and frames randomly. Now let's get back to the game!