O'Reilly logo

OpenGL ES 2 for Android by Kevin Brothaler

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

Why Air Hockey?

Air hockey is a simple, popular game often found at bowling alleys and bars. Although simple, it can also be incredibly addictive. Some of the top sellers in Google Play, Android’s app market, are based on one variant or another of this enjoyable game.

As we develop our game of air hockey, we’ll learn quite a few OpenGL concepts along the way. We’ll learn how to define and draw a table to play on, as well as how to add detail with colors, shades, and textures. We’ll also learn how to respond to the user by acting on touch-screen events.

The Rules of the Game

To play a game of air hockey, we need a long rectangular table with two goals (one on each end), a puck, and two mallets to strike the puck with. Each round starts with the ...

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