Here you'll find all about games

FLASH GAME DEVELOPMENT

FLASH GAME DEVELOPMENT

Jul 21, 2011

Okay, here is some tips about flash game development. I write this article hope you will get some outlook on the flash development.

Start

Flash Player and the Flex SDK Adobe make you can develop flash game with ease. Using a  Flex has many advantages

  • High compatibility,  many platform can use this software.
  • Easy distribution, you can distribute it easily as long as the platform support flash.
  • Only needs few thing,  You only needs browser that support Flash
  • There Flex SDK which is free.
The first thing to do before development is download the Flex SDK  from http://www.adobe.com/products/flex/flexdownloads/. This SDK contains all things you need. Text editor also required to do this. I quite like notepad++,  http://notepad-plus-plus.org/download. You also needflash debug player http://www.adobe.com/support/flashplayer/downloads.html. With this player you can open SWF file easily.

You can download graphic engine from spritelib, http://www.flyingyogi.com/fun/spritelib.html.

Creating the Application

Flex has two things : Graphic User Interface  and the Actionscript code. The GUI is built in MXML file, which is an XML file which carries user interface elements in tags like HTML. keep in mind, MXML file can carry Actionscript code in mx:Script tag, but the important things is of the MXML file determine the user interface.

First level tag of an MXML is mx:Application tag.

main.mxml Actionscript Source Code

<?xml version=”1.0″ encoding=”utf-8″?>

<mx:Application

xmlns:mx=”http://www.adobe.com/2006/mxml”

layout=”absolute”

width=”300″

height=”200″

frameRate=”300″

creationComplete=”CreationComplete()”

enterFrame=”EnterFrame(event)”>

<mx:Script><![CDATA[

public function CreationComplete():void

{

}

public function EnterFrame(event:Event):void

{

}

]]></mx:Script>

</mx:Application>

The mx:Script tag make us can put Actionscript code. The [CDATA[ ]] tag make  characters inside the mx:Script tag will be known as text, not XML. In the mx:Script tag, we have to put two functions that suit the values for the creationComplete and enterFrame properties.

Compiling and Running

write mxmlc main.mxml at the command prompt then run it, so you can compile it. The SWF file will be created

The SWF file  is just plain, without anything. Yes it was right, this is the first step, like usually you make “hello world” program, this also just introduction.

One comment

  1. Nice tutorial, I have been looking to build flash games for a while now. This post is a step to the right direction. I do think instead of using flex use Flash to create more environment rich and entertaining games.

Leave a Reply

Bad Behavior has blocked 449 access attempts in the last 7 days.