O'Reilly logo

Developing Mobile Games with Moai SDK by Francisco Tufro

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 3. Basic Moai SDK Concepts

Every game engine has its own concepts behind it that define its internal workings. In this chapter, we will take a quick tour of the different ideas that Moai SDK uses, in order to understand it better.

The Moai SDK Runtime

Moai's Runtime uses two important data structures, namely, a dependency graph of objects/nodes and a tree of actions. What you'll (mostly) do as a developer is modify those data structures (in Lua, using the Moai SDK API).

The Moai update loop has three steps:

  • Process the Input Queue
  • Process the Action Tree
  • Process the Node Graph

In Moai, rendering is detached from the game loop, since we might want to have more than one update step for every rendered frame.

Input Queue

When you press a key, move ...

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