Home > Store

Beginning Mobile Phone Game Programming

Register your product to gain access to bonus material or receive a coupon.

Beginning Mobile Phone Game Programming

Book

  • Sorry, this book is no longer in print.
Not for Sale

Description

  • Copyright 2005
  • Dimensions: 7-3/8" x 9-1/8"
  • Pages: 528
  • Edition: 1st
  • Book
  • ISBN-10: 0-672-32665-5
  • ISBN-13: 978-0-672-32665-3

Build several fully functional games as well as a game engine to use for programming cell phone and mobile games with Beginning Mobile Phone Game Programming! The included CD provides the tool, code and graphics necessary to complete all exercises covered in the chapters. Beginning Cell Phone Game Programming demystifies wireless game programming by providing clear, practical lessons using the J2ME Game API. You will learn how to use the most popular mobile programming language, Java, to build compact games that can run on any Java-enabled device, including mobile phones, pagers and handheld computers. You will also learn to add a splash screen, create a demo mode, keep track of high scores, and test, debug, and deploy your games.

Topics covered include:

  • How to construct a game engine to drive mobile games.
  • How to use Java 2 Micro Edition (J2ME) and the Java Game API to get the most performance out of your mobile games.
  • How to implement sprite animation and control interactions among moving sprites.
  • How to play sound effects and music in mobile games.
  • How to take advantage of wireless networks to build mobile multiplayer games.
  • How to design and develop a variety of different games spanning several video games genres.

Sample Content

Online Sample Chapters

Constructing a Mobile Game Skeleton

Constructing a Mobile Game Skeleton

Table of Contents

Introduction.

I. GETTING STARTED WITH MOBILE GAME PROGRAMMING.

1. Games on the Go.

    Essentials of Mobile Gaming

      The First Mobile Phone Game

      The Market for Mobile Games

      The Culture of Mobile Games

      The Bleeding Edge of Mobile Gaming

    Getting to Know Mobile Platforms

      Java 2 Micro Edition (J2ME)

      Binary Runtime Environment for Wireless (BREW)

      Symbian

      Windows Mobile Smartphone

    Java As a Mobile Game Platform

      What Is Java?

      Why Java?

      Java and Mobile Game Programming

    A Quick J2ME Primer

      Configurations and the Connected Limited Device Configuration (CLDC)

      Profiles and the MIDP

    Summary

    Field Trip

2. Mobile Java Game Development Basics.

    Game Design Basics

      Coming Up with the Basic Idea

      Developing the Storyline

      Establishing the Play Modes

    A J2ME Game Development Primer

    Getting to Know the J2ME Wireless Toolkit

      Using KToolbar

      Managing MIDlet Game Projects

      Building a Game MIDlet

      Testing a Game MIDlet

    The J2ME Emulator and Physical Devices

    Summary

    Field Trip

3. Constructing a Mobile Game Skeleton.

    Exploring the J2ME APIs

      The CLDC API

      The MIDP API

    Understanding MIDlets

      Inside a MIDlet

      The Basics of MIDlet Development

    Building the Skeleton Example Program

      Writing the Program Code

      Preparing the MIDlet for Distribution

      Building and Testing the Finished Product

    Summary

    Extreme Game Makeover

II. MOBILE GAME PROGRAMMING ESSENTIALS.

4. Mobile Game Graphics 101.

    Mobile Graphics Basics

      Understanding the Graphics Coordinate System

      Learning the Basics of Color

    Working with Graphics in J2ME

      Drawing Graphics Primitives

      Drawing Text

      Drawing Images

    Building the Olympics Example Program

      Writing the Program Code

      Testing the Finished Product

    Building the Slideshow Example Program

      Writing the Program Code

      Testing the Finished Product

    Summary

    Extreme Game Makeover

