Head Resist

Web design, Programming, Development and SEO

A Basic Primer to Programming Flash Games

Wednesday, November 16th, 2011

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.

Computer Programming: How to Design a Program

Saturday, June 11th, 2011

When designing a program, you must first have a deep look at the purpose of the program to design and what it will make. You must have the detailed specification needed to begin thinking what you will do. For example, if you designing a web program for handling requests, you must know the pages which will handle, and what are the purposes of each page, the intermediate processes across the requests based on what it must be done before transmitting the page to the client such as connecting to a database and accessing it or writing to it. All this must be known in advance.

 Once you know all these details and the processes inside the application you build, you must organize you thinking on papers. This is done by the so called flow charts or algorithms. This will help you greatly to track all the operations inside the application and then design the program based on it. If you neglect this step, you may find difficulties when writing the actual program especially if the program is complicated.

 Once you draw the flow chart and knew how the operations will flow, you then can implement what you planned by the programming language you choose. This step is also called coding because you are writing code representing your operations you planned in the previous step. Once you are done you can run and test your application. But wait, many errors may appear when testing and you should correct it and this is considered the final step in the programming life cycle which called troubleshooting.

 Many tools can be found for running and testing the program which can ease you work. Remember that there is a difference between the libraries making up the language and the run time environment you use. Java programming for example has the so called JDK which contains the core libraries making up the language but has a separate run time environment which is a separate program for execution and running. You can execute your program from Dos but these tools greatly help you. Java language for example has a run time program called NetBeans which acts a run time environment and has rich tools for dealing with the applications