O'Reilly logo

Micro Java™ Game Development by Roman Verhosek, David Fox

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 17. Sprite Movement

So far, we've managed to create a bunch of sprites and draw them on the screen. But we're not painting a still life here; we're programming a game!

To make a game a game, it must read input events from the keyboard or the screen and move sprites accordingly. The game must also set up initial conditions, check controls for game operability, and provide artificial intelligence for computer-controlled characters or game moves.

Floating-Point in J2ME

Before we get too excited, though, there's one thing we're going to have to get out of the way: MIDP does not support floating-point math.

Why is floating-point math important for games? Imagine ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required