5. Using Sprite Animation.

    Understanding Animation

      Animation and Frame Rate

      Making the Move to Computer Animation

      2D Versus 3D Animation

    Analyzing 2D Sprite Animation

      Frame-Based Animation

      Cast-Based Animation

    Applying Sprite Animation to Mobile Games

    Working with the Layer and Sprite Classes

    Achieving Smooth Animation with the GameCanvas Class

    Building the UFO Example Program

      Writing the Program Code

      Testing the Finished Product

    Summary

    Extreme Game Makeover

6. Handling Mobile User Input.

    Assessing Mobile Game Input

    Handling Key Input with the GameCanvas Class

    Revisiting the Sprite Class

      Detecting Sprite Collisions

      Working with Frame-Animated Sprites

    Building the UFO 2 Example

      Writing the Program Code

      Testing the Finished Product

    Summary

    Extreme Game Makeover

7. Henway: Paying Tribute to Frogger.

    The Scoop on Henway

    Designing the Game

    Developing the Game

      Writing the Game Code

    Testing the Game

    Summary

    Extreme Game Makeover

8. Making Noise with Tones.

    Sound and Mobile Games

    A Tonal Sound and Music Primer

    Querying a Phone for Its Audio Capabilities

    Playing Tones in Mobile Games

      Playing Individual Tones

      Playing a Tone Sequence

    Building the UFO 3 Example Program

      Writing the Program Code

      Testing the Finished Product

    Summary

    Field Trip

9. Playing Digitized Sound and Music.

    A Digitized Sound Primer

    Getting to Know Wave Sounds

    Creating and Editing Wave Sounds

    Revisiting the Player Interface

    Playing Wave Sounds in Mobile Games

      Playing a Wave from a JAR File

      Playing a Wave from a URL

    Feeling the Music with MIDI

    Playing MIDI Music in Mobile Games

      Playing a MIDI Song from a JAR File

      Playing a MIDI Song from a URL

    Building the Henway 2 Example Game

      Writing the Game Code

      Testing the Finished Product

    Summary

    Field Trip

III. VIRTUAL WORLDS AND MOBILE GAME INTELLIGENCE.

10. Creating Tiled Game Layers.

    What Is a Tiled Layer?

    Creating Maps for Tiled Layers

      Using the Mappy Map Editor

      Using the Tile Studio Map Editor

      Formatting Map Information for Games

    Working with the TiledLayer Class

      Creating a Tiled Layer

      Moving and Drawing a Tiled Layer

    Building the Wanderer Example Program

      Writing the Program Code

      Testing the Finished Product

    Summary

    Field Trip

11. Managing Multiple Game Layers.

    Dealing with Multiple Game Layers

    Working with the LayerManager Class

    Animating Tiled Layers

    Building the Wanderer 2 Example Program

      Designing the Tiled Layer Maps

      Writing the Program Code

      Testing the Finished Product

    Summary

    Extreme Game Makeover

12. High Seas: A Game for the Pirate in You.

    The Scoop on High Seas

    Designing the Game

      Putting Together the Water Map

      Putting Together the Land Map

    Developing the Game

      Creating a Drift Sprite

      Declaring the Member Variables

      Assembling the start() Method

      Piecing Together the update() Method

      Drawing the Game Screen

      Starting a New Game

      Safely Placing Sprites

    Testing the Game

    Summary

    Extreme Game Makeover

13. Teaching Games to Think.

    The Least You Need to Know About AI

    Exploring Types of Game AI

      Roaming AI

      Behavioral AI

      Strategic AI

    Developing an AI Strategy

    Teaching Sprites to Think...Sort Of

      Designing the Chase Sprite

      Coding the Chase Sprite

    Building the High Seas 2 Example Game

      Writing the Program Code

      Testing the Finished Product

    Summary

    Extreme Game Makeover

IV. TAKING ADVANTAGE OF THE WIRELESS NETWORK.

14. Mobile Game Networking Essentials.

    Multiplayer Game Basics

      Turn-Based Games

      Event-Based Games

    Network Game Problems and Solutions

      State Synchronization

      Input Synchronization

      A Hybrid Solution

    Communicating over a Network with Sockets

      Stream Sockets

      Datagram Sockets

    Network Programming and J2ME

      Creating Datagram Packets

      Sending Datagram Packets

      Receiving Datagram Packets

    Building the Lighthouse Example

      Designing the Client and Server

      Writing the Program Code

      Testing the Finished Product

    Summary

    Field Trip

