Using Flash to create animation and motion graphics provides a solution for
Creating character animation and motion graphics in Flash allows designers and animators to develop content that can be
When developing for devices, be organized and think ahead about what the device processor can display and at what frame rate, consider what the display
Although there are significant limitations in display sizes, hardware speeds, storage capacity, and connectivity, it's definitely worth understanding this balancing act so that content that's developed now can be
Chapter 7. CREATING INTERACTIVE
The source files for this book are available on the book's web site at www.flashenabled.com/book . You can find the files you need for the examples in this chapter at http://flashenabled.com/book/chapter7/ .
CONSTRAINTS OF THE GAME PLATFORM
When building Flash
This does not translate to the Pocket PC. With the introduction of Pocket PC 2002, all devices equipped with it are currently based on the same processor, the Intel strongARM processor running at 206MHz. In the future, there may be differences in speed between devices and processors, but currently there is one common platform. That makes testing easier for you -if it runs well on your testing device, it will run well on all devices. If it doesn't, it won't work well for
Pocket PCs are slower than desktop PCs. Although the CPU clock speed does not determine the actual speed of a device, it is an important indicator. Desktop CPUs are now way beyond 1GHz. The CPU currently used in a Pocket PC 2002 runs at 206MHz. The performance of a device is a compromise of
What does this mean for Flash games on the Pocket PC? You will meet the limits of processor power much more quickly than on a desktop. A great deal of movement on the screen and
The more actions you try to execute per frame, the more the processor has to work.
Alpha effects add even more to that because Flash has to redraw the area that an alpha effect is applied to, even if only a small part of it is actually affected by change. All these effects add up to use more processor power when used together or when used multiple times.
The frame rate of a movie also has an effect on the processor use. The frame rate you set is the maximum rate the movie can run. If Flash can't keep up with it, it tries to catch up -using as much processor power as it can. I recommend 10
Developing games from the beginning with low processor use in mind will save you a lot of pain. If a game runs fine on the Pocket PC, it will run perfectly smooth on your desktop computer.
Don't Count on Connectivity
Out of the box, the only connections a Pocket PC has are the sync cable to the desktop and the infrared connection. Although most Pocket PCs can be expanded to have an Internet connection of their own -you cannot expect it to be there. With Pocket PC 2002, you can now get to the Internet through the sync cable. That is nice for testing, but is not the typical game-playing situation on a device.
You generally want to play on the Pocket PC when you are away from your desk, when you have only the device with you. If you had a broadband wireless connection, you could just browse to your favorite game site and play. That is not reality yet. Most wireless connections are slow (
slow; such as between 1.0 and 1.5KB per second), and you pay for airtime. And most Pocket PC
So for games, as for most applications, it is best to package them so that they can be downloaded onto the desktop and then synched with the Pocket PC.
For some games, then, it might make sense to load small amounts of game data from a server while on the road. Still you should try to design your game so that it can run without a connection.
Saving Game States
The Flash Player for the Pocket PC does not provide you with any kind of file input/output (I/O). Thus you can't save and receive a game state directly.
You can use loadVariables (and with the Flash 5 Player, the XML object) to send and receive game states to a server. This, however, requires the device to have an Internet connection.
Death of a cookie can be caused by its expiration date, or when the user decides to clear his or her temporary Internet files. The browser may also drop cookies if it runs out of allowed space for temporary files. With the limited amount of internal storage space, this can happen much faster than on a desktop. And on top of that, the user may have
If you don't want to rely on cookies, you don't have a real option to save a game state when you use Flash by itself. If you want to be on the safe side, develop games that don't need to save a game state to be playable.
File Size for Games
Pocket PCs have a limited amount of internal storage space -
The Flash Player was originally created with small file sizes in mind. Yet it is still capable of handling files that are several megabytes on desktop systems. On the Pocket PC you shouldn't rely on the same capabilities, simply because there is much less overall memory available.
If you try to play back a 2MB SWF on the Pocket PC, Flash will not only have to keep those 2MB in memory while running as an ActiveX control within PIE, but PIE will also store a copy in the temporary Internet files. The Small Web Format (SWF) is a compressed format and during playback it gets uncompressed. This is especially the case when using bitmap graphics and playing back sound. If your device is equipped with 32MB of storage, of which 16 are reserved to run programs, you can easily run low on memory with larger files, especially when you also have other programs
You can help Flash with its memory management by splitting your files into smaller pieces and loading and unloading them as needed.
As you share a limited amount of available space with everything else the user has on his Pocket PC, it is a good idea to
Sound is an important part of the gaming experience. There are some limitations to the device, however, that you will have to keep in mind when creating games for the Pocket PC.
The built-in speaker has a naturally limited quality. The
On the technical side, Flash can export raw, uncompressed sound as well as ADPCM and MP3 compressed audio. The Flash 4 Player that was released for the Pocket PC could only handle raw audio and ADPCM compression. The Flash 5 Player for the iPaq also can play MP3 sounds. Versions for other platforms might or might not be able to handle MP3 sound.
means uncompressed sound. This leads quickly to huge files, so you don't want to use it in most cases. Although MP3 offers better compression and better sound quality than ADPCM, it is more processor-intense to play back and is thus competing for resources with the screen redraw and ActionScript. For some games this can make the difference between playing smoothly or not. At this point I recommend
This might change as more versions of the Flash Player support MP3 and the devices become more powerful. The backdrop is that ADPCM audio adds significantly to the file size compared to MP3 audio, so use it wisely and re-use event sounds where possible and use short loops where needed.
Display Size for Games
All Pocket PCs have the same display size of 240x320, a vertical format. The maximum area that can be used by Flash within Pocket Internet Explorer is 240x260. This area can be reduced if the user has the browser's address bar open.
This means you have only that amount of screen real estate -and not one pixel more. For game design, this means you have to be sure you have enough space for the game area itself, while reserving space for necessary status displays during the game. Additional framing artwork should be kept to a minimum.
With the stylus as pointing device, the "mouse" movement doesn't get tracked until you press on the screen. For Flash development, this means buttons do not receive rollover and rollout events.
The Pocket PC doesn't come equipped with a physical keyboard, thus you can't build complex game controls using the keyboard. The directional pad of the Pocket PC, however, functions in Flash as the arrow keys.