Monthly Archives: January 2010

IDAT102 – Flash Game – Movement 0001-0003

To start my flash game I decided to use a simple but effective movement system. The system starts by declaring variables for up, down, left and right which are either true or false. Three event listeners are used to run three functions. The first is masterLoop which runs on the enter frame event; this continually loops at the framerate which has been set, in this case 30. The other functions and corresponding event listener is atKeyDown and atKeyUp which use KeyboardEvent.KEY_DOWN and KeyboardEvent.KEY_UP. Within both of these functions if statements detect if matching keycodes have been pressed and sets the variables to either true or false. The masterloop contains if statements so that if leftIsPressed is true then the new X position of the player becomes the old X position minus the value of the speed variable.

I then added an additional if statement for each to prevent the player being able to exit the stage.

if (rightIsPressed) {
if(carP1.x < (800 - ballDiameter)){
carP1.x = carP1.x + speed;}

The ballDiameter variable offsets the distance preventing any of the player from overlapping the stage.

In later versions the above code is shortened to.

if (rightIsPressed)&&(carP1.x < (800 - ballDiameter)) {
carP1.x = carP1.x + speed;

The numbers in the heading of each post such as “0001-0003” indicate the version numbers the post covers.


It seems Tom and I have been ahead of the game with our Bluetooth ideas, but now everyone has been introduced to the idea which is frustrating as we have potentially have lost any originality in what we are doing relative to the rest of the group. Hopefully our more developed ideas and better understanding of the concepts involved will allow us to do something different without compromising for the sake of it.

IDAT102 – Flash Game

After messing around with the examples from yesterday’s session. I have decided on what I want to do for my flash game.

Casual gaming is a rapidly expanding market, a major part of this is the casual flash game. Flash Games are very accessible and convenient, appealing to a very broad demographic. The games are characterised by their gameplay simplicity, clean 2D visuals and usually gentle learning curve.

Here are my ideas:

  • The player controls a pac-man like character around the stage with arrow keys.
  • The game will randomly generate objects around the screen, these objects may move.
  • The objects will both be edible and inedible.
  • Edible objects will count to the player’s score and inedible objects will either remove points or some other penalty such as a speed reduction or control reversal.
  • The object of the game is to collect as many points within the set time.
  • Bonus objects can be spawned that will provide speed boosts and score multipliers.
  • Based on an external source of information such as time of day, weather, ect. various aspects of the game can altered, some aesthetic, others with an effect on gameplay.
  • Possible random generation of walls and slow areas.

Thats it for now.

Deadline is the 1st of February. A new page will be added to my website with a link in the navigation menu for my flash games shortly.