Learn the aspects of building multi-screen and multi-form factor games for various devices ranging from mobiles, tablets to desktop. Also covered will be the aspects of design/development for web based games and standalone games for multiple devices. Understand how Adobe Flash Platform makes it extremely easy for you to build striking games, test and publish them for many devices.
20. Other Challenges
• Layout - UI, Graphics, Front-end logic
• Performance - Optimization for Memory, Processor, etc.
21. Layout
Liquid Layout in pure ActionScript 3.0
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.addEventListener(Event.RESIZE. onResize);
private function onResize(event:Event):void {
// LAYOUT LOGIC
}
22. Content Scaling for Games
• Not as easy as you think
• For any technology for that matter!
• Define different bitmaps for different screen densities
• flash.system.Capabilities.screenDPI is your KEY!
23. Content Scaling for Physical Size
Capabilities.screenDPI * (physicalSize) = Same size on any screen!
29. Publishing
Android
BlackBerry
iOS
Windows
Macintosh
Linux
30. Publishing
Android
BlackBerry
iOS
Windows
Macintosh
Linux
31. Publishing
Android
BlackBerry
iOS
Windows
Macintosh
Linux
32. Publishing
Android
BlackBerry
iOS
Windows
Macintosh
Linux
33. Publishing
Android
BlackBerry
iOS
Windows
Macintosh
Linux
34. Vectors & Bitmaps
• Bitmaps are costly on file size and loading
• Optimize Bitmaps as necessary
• Intelligently use PNG / JPG
• Vectors are costly on rendering
• Cache (static) vector images as bitmaps when necessary
35. 3 Dimentional - Demo
• Stereoscopic Games
• Realtime 3D Rendering (Hardware Accelerated)
39. Multiplayer
• Socket Server - AIR 2 SocketServer Class
• Peer to Peer - AIR 2.5 P2P
40. Optimization Tips
• Bitmaps for Performance Vs Vectors for Less Memory
• Keep bitmaps as small as possible
• Reduce number of nodes for Vectors
• Use opaque background for texts
• Experiment with Anti-aliasing options for text
41. Optimization Tips
• Keep as less vector points as possible in the artwork
542 Points 282 Points
5.1 kb 3.8 kb
42. Optimization Tips
• Use only if absolutely necessary (for Mobile Content) –
★ Filters
★ Blend Modes
★ Transparency
★ Perspective Distortion
43. Optimization Tips
• Set Frame Rate as low as possible
• Adjust Frame Rate dynamically
• Combine Event Handlers functions wherever possible
• Use EnterFrame over Timers
• Use Event.RESIZE over
StageOrientationEvent.ORIENTATION_CHANGE
44. Optimization Tips
• Place text/graphics on whole pixels (Pixel Boundaries)
• Avoid object creation inside loops
• Instantiate one Library Bitmap and re-use the BitmapData
• Use Loader.unloadAndStop(); - Sounds, Listeners, Timers, HW, etc.