O'Reilly logo

Android NDK Game Development Cookbook by Viktor Latypov, Sergey Kosarevsky

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

Implementing picture puzzle game logic

This recipe you shows how to implement the game logic for a picture puzzle game. The game consists of a set of rectangular tiles shuffled and rendered on the screen. Users can tap on individual tiles, and move them around, swapping them with the other tiles. Let us draft the backbone data structures to implement this logic.

Getting ready

To feel the game logic better, you can build and run the 2_PuzzleProto project, which can be downloaded from www.packtpub.com/support. If you want to enjoy the full-featured game, just go ahead and download our Linderdaum Puzzle HD from Google Play. You can do it at http://play.google.com/store/apps/details?id=com.linderdaum.engine.puzzLHD.

How to do it...

  1. First, we need 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