mobile gamedevelopment using flash lite

24
Game Porting in Flash Lite 1.1 Porting of game Balancing Mathai by Csharks by Juwal Bose

Upload: juwal-bose

Post on 12-May-2015

1.272 views

Category:

Technology


2 download

DESCRIPTION

Some information on developing flash games for mobile in flashlite version 1.1

TRANSCRIPT

Page 1: Mobile GameDevelopment using Flash Lite

Game Porting in Flash Lite 1.1

Porting of game Balancing Mathai by Csharks

by Juwal Bose

Page 2: Mobile GameDevelopment using Flash Lite

Versions of Flash Lite

1.x – Most wide spread 2.x – Most capable 3.0 – For upcoming hand sets

Page 3: Mobile GameDevelopment using Flash Lite

Limitations

Screen resolution Color depth Processor power Memory Sound reproduction Flash version support Key pad layout / Controls

Page 4: Mobile GameDevelopment using Flash Lite

Our scenerio

Already have the game in flash AS1/2 We will build for Flash lite 1.1 Nokia S60 – 176 x 208

Page 5: Mobile GameDevelopment using Flash Lite

Case with Flash Lite 2.X We can directly

port our code Only Graphics

optimizations needed

Less number of devices

Require higher version of flash IDE

Page 6: Mobile GameDevelopment using Flash Lite

Tools Required

Flash – mx2004, v8, cs3 Adobe Device Central CS3 Flash Lite 1.1 CDK Flash Lite Device

Page 7: Mobile GameDevelopment using Flash Lite

Graphics Optimizations

Reduce the color palette Reduce the size – 176 x 208 Optimize graphics in flash Remove gradients used Remove transparency used Balance between vector and raster Use PNG raster graphics

Page 8: Mobile GameDevelopment using Flash Lite
Page 9: Mobile GameDevelopment using Flash Lite

Gradients

Page 10: Mobile GameDevelopment using Flash Lite
Page 11: Mobile GameDevelopment using Flash Lite

Optimizing code

Use small variable names Reuse variables Reduce nested loops Flash lite 1.1 is optimized

Page 12: Mobile GameDevelopment using Flash Lite

Design changes

Static 5 levels Pre animated graphics Left/Right arrow controls with enter

key Extensive use of movie clips and an

invisible button

Page 13: Mobile GameDevelopment using Flash Lite

The frames 6 frames labeled logo, menu, help, game, over and win

Page 14: Mobile GameDevelopment using Flash Lite

The frames cont… Invisible button is placed out side the scene to take key

presses

Page 15: Mobile GameDevelopment using Flash Lite

The frames cont… The frame code on frame 1

Page 16: Mobile GameDevelopment using Flash Lite

The frames cont…

Button code on help frame

on (keyPress "<Enter>") {tellTarget ("/") {

gotoAndPlay("menu");}

}

Button code on game over and game win frames

on (keyPress "<Enter>") {tellTarget ("/") {

gotoAndPlay("game");}

}

Page 17: Mobile GameDevelopment using Flash Lite

The menu A movie clip with 3 frames (labels s,h,c) is present with

an invisible button having the code

Page 18: Mobile GameDevelopment using Flash Lite

The game frame Dynamic text box with variable name ‘level’ Mathai animation movie clip mathai Hand movie clips hL and hR A go movieclip for starting The invisible button

Page 19: Mobile GameDevelopment using Flash Lite

Game frame code

lSTime = dT=lLTime=o;level = 1;mF = 20;sF = 10;dR = "";dN = "n";interval = 10000;tellTarget ("go") {

gotoAndStop(1);}tellTarget ("mathai") {

gotoAndStop(1);}tellTarget ("mathai/clip") {

gotoAndStop(10);}//stop();

Page 20: Mobile GameDevelopment using Flash Lite

Mathai Clip frame code

Page 21: Mobile GameDevelopment using Flash Lite

Button codeon (keyPress "<Enter>") {

if (/:dN eq "n") {/:dN = "y";tellTarget ("go") {

gotoAndStop(2);}if (random(2) == 0 && /:dR ne "l") {

tellTarget ("mathai/clip") {gotoAndPlay(_totalframes-_currentframe);/:dR = "l";

}} else {

if (/:dR ne "r") {/:dR = "r";

}}tellTarget ("mathai/clip") {

play();}///:lSTime = getTimer();//

}}

Page 22: Mobile GameDevelopment using Flash Lite

on (keyPress "<Left>") {if (/:dN eq "y") {

tellTarget ("hL") {gotoAndPlay(2);

}if (/:dR eq "r") {

fscommand2("StartVibrate", 1000, 0, 0);//change/:dR = "l";tellTarget ("mathai/clip") {

gotoAndPlay(_totalframes-_currentframe);}

} else {tellTarget ("mathai/clip") {

gotoAndPlay(_currentframe+1);}

}}

}

Button code continued

Page 23: Mobile GameDevelopment using Flash Lite

Details

Adding levels Time based level up on button events Check out source

Page 24: Mobile GameDevelopment using Flash Lite

Visit us

www.csharks.com www.csharksgames.com www.manoramaonline.com/children

A lot more coming up this year