A Basic Primer to Programming Flash Games
I have written this article as a basic primer to flash game programming. In this article I will cover how basic programming can be applied to creating flash games. This article will not cover graphic design or drawing. If you are already proficient in another programming language this article will certainly help in the transition to flash game programming.This article is aimed at people will very basic programming knowledge. An interest in flash games is certainly a bonus when learning to program them. Programming languages of any king will help you to understand this article and its terminology relating to flash game programming. I will be using very general programming terminology.The very first thing I am going to cover is variables. A variable is a place where either a number, string(text) or a Boolean(true or false) can be stored. Variables can be changed at run time this means during game play. For example number of ammo in a weapon can be stored as a variable. As the user shoots the weapon the variable is degreased. A very symbol way in programming syntax would be: On press decrease the ammo variable by one.The next thing Im going to discuss is hit tests. A hit test is performed to detect when two symbols make contact. When these symbols make contact a true value is returned while the objects are not in contact a false value is returned. As you can imagine this very simple function has many uses where game programming is covered. An example of this could be when bullet hits its target play an animation of the enemys death and remove them from the screen. So the basic in programming terms to this would be: if bullet and enemys hit test is equal to true then activate function enemy death that takes the value of the enemys unique identifier. Inside the function would be syntax to display the animation and remove the symbol from the screen.Displaying a life car can be achieved by first creating a small rectangle graphic. Next make the rectangle a movie clip and sets its identifier to a name of your choice. After this create a variable and set the variables values to 100 and strict data style it to a number. Once you have done this, open action script and set the rectangles .length property to the variable you just created and set to 100. This way when the variable is increased or decreased the bar will change lengths. So when the variable is high the bar is longer and when the variable is low the bar will become shorter. Remember variables can be changed at run time there for so can the bar. Using a simple hit test to increase and decrease the variable which in turn changes the bars length. Producing a working bar that shows how much value the variable contains. This can easily be added into a game where the length of the bar resents the amount of life a player has remaining.I hope this article showed you just how simple the elements that make up a flash game can be. Games may look daunting but once you break down there elements they become a lot simpler than they may first appear. If you have no yet tried making a game using flash then I strongly suggest you give it ago. The best way to learn flash is by experimenting and creating working scripts.About Authorhref=”http://www.dog-toy.co.uk/dogproducts/?page=14″>dog beds and dog training equipment.Source: ArticleTrader.com
Monaco Calling Cards
Thank you for reading this post. You can now Leave A Comment (0) or Leave A Trackback.
Post Info
This entry was posted on Saturday, April 28th, 2007 and is filed under Internet.You can follow any responses to this entry through the Comments Feed. You can Leave A Comment, or A Trackback.
Previous Post: Choosing A Cruise Line - Are They Really “That” Different? »
Next Post: Get Satellite TV for Free - 4 Methods Exposed »
- Comment on HTC Touch Diamond hands-on by Kjgabrkv
- Comment on Blyk: 217 free texts, 43 free minutes, SIM card only, invite only, ad supported service for kids by chris
- Comment on Grab your Alltel BlackBerry 8130 Pearl now by nate506
- Comment on T-Mobile announces Sidekick LX update by Ivan
- Comment on Google Maps for Mobile gets big update by Brad
- Comment on LG-SH240: Touch my keypad, it feels like real skin, seriously by NX
- Comment on Blueapple.mobi renamed into Vuclip; Launches video API program for publishers by a.paul
- Comment on Helio users experiencing SMS/MMS outage when sending message to T-mobile USA customers by prepythug
- Comment on Chinese Nokia N95 clone with a laser pointer by Bad_Boy_FROM_RUSSIA
- Comment on Unlocked iPhone 3G now available in Hong Kong by bazza

