Wiley.Games.on.Symbian.OS.A.Handbook.for.Mobile.Development.Apr.2008 (779888), страница 73
Текст из файла (страница 73)
It is a significant upgrade from previous versions and offers anew improved UI that, for the first time, is consistent with other CS3applications, including Photoshop and Illustrator. A screenshot is shownin Figure 11.5.Figure 11.5 Adobe Flash CS3 ProfessionalThe Flash IDE is a powerful tool for designers. It allows a libraryof graphics and sounds to be managed. It offers a range of tools formanipulating bitmap and vector graphics. For the design and art side ofa game, the Flash IDE is a critical tool.
Most of the time will be spentmanaging items on the stage (the electronic canvas that represents whatwill be seen on screen). The other key part is the visual timeline. Thisallows designers with little or no software development knowledge tocreate rich, dynamic, interactive game elements. As I described above,this flexibility can be used positively to try out ideas, but it can alsobe misused to create games that cannot be maintained.
The timelineallows ideas to be quickly tried out. However, these elements should bere-factored to ensure the code and graphics are separate from each other.On the software side, the Flash IDE provides ways to profile the SWFto allow optimization of the file size. For bitmaps, compression settingscan be tweaked on a global level or for individual files. An ActionScriptFLASH LITE DEVELOPMENT TOOLS331language reference specifically tailored for Flash Lite can be searchedand browsed. For more sophisticated code editing, see the later toolssection.11.4.2 Adobe Bridge and Device CentralThe Adobe Bridge is a separate component that ships with all applicationsthat are part of the Adobe Creative Suite.
It is dedicated to the managementof assets such as JPEGs and PNGs. Even SWF files can be interactivelypreviewed inside the Bridge. This is an invaluable feature in the latestages of development, when there may be many versions of the samegame to choose from.Something new with CS3 is Adobe Device Central, which is a dedicatedmobile simulation environment, a screenshot of which is shown in Figure11.6. For Flash, it speeds up application development by allowing gamesto be previewed and tested without having access to real phone hardware.Photoshop, Illustrator, and several other CS3 applications also use it topreview how graphics will look on a mobile phone.
It speeds up thedevelopment cycle, as more work can be done on the desktop, andavoids the break in the flow that can occur when you need to stop tocheck how the game runs on a real Symbian smartphone.Device Central is regularly updated with the device profiles for thelatest phones that support Flash Lite. Other functions include the ability tosimulate the speed of a mobile phone to ensure there are no performancesurprises when the game is run on real hardware. Device Central isFigure 11.6 Adobe Device Central CS3332FLASH LITE GAMES ON SYMBIAN OSeven more valuable now that there are a growing number of phones forgames developers to target and purchasing every compatible device isimpractical.11.4.3 Adobe Creative SuiteThe full creative suite contains tools for areas such as video, soundand visual effects as well as web and print design.
Many of these havenothing to do with games development, but three applications that do areFireworks, Photoshop and Illustrator CS3.Photoshop can be used for editing bitmaps and Illustrator can be usedfor vector graphics. Both tools have functionality that goes far beyondwhat Flash offers, and are critical for the creation of top grade graphics.Effects such as glow, drop shadows, and blur cannot be achieved in realtime with Flash Lite. However, they can be applied to graphics by usingPhotoshop.Fireworks combines many of the key bitmap and vector tools fromboth Photoshop and Illustrator, but in an easier to use, more compactapplication.Now that Flash, Fireworks, Photoshop and Illustrator are part of thesame suite and have similar interfaces and some level of integration, it ispossible to ensure fast workflows between designers and developers.CS3 applications are also extendable via plug-ins and scripts.
Plugins provide new functionality, while scripts allow the automation ofrepetitive tasks. It is this ability to extend and automate things that meansprofessional users of CS3 applications can free up more of their time topolish their games.11.4.4 Eclipse IDEThe Flex framework builds on Flash 9. Adobe offers a specialized toolfor building Flex and ActionScript 3.0 projects through a software development focused IDE called Flex Builder.
Flex Builder is built on a freeopen source platform called Eclipse (more information is available atwww.eclipse.org ). It is also possible to use Flash Lite and ActionScript2.0 in Eclipse. There is an open source project called ASDT, found atosflash.org/projects/asdt , that provides support, but its features are ratherlimited.ActionScript developers should also have a look at FDT10 (Flashdevelopment tool). It is a commercial plug-in for Eclipse and provideseverything a developer would want. Eclipse itself brings source controlintegration, ANT builds, source file searching, and many other features.For the small overhead of having to write ActionScript class files, FDT10fdt.powerflasher.comFLASH LITE DEVELOPMENT TOOLS333offers class browsing, easy source file navigation, syntax highlighting,auto code completion, integrated Flash documentation, quick fixes, andreal-time source file parsing.
This real-time parsing results in seeing errorsin the code as you type. Thus, instead of having to compile your code tosee common mistakes, FDT shows them in real time. It can also providewarnings that allow better code styles to be enforced.
It can, for example,warn of functions that have no return types. FDT allows compilation withboth the Flash IDE and MTASC, which we’ll talk about next.11.4.5 MTASCThe Motion Twin ActionScript Compiler, or MTASC11 as it is known, isa fast compiler that can noticeably speed up game development. It is anopen source project and binaries are available for Microsoft Windows,Mac OS X and Linux. There are some important caveats that must beconsidered before use:• it does not support all the code styles that Flash CS3 Professional willcompile.
So code from existing projects will need some porting• it is possible to write code that works with MTASC that does notbehave identically when compiled with Flash CS3 Professional.For projects starting from scratch and with no requirement to latercompile with the Flash IDE, MTASC speeds up development in thefollowing ways.First of all, MTASC only compiles ActionScript. A SWF full of assetswill still need to be provided. MTASC will then compile the ActionScriptinto byte code and ‘inject’ it into the SWF to make a complete binary.The first speed gain is from not having to recompile the assets into theSWF, something that can take minutes, if there are lots of graphical assetsand sound files to reconvert.The second gain is from the speed in compiling.
On a modern desktopover 100 classes can be compiled in under five seconds. This takes theagile development model of quick iterations, write some code and thenbuild, to its full extreme. It allows the developer to write a couple of linesof code and then recompile the entire game in a few seconds to see theresult.The MTASC compiler also can be set to provide more verbose compilation details, as well as a strict mode that will refuse to compile codeif it is not strictly typed.
MTASC also includes a few other bonuses. Javadevelopers may feel more at home by utilizing comment based metadatathat can be added to facilitate typed arrays.11www.mtasc.org334FLASH LITE GAMES ON SYMBIAN OS11.4.6 XrayFlash Lite games can be tricky to debug. There are no sophisticateddebuggers as there are with the other languages on Symbian OS, suchas C++ and Java.
Flash has a trace statement that can output log stylemessages to help find problems. However the use of trace is limited.Further debugging techniques, such as being able to recursively tracethe contents of arrays and other objects, are needed. If you are used toother development languages you may expect proper logging with debug,warning and error messages.