Wiley.Games.on.Symbian.OS.A.Handbook.for.Mobile.Development.Apr.2008 (779888), страница 71
Текст из файла (страница 71)
The MDLsite includes a number of articles, discussion forums and, most importantly, some translations of the API documentation for newer versions ofthe DoJa profile. This site was created and is personally maintained bySam Cartwright, one of the top DoJa game development experts. Sam isbased in Tokyo and has also reviewed, contributed to, and advised onthe content of this chapter.DoJa development is one of the more challenging game developmenttechnologies around and is also one of the most interesting. It sits astridethe cutting edge of progress being constantly exposed to the very latestin mobile device hardware evolution.
The great thing about that is thatwhen a technology pushes boundaries, developers tend to get pushedtoo. When that happens, your exposure to innovation increases andconsequently so does your professional skill set. And that’s almost nevera bad thing.Hopefully, as time goes on, DoJa development will become moremainstream and take its place in the Symbian ecosystem alongsideSymbian C++, P.I.P.S, Open C, MIDP and Flash Lite as a core mobilegame development technology in the world outside of Japan.But only time will tell, so we’ll just have to wait and see, won’t we?11Flash Lite Games on Symbian OSNigel Hietala11.1 IntroductionFlash is all about great bitmap and vector graphics with animation.
Flashabstracts away the complexity that C++ development normally involves,allowing the developer to just work directly on polishing the actual game.Developing with Flash can be productive, fast, rewarding and genuinelyfun. Many developers are currently unaware of what Flash Lite is and howto get started developing with it. This chapter provides an introduction toFlash Lite and describes how it is particularly well suited to mobile games.I’ll also discuss the powerful way that dynamic graphics and animationare abstracted via the Flash Lite runtime and API.The chapter explores the available tools, which include not only FlashCS3 Professional, but also Adobe Creative Suite, and a range of third partyand open source products that are necessary to make Flash developmentproductive.
Finally, I’ll conclude with details of the Flash ecosystem,which is a combination of companies and communities that support,educate, and provide software extensions to Flash.11.1.1 The Flash PlatformFlash may be a recent technology for mobile phones but it has alreadyundergone a decade of development and use on the Internet. Flash startedfrom humble beginnings as a tool and plug-in to enable vector animationfor websites. Today, it has superseded its animation roots and is now, likeJava, a sophisticated runtime.Figure 11.1 shows the three main versions of the Flash platform onwhich you can develop.
Flash Lite is the mobile incarnation of Flash.Version 1.0 was launched first in Europe and Japan in 2003. Version 1.1followed shortly and was also made available in the US.322FLASH LITE GAMES ON SYMBIAN OSAIRFlashFlashLiteonlinewebcontentand Web2.0 appsonlineandofflineRichWeb 2.0appsAIRFlexframeworkFlexframeworkMobilerun-timeAVM 2AVM 2AVM 1AVM 1AVM 1On mobile devicesOn the webOn the desktopFigure 11.1The Flash platformVersion 1.0 of Flash, for the web, was originally launched a decadeago.1 Now at version 9, Flash Player penetration is at 90.3 % for FlashPlayer v9, 98.5 % for v8, and 99.3 % for v6 and v7.2At the heart of Flash is the ActionScript Virtual Machine or AVM.Flash 9 provides a new virtual machine AVM 2. As Figure 1.1 shows, theoriginal AVM that powers Flash Lite is still included in Flash 9, allowingbackwards compatibility with all the older content available.AVM 2 provides a huge performance jump through the introduction ofa new version of Flash’s scripting language called ActionScript 3.0 and aleading edge runtime technology featuring a just-in-time compiler.
Thissame technology recently became a Mozilla open source project and willpower the JavaScript side of a future version of the Firefox web browser.3Web 2.0 is currently receiving a lot of positive press. Web 2.0 is thecombination of a number of technologies to deliver a new generationof Internet sites and services. These sites are also known as rich Internetapplications (RIAs) due to their ability to deliver an experience closer tothe sophistication of a desktop application. One of the key technologiesin this new world is Flash, and a specialized framework called Flex.4The Flex framework is built on top of Flash 9 and offers a number ofAPIs, components, and frameworks that make it easier to create Web 2.0applications. It is discussed in more detail in section 11.4.4.1www.adobe.com/products/flash/special/flashanniversarywww.adobe.com/products/player census/flashplayer/version penetration.html3www.mozilla.org/projects/tamarin4Flex recently became an Open Source project as well: www.adobe.com/aboutadobe/pressroom/pressreleases/200704/042607Flex.html.2FLASH LITE ON MOBILE PHONES323The rightmost box in Figure 11.1 shows the latest evolution of Flash.The Adobe Integrated Runtime (AIR) allows sophisticated desktop applications to be built with Flash and HTML technologies.
Simply put, thismeans that a Flash Lite game developer is gaining a reusable knowledgeand skill sets that can easily be used to target other versions of Flash. Forexample, it would be simple to provide versions of a Flash Lite game thatare both viewable and playable in a desktop web browser when peoplevisit the game’s website using their PC.11.2 Flash Lite on Mobile PhonesFlash, as Flash Lite, is available for a wide range of mobile devicesincluding Nokia Series 40, Nokia S60 (2nd and 3rd Edition),5 UIQ, BREW2.x/3.x and Microsoft Windows Mobile 5. With over 300 million Flashenabled mobile devices and handsets shipped so far, Adobe expects morethan one billion Flash-enabled devices to be available by 2010.Eighty percent of the mobile devices shipping in Japan today can runFlash software.
Handango, Iguana Mobile, and MOBIBASE, three of theworld’s leading content aggregators, have signed up to accept Flash Litecontent, so opportunities are good for Flash Lite developers to distributetheir games.11.2.1 Flash Lite VersionsFlash Lite 1.x is based on Flash 4 for the web. Although graphicallypowerful, version 1.x is not nearly as powerful as Flash Lite 2.x.
Thelimitations include missing primitive data types, such as arrays, andinclusion of an earlier version of ActionScript that is not object oriented.Flash Lite 2.x is based on Flash 7 for the web and includes ActionScript 2.0. This is an object oriented scripting language with a rich API.Modern software development involves object oriented programming,sophisticated code editors, and testing frameworks. It requires teams ofseveral people with workflow between developers and designers.
OnlyFlash Lite 2.x supports this level of development and so is the focus ofthe remainder of the chapter. For those wanting to work on a Symbianplatform, at the time of writing (September 2007), Flash Lite 2.x is onlyavailable on S60 3rd Edition smartphones.6Just before we went to press, Adobe formally announced Flash Lite3, which will be available first on NTT DoCoMo phones in Japanand globally on Nokia’s phones.
The new version includes support for5More than 50 announced Nokia Series 40 and S60 device models support Flash Lite.You can find a list of mobile phones and the version of Flash Lite they support here:www.adobe.com/mobile/supported devices/handsets.html.6324FLASH LITE GAMES ON SYMBIAN OSFlash video (e.g., as found on YouTube), and Adobe says the aim isto more closely replicate the experience of Flash on the desktop.
Atthe same time, Forum Nokia launched the ‘Creative Pros’ communityat www.forum.nokia.com/creativepros to help desktop Flash developersport their content to mobile devices. The site provides tools and SDKs,plus technical and business support, to help creative professionals reachmillions of mobile device users in the marketplace with applications,content, and services for Nokia’s S60 and Series 40 platforms.11.2.2 The Suitability of Flash on Mobile PhonesFlash Lite’s web-based past is what makes it such a well-adapted mobiletechnology:• the compiled Flash binary is optimized to be compact for a fastdownload. This fits with the limited storage space many phones stillhave, and also makes the binaries suitable for download to the phoneover the phone network• Flash supports both vector and bitmap graphics• web browser plug-ins have limited access to the CPU so Flash doesnot have a requirement for a powerful CPU.
The processors usedby Symbian smartphones are relatively powerful, when compared tosome of the feature phones that Flash Lite can also run on, and thefact that Flash does not require a large amount of processing horsepower makes it suitable for mobile devices• Flash Lite runs in a secure sandbox, meaning consumers and networkoperators can be confident that only a small subset of mobile phoneand network functionality can also be accessed, and security cannotbe compromised• With some optimization, Flash 7 content can be reused for Flash Lite.11.3Flash Lite OverviewThe following is a short overview of the main parts of Flash Lite and howthey relate to mobile games, covering details of the graphics API, thescripting language, and how the two work together to make games easyto develop.The compiled binary that makes up a Flash Lite game is known as aSWF file.