Flash Game Development with Flex and Actionscript – Embedding Resources and Adding Game Objects Part 3

In part 3 we will add some graphics resources and display them on the screen.

When writing a new program there is always a point where you first get to see the fruits of your labour. With the state and rendering “plumbing” now done we can start doing some fun stuff by adding graphics to our game and displaying them on the screen. But before we do let’s take a look at what changes we have to make in the main.mxml file.


Continue reading »


Flash Game Development with Flex and Actionscript – Double Buffer Rendering Part 2

In part one of the series we created the initial Flex application class. In part two we will be adding states and a double buffered rendering process.

States are quite self explanatory: they represent the different states that a program can be in. For example a shopping cart might have one state for browsing the store and another state while looking at the details of a particular item. Our game will also have a number of states which will include the main menu, the game play itself, the end of level summary and maybe a high score screen.

Flex includes native support for states. These states were designed with a transition from one GUI to another in mind, but they have the functionality we need to change between states that don’t necessarily have any GUI components. Modifying the currentState property of the Application will trigger a state change, and by adding the required startup and shutdown code to the functions associated with the enterState and exitState events we can update the internal game state to match.


Continue reading »


Flash Game Development with Flex and Actionscript – Getting Started Part 1

Get started with Flash game development. This article shows you which tools to download and details the first steps in creating a Flash game using Flex and Actionscript.

Getting Started

With Flash Player and the Flex SDK Adobe has supplied everything you need to start creating your own Flash games. Creating a Flash game using Flex has several advantages like:

  • Cross platform compatibility – there is a flash player for every major platform
  • Easy deployment – publishing the game is as simple as uploading the swf file
  • (Almost) zero installation requirements – an end user only needs a web browser with the Flash player plugin installed
  • Free tools – all you need is the free Flex SDK and a text editor

This article series will step you through the process of creating a 2D Flash game using Flex, with the result being a complete game in the style of the old school top down shooters.

To get started you will first need to download the Flex 3 SDK from http://www.adobe.com/products/flex/flexdownloads/. The SDK contains all the tools you will need to compile the source code presented here into a SWF file that can be added to a web page. You will also need a decent text editor. I quite like Textpad, which can be downloaded from http://www.textpad.com/. Finally you will need to download a Flash debug player from http://www.adobe.com/support/flashplayer/downloads.html. The debug player will allow you to open up a SWF file directly without having to create a web page to contain it. With these three tools you are ready to start coding.


Continue reading »