Motorola C450, C550, C370 technical manual GameScreen Class, GameScreen Fields

Page 40

GameScreen Class

The GameScreen class provides the basis for a game user interface. In addition to the features inherited from MIDP's Canvas (commands, input events, etc.) The GameScreen class provides game-specific capabilities such as an off-screen buffer with synchronized flushing and key status polling. A game can provide its own thread to run the game loop. A typical loop will check for input, implement the game logic, and then render the updated user interface.

GameScreen Fields

The GameScreen class defines the following fields:

public static final int DOWN_KEY - The bit representing the DOWN key. This constant has a value of 0x02.

public static final int FIRE_KEY - The bit representing the FIRE key. This constant has a value of 0x10.

public static final int GAME_A_KEY - The bit representing the GAME_A key (may not be supported on all devices). This constant has a value of 0x20.

public static final int GAME_B_KEY - The bit representing the GAME_B key (may not be supported on all devices). This constant has a value of 0x40.

public static final int GAME_C_KEY - The bit representing the GAME_C key (may not be supported on all devices). This constant has a value of 0x80.

public static final int GAME_D_KEY - The bit representing the GAME_D key (may not be supported on all devices). This constant has a value of 0x100.

public static final int LEFT_KEY - The bit representing the LEFT key. This constant has a value of 0x04.

public static final int RIGHT_KEY - The bit representing the RIGHT key. This constant has a value of 0x08.

public static final int UP_KEY - The bit representing the UP key. This constant has a value of 0x01.

public static final int PRIORITY_MAX - The maximum priority for playing sound effects. This constant has a value of 100.

public static final int PRIORITY_MIN - The minimum priority for playing sound effects. This constant has a value of 0.

public static final int VOLUME_MAX - The maximum volume for playing sound effects. This constant has a value of 100.

Image 40
Contents Technical Manual Table of Contents Lcdui JAD Attributes Introduction PurposeAudience DisclaimerReferences Revision History Definitions, Abbreviations, AcronymsDate Name Reason Acronym DescriptionDocument Overview Introduction J2ME Introduction Java 2 Platform, Micro Edition J2MEMotorola J2ME Platform Resources AvailableDescription Display NetworkingFile & RMS Java VMGuide to Development in J2ME Developing and Packaging J2ME ApplicationsIntroduction to Development Page Installation OTA ProcedureDownloading Applications Program and Data space notes Starting Applications Java Application Installer/De-Installer JaidExiting Applications Launching Web Session for Http Download Error ChecksDownloading MIDlets XML Screen Renderings BombMan is back, now on your Taichi series of handsets Taichi handset New Games Application Management MIDlet LifecycleMIDlet Suite Installation MIDlet Suite De-installation MIDlet Suite Updating DestroyAppMethod Caller PurposeStartApp or the pauseApp Using startApp Java System MIDlet Control of MIDlet State TransitionsPage Network API Network ConnectionsClass Descriptions IOException when it detects a time-out condition URL FormatUDP Sockets TCP SocketsImplementation Notes Network API Lcdui DescriptionLcdui Functional Description Gaming API and SoundClass Hierarchy Using BackgroundMusic BackgroundMusic ClassBackgroundMusic Methods Gaming API containing a sound APIGameScreen Class GameScreen FieldsGameScreen Methods Public int getKeyStatesInformation, disabling key events can improve performance Using GameScreen GameScreenImageUtil Fields ImageUtil ClassImageUtil Methods Using ImageUtil RgbDataPalleteImage Constructor PalleteImage ClassPalleteImage Methods Using PalleteImage Public void setTransparentIndexint index throwsUsing Static and Animated Tiles PlayField ClassDefining View Windows Using SpritesPlayField Constructor 2N+1 2N + PlayField Methods Public void addSpriteSprite s throwsPage Public boolean collidesWithAnyTileSprite s throws Using PlayField PlayFieldUsing SoundEffect SoundEffect ClassSprite Class SoundEffect MethodsSprite Drawing Animation FramesSprite Constructor Sprite Methods Page Public final void drawGraphics g throws FileFormatNotSupportedException Using SpriteSprites Java Gaming Sound API Max Midi Extension SupportFileFormatNotSupportedException Constructors Java Gaming Sound APIVibe and Backlight Vibe and Backlight APIOverview Creating a MessageSending a Message PermissionsJAD Attributes JAD AttributesMandatory attributes for manifest files MIDlet-Name Record Management System Class DescriptionCode Examples RecordStoreTips CaveatsPhonebook Access Phonebook Access APIPhonebook Access API Permissions Sample of code to create object of PhoneBookRecord classSimmemory Sample of code for calling of ‘getMaxEmailLength ’ method Sample of code for calling of ‘isPrimaryint speedNo’ method Sample of code for calling of ‘getNumberCategories’ method Sample of code for calling of ‘setCategoryView’ method Sample of code for calling of ‘getUsedRecords’ method Int index = ReceivedRecord.getRecord1 ITAP Intelligent Keypad Text Entry APIAppendix a Key Mapping Key Mapping for the C370, C450, and C550Center Select END Appendix B Memory Management Calculation Available MemoryOnline FAQ Appendix CAppendix D Spec Sheets C370, C450, and C550 Spec SheetsDocumentation Motorola Developer Information ToolsReferences Purchase Motorola Developer Information Tools Motorola, Inc
Related manuals
Manual 110 pages 1.04 Kb