A Basic Primer to Programming Flash Games
Computers & Technology → Multimedia
- Author Ashley Peach
- Published April 16, 2007
- Word count 582
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 I’m 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 enemy’s death and remove them from the screen. So the basic in programming terms to this would be: if bullet and enemy’s hit test is equal to ‘true’ then activate function enemy death that takes the value of the enemy’s 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.
Ashley Peach's websites include dog toys, dog beds and dog training equipment.
Article source: https://articlebiz.comRate article
Article comments
There are no posted comments.
Related articles
- The Ultimate Guide to Motion Graphics in Manchester: Elevate Your Brand with Stunning Visuals
- The Best Free Online Video Editing Tools for PC
- 5 Ways | How to Convert AVI to MP4 on Windows, Mac, and Online?
- How to Make an Animated GIF of Your Screen?
- How to Download Videos from Pornhub, Erome, xnxx, etc. for Offline Viewing?
- Interactive Video: Revolutionizing Education One Click at a Time
- What is a Video Codec and How to Fix a Codec Error?
- Youtube To MP3 Converter -- Free
- Why buy stock footage on mediaCastpro? Here are the benefits.
- Explanation of how to improve the quality of low-resolution videos
- Unveiling the Artistry of Photography: A Journey Through the Lens
- Alexa's Use of Artificial Intelligence: A Case Study
- High-Quality Ash Wood Textures Pack. Elevate Your Design Projects.
- Embracing Multidisciplinary Excellence: The Jack of all Trades
- Why Reading on an eBook Reader Is a Great Idea: Unlocking a New Chapter of Reading Experience
- Social Media Marketing
- Playstation 5 Accessories Bundle - God Of War Ragnarok Bundle
- 17 Ways to Get More Followers on Instagram (2022)
- INNOVATION AT SPEED: “FASHION SHOWS DURING AND POST-PANDEMIC”
- How YouTube Pays You: What You Need to Know About Monetizing Your Channel
- How To Get Paid for Youtube: The Best Ways to Earn Money with YouTube
- The Benefits of Using Facebook, Twitter, and YouTube
- Should You Make a YouTube Video? 4 Questions to Ask Yourself First
- Finding a great pair of earphones
- What is a Drone and What are its Advantages?
- The 7 Best Video Editors for Creating Social Media Posts
- The Importance of Social Media Marketing in Medical Business
- How Should You Optimize Images for Website?
- Play Your Music and Movies at Full Resolution with JRiver Media Center
- Technology News