Featured Site
» Posted in the Flash Kit Links section
» Title: Incorpmedia Design Studio
» Comments: Incorpmedia is a Seattle based company that specializes in a wide range of advertising media
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, 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!