Aug 30, 2007

Miniclip CEO talks to Gamasutra on their Social and Advergaming approach...Flash Lite and Wii

As a regular player of Flash games on the Miniclip Gaming Site, I was always facinated by the creativity with which they developed and managed a mammoth database of games (260 games so far). At the same time was curious to know how they managed to sustain in times of hardcore downloadable PC games in the likes of those available on MSN, Shockwave, or Yahoo.

So when the Gamasutra News Portal interviewed Robert Small, Ceo of Miniclip Games, I read through the complete page in utmost reverence.

The interview begins with a history of Miniclip followed by their strategies to stand out amongst the rest and their future plans....all related to Flash gaming. For those who have played their games, will know that a majority of their games stand unique in concept and game-play thus leading to millions of game-clicks. It is also important to observe their evolution of developing games with Flash 4 through Flash 9 and AS 3.0

A note to be made during the interview is their expansion plan, i.e. taking their online games beyond the web to the Nintendo Wii and mobiles with Flash Lite.

This story is a great read for anybody interested in Flash gaming...because it only reads success for those who don't treat it as a profession but a passion they want to realize.

You can catch the complete interview here

Labels:

Aug 28, 2007

Flash Lite article - Packing Lite: A mobile media interface design primer

Launched recently on the Adobe Developer Center is a new article called Packing Lite: A mobile media interface design primer, written by David Carroll, professor of media design at Parsons The New School for Design in New York City.

The article has an indepth explaination of testing and tranferring Flash Lite content on Nokia S60 handsets. It is extensively written to cover content testing in Flash 8 and Flash CS3 for management on both the Mac and the Windows platform.

The article also explains best methods for adapting your content to the 4 way directional pad on mobiles with a quick 4-way menu example.

You can read the article here.

Labels: ,

Aug 16, 2007

Creating a Flash Lite Game : A detailed tutorial for game developers

Giving new Flash Lite developers a headstart in creating games, Riyadh Al Balushi has written an indepth tutorial on creating a simple game using Flash Lite 1.1.

The tutorial is very informative and talks of various steps involved in Flash Lite gaming.

Labels: ,

Aug 6, 2007

Flash Lite Gaming Tutorial : Continuous KeyPress for Moving Characters in Side-Scrollers

Action or adventure based games may require characters to move around the screen. We use the Key Object for interacting with the game characters. While keypresses and keyreleases respond quickly when the swf file runs on the desktop, these events work differently for swfs running on a mobile. A valid reason is that mobiles have lesser processing speeds thus making it slower for them to recognize keypresses or keyreleases before implementing them.

Thus, when you try to move a character with a keypress, you will observe a slight pause before the character starts moving. A solution that I mostly use is, making the keypress event interact with a loaded Movieclip.






The Key Events

var keyList:Object = new Object();
var dir:Number = 0;
var keyDownState:Boolean = false;

We begin by declaring 3 variables –
keyList of Object type to receive the KeyDown and KeyUp notifications,
dir of type Number to store the direction of the character based on the keys pressed
keyDownState of type Boolean to check whether the key is pressed down or up.

keyList.onKeyDown = function(){
  if(not keyDownState){
    var keyCode = Key.getCode();
    if(keyCode == 37){
      dir = -1;
    }else if(keyCode == 39){
      dir = 1;
    }
    keyMover.gotoAndPlay(2);
    char.gotoAndPlay(2);
    char._xscale = 100*dir;
    keyDownState = true;
  }
}

keyList.onKeyUp = function(){
  dir = 0;
  keyDownState = false;
  char.gotoAndStop(1);
  keyMover.gotoAndPlay(1);
}

The code above declares 2 events – The KeyDown event and the KeyUp event.

A KeyDown event is executed when a key is pressed. This event runs a block of code as long as the key remains pressed. Our code on the other hand, runs the statements only once and not continuously because the condition (if not keyDownState) fails to be recognized as false after its first run. The reason why we have set this condition is, because we don’t want to loop through the same code multiple times for the same key pressed.

var keyCode = Key.getCode();

The getCode() method return the key code value of the last key pressed. Based on the value returned, the direction of the character is set. This code checks for only 2 keys – the Left key and the Right key. Any other key pressed is ignored.

keyMover.gotoAndPlay(2);
char.gotoAndPlay(2);
char._xscale = 100*dir;

If you look at the script above, in the first line keyMover refers to a loaded MovieClip on the stage that contains the script to move the character.

The second line refers to the character MovieClip. This MC initially has the character in a standing posture on frame 1. When a key is pressed the character moves to the next frame which has it animating.

Lastly, we need to flip the character based on the key pressed. So we use the _xscale property to flip the character based on the key pressed.

A KeyUp event is called when a key is released. In our code, all the variables are reset to their original value and Movieclips proceed to halt on the first frame of their timeline at the time of a KeyUp event.

KeyMover Movie Clip

The KeyMover MovieClip consists of 3 frames

Frame 1
var mc:MovieClip = _root.char;
var dir:Number = 0;
var speed:Number = 3;
stop();


The first frame sets the necessary variables and also sets a reference to the character MovieClip on stage.

Frame 2
dir = _root.dir;
if(mc._x < mc._width/2 and dir < 0){
  dir = 0;
}else if(mc._x > (Stage.width – mc._width/2) and dir > 0){
  dir = 0;
}
mc._x += speed*dir;

The second frame sets a condition to check to see if the character is moving outside the screen area. If the condition is met to true then the direction is set to 0

Finally the character moves at a value which is direction X velocity

Frame 3
gotoAndPlay(2);

The third frame loops the Movieclip between frame 2 and 3.

The Final Run

Now when you play this in the emulator or the device the character will respond immediately to the keypressed without any pause.

The source file has been uploaded for your reference here

Labels: ,