Game Porting in Flash Lite 1.1 Porting of game Balancing Mathai by Csharks by Juwal Bose
Versions of Flash Lite 1.x – Most wide spread 2.x – Most capable 3.0 – For upcoming hand sets
Limitations Screen resolution Color depth Processor power Memory Sound reproduction Flash version support Key pad layout / Controls
Our scenerio Already have the game in flash AS1/2 We will build for Flash lite 1.1 Nokia S60 – 176 x 208
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
Tools Required Flash – mx2004, v8, cs3  Adobe Device Central CS3 Flash Lite 1.1 CDK Flash Lite Device
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
 
Gradients
 
Optimizing code Use small variable names Reuse variables Reduce nested loops Flash lite 1.1 is optimized
Design changes Static 5 levels Pre animated graphics Left/Right arrow controls with enter key Extensive use of movie clips and an invisible button
The frames 6 frames labeled logo, menu, help, game, over and win
The frames cont… Invisible button is placed out side the scene to take key presses
The frames cont… The frame code on frame 1
The frames cont… Button code on help frame on (keyPress &quot;<Enter>&quot;) { tellTarget (&quot;/&quot;) { gotoAndPlay(&quot;menu&quot;); } } Button code on game over and game win frames on (keyPress &quot;<Enter>&quot;) { tellTarget (&quot;/&quot;) { gotoAndPlay(&quot;game&quot;); } }
The menu A movie clip with 3 frames (labels s,h,c) is present with an invisible button having the code
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
Game frame code lSTime = dT=lLTime=o; level = 1; mF = 20; sF = 10; dR = &quot;&quot;; dN = &quot;n&quot;; interval = 10000; tellTarget (&quot;go&quot;) { gotoAndStop(1); } tellTarget (&quot;mathai&quot;) { gotoAndStop(1); } tellTarget (&quot;mathai/clip&quot;) { gotoAndStop(10); } // stop();
Mathai Clip frame code
Button code on (keyPress &quot;<Enter>&quot;) { if (/:dN eq &quot;n&quot;) { /:dN = &quot;y&quot;; tellTarget (&quot;go&quot;) { gotoAndStop(2); } if (random(2) == 0 && /:dR ne &quot;l&quot;) { tellTarget (&quot;mathai/clip&quot;) { gotoAndPlay(_totalframes-_currentframe); /:dR = &quot;l&quot;; } } else { if (/:dR ne &quot;r&quot;) { /:dR = &quot;r&quot;; } } tellTarget (&quot;mathai/clip&quot;) { play(); } // /:lSTime = getTimer(); // } }
Button code continued on (keyPress &quot;<Left>&quot;) { if (/:dN eq &quot;y&quot;) { tellTarget (&quot;hL&quot;) { gotoAndPlay(2); } if (/:dR eq &quot;r&quot;) { fscommand2(&quot;StartVibrate&quot;, 1000, 0, 0); //change /:dR = &quot;l&quot;; tellTarget (&quot;mathai/clip&quot;) { gotoAndPlay(_totalframes-_currentframe); } } else { tellTarget (&quot;mathai/clip&quot;) { gotoAndPlay(_currentframe+1); } } } }
Details Adding levels Time based level up on button events Check out source
Visit us www.csharks.com www.csharksgames.com www.manoramaonline.com/children A lot more coming up this year

Mobile GameDevelopment using Flash Lite

  • 1.
    Game Porting inFlash Lite 1.1 Porting of game Balancing Mathai by Csharks by Juwal Bose
  • 2.
    Versions of FlashLite 1.x – Most wide spread 2.x – Most capable 3.0 – For upcoming hand sets
  • 3.
    Limitations Screen resolutionColor depth Processor power Memory Sound reproduction Flash version support Key pad layout / Controls
  • 4.
    Our scenerio Alreadyhave the game in flash AS1/2 We will build for Flash lite 1.1 Nokia S60 – 176 x 208
  • 5.
    Case with FlashLite 2.X We can directly port our code Only Graphics optimizations needed Less number of devices Require higher version of flash IDE
  • 6.
    Tools Required Flash– mx2004, v8, cs3 Adobe Device Central CS3 Flash Lite 1.1 CDK Flash Lite Device
  • 7.
    Graphics Optimizations Reducethe 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
  • 8.
  • 9.
  • 10.
  • 11.
    Optimizing code Usesmall variable names Reuse variables Reduce nested loops Flash lite 1.1 is optimized
  • 12.
    Design changes Static5 levels Pre animated graphics Left/Right arrow controls with enter key Extensive use of movie clips and an invisible button
  • 13.
    The frames 6frames labeled logo, menu, help, game, over and win
  • 14.
    The frames cont…Invisible button is placed out side the scene to take key presses
  • 15.
    The frames cont…The frame code on frame 1
  • 16.
    The frames cont…Button code on help frame on (keyPress &quot;<Enter>&quot;) { tellTarget (&quot;/&quot;) { gotoAndPlay(&quot;menu&quot;); } } Button code on game over and game win frames on (keyPress &quot;<Enter>&quot;) { tellTarget (&quot;/&quot;) { gotoAndPlay(&quot;game&quot;); } }
  • 17.
    The menu Amovie clip with 3 frames (labels s,h,c) is present with an invisible button having the code
  • 18.
    The game frameDynamic 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
  • 19.
    Game frame codelSTime = dT=lLTime=o; level = 1; mF = 20; sF = 10; dR = &quot;&quot;; dN = &quot;n&quot;; interval = 10000; tellTarget (&quot;go&quot;) { gotoAndStop(1); } tellTarget (&quot;mathai&quot;) { gotoAndStop(1); } tellTarget (&quot;mathai/clip&quot;) { gotoAndStop(10); } // stop();
  • 20.
  • 21.
    Button code on(keyPress &quot;<Enter>&quot;) { if (/:dN eq &quot;n&quot;) { /:dN = &quot;y&quot;; tellTarget (&quot;go&quot;) { gotoAndStop(2); } if (random(2) == 0 && /:dR ne &quot;l&quot;) { tellTarget (&quot;mathai/clip&quot;) { gotoAndPlay(_totalframes-_currentframe); /:dR = &quot;l&quot;; } } else { if (/:dR ne &quot;r&quot;) { /:dR = &quot;r&quot;; } } tellTarget (&quot;mathai/clip&quot;) { play(); } // /:lSTime = getTimer(); // } }
  • 22.
    Button code continuedon (keyPress &quot;<Left>&quot;) { if (/:dN eq &quot;y&quot;) { tellTarget (&quot;hL&quot;) { gotoAndPlay(2); } if (/:dR eq &quot;r&quot;) { fscommand2(&quot;StartVibrate&quot;, 1000, 0, 0); //change /:dR = &quot;l&quot;; tellTarget (&quot;mathai/clip&quot;) { gotoAndPlay(_totalframes-_currentframe); } } else { tellTarget (&quot;mathai/clip&quot;) { gotoAndPlay(_currentframe+1); } } } }
  • 23.
    Details Adding levelsTime based level up on button events Check out source
  • 24.
    Visit us www.csharks.comwww.csharksgames.com www.manoramaonline.com/children A lot more coming up this year