ONE popular category of Java ME applications is games. Even when faster data networks make other types of applications more popular, games will always be an important part of the Java ME ecosystem.
MIDP has a Game API designed to help you create 2D action or board games. It has a souped-up canvas and supports building a screen using multiple layers. The entire API consists of five classes in the
Suppose you write a typical game using
Canvas. You do your own drawing in
paint() and respond to key events in the event callback methods. You have a separate thread that updates the game’s state and requests screen updates using
repaint(). It looks something ...