站内搜索: 请输入搜索关键词
当前页面: 图书首页 > MIDP Style Guide for the Java 2 Platform, Micro Edition

MIDP Style Guide for the Java 2 Platform, Micro Edition

[ directory ] Previous Section Next Section

Chapter 11. Game Screens, Layers, and Sprites

The game package is new in MIDP 2.0. The package has a game canvas, which extends the capabilities of a canvas in ways that make it more convenient to write games and other applications. It is useful in situations where a consistent level of performance is important. For example, arcade games are good candidates for using the game canvas.

Other reasons that an application developer would use a game canvas instead of a regular canvas are offscreen buffering, key latching, and key suppression. (These are the same features that help the game canvas achieve its performance consistency.)

The recommendations given in Chapter 10 for canvases also apply to game screens. This chapter provides additional recommendations.

Application Developer Responsibilities

MIDP Implementor Responsibilities

  • Drawing the screen

  • Updating the screen as necessary (for example, in response to key presses)

  • Abstract commands for the screen

  • Any text to be used in the ticker of the screen

  • Any text to be used in the title of the screen

  • Game actions

  • Phone keypad keys

  • Touch input (if the device supports it)

  • Providing an offscreen buffer

  • Informing the application of user input (pressing a game action or phone keypad button, or tapping a touch screen)

    [ directory ] Previous Section Next Section