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 the complete picture-puzzle game

Finally, we have all the parts at hand, and can combine them together into a puzzle game application.

Getting ready

Build and run the example 5_Puzzle from the supplementary materials. This example, like others in this book, runs on Android as well as on Windows.

How to do it…

  1. We start by augmenting our 3_UIPrototype project with a new page, clPage_Gallery. This page delegates rendering and updating to the global g_Flow object:
    class clPage_Gallery: public clGUIPage
    {
    public:
      …
      virtual void Render()
      {
        RenderDirect( g_Flow );
      }
      virtual void Update(float DT)
      {
        g_Flow->FFlinger->Update(DT);
      }
    private:
      void RenderDirect( clPtr<clFlowUI> Control );
    };
  2. The RenderDirect() method is essentially a slightly modified ...

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