15. Connect 4: A Classic Game Goes Wireless.

    The Scoop on Connect 4

    Designing the Game

      Graphics and User Interface

      Game Logic

      Networking

    Developing the Game

      The Connect 4 Client and Server

      The Connect 4 Game Canvas

      The Connect 4 Game State

    Testing the Game

    Summary

    Field Trip

16. Debugging and Deploying Mobile Games.

    Game Debugging Basics

      Single-Stepping Code 

      Watching Variables 

      Using Breakpoints

    Game Debugging Strategies

      Bug Prevention

      Bug Detection

    Choosing a Debugger

    Deploying Mobile Games

      Understanding Over-the-Air Provisioning

      Preparing Your Game for Deployment

      Tweaking Your Web Server

    Testing OTA Provisioning with KToolbar

    Summary

    Field Trip

V. SPRUCING UP YOUR GAMES.

17. Optimizing Mobile Java Games.

    Understanding Mobile Game Optimization

      Optimizing for Maintainability

      Optimizing for Portability

      Optimizing for Size

      Optimizing for Speed

    General Mobile Game Optimization Tips

      Reducing Memory Usage

      Minimizing Network Data

      Eliminating Unnecessary Graphics

    Java Code Optimization Tricks

      Compiling Without Debug Information

      Eliminating Unnecessary Evaluations

      Eliminating Common Subexpressions

      Taking Advantage of Local Variables

      Expanding Loops

      Code Shrinking and Obfuscation

    Profiling Your Mobile Game Code

    Monitoring Mobile Game Memory Usage

    Putting Mobile Game Optimization into Perspective

    Summary

    Extreme Game Makeover

18. Space Out: Paying Tribute to Space Invaders.

    The Scoop on Space Out

    Designing the Game

    Developing the Game

      Creating a Moving Sprite

      Declaring the Member Variables

      Assembling the start() Method

      Piecing Together the update() Method

      Drawing the Game Screen

      Starting a New Game

      Adding Aliens, Missiles, and Explosions

    Testing the Game

    Summary

    Extreme Game Makeover

19. Keeping Track of High Scores.

    The Importance of Logging Your Achievements

    Getting to Know the Java RMS

      Understanding Records and Record Stores

      Exploring the RecordStore Class

    Preparing High Score Data for Storage

    Building the Space Out 2 Example Game

      Designing the Game Enhancements

      Writing the Game Code

      Testing the Finished Product

    Summary

    Field Trip

VI. APPENDIXES.

Appendix A. Java Game API Reference.

    The GameCanvas Class

      Member Constants

      Constructor

      Methods

    The Layer Class

      Methods

    The Sprite Class

      Member Constants

      Constructors

      Methods

    The TiledLayer Class

      Constructor

      Methods

    The LayerManager Class

      Constructor

      Methods

Appendix B. Mobile Game Programming Resources.

    Micro Dev Net

    J2ME Gamer

    J2ME.org

    Forum Nokia's Mobile Games Community

    Wireless Developer Network

    GameDev.net

    Gamasutra

    Game Developer Magazine

    Gamelan

    JavaWorld

    The Official Java Website

Appendix C. Creating Graphics for Mobile Games.

    Assessing Game Graphics

      Determining the Game Screen Size

      Reaching the Target Audience

      Establishing a Game Setting and Mood

      Adhering to a Graphics Style

    Exploring Graphics Tools

      Image Alchemy

      Paint Shop Pro

      Graphic Workshop

    Creating and Editing Graphics

      Line-Art Graphics

      3D Rendered Graphics

      Scanned Photography and Video-Captured Graphics

      Background Graphics and Textures

      Animated Graphics

    Finding Graphics

Bonus: Java Programming Primer - CD-ROM.

Index.

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020