There are two ways to handle user input in Moai - by polling or registering callback functions. I'm going to focus on polling for now, since that is what I am using. Moai provides some ways to check for input through the MOAIInputMgr.device and it's properties. Depending on your device/host, there will be different properties … Continue Reading ››
We have a bunch of scene definitions now, but how do we keep track of them and transition between them? A solution is the SceneManager class, which maintains a stack of Scenes and handles adding/removing/updating them. Here's what the stack might look like, with each layer being a Scene:
Continue Reading ››
Now that we have a lot of the basic pieces in place to make a simple game, we need to think about how to keep track of game state. For example, how do you know to start with a start menu? How can you transition to the actual gameplay? What if user wants to pause … Continue Reading ››
Remember in Moai, you think of graphics resources in terms of Decks and Props. Decks are the actual definition of the resource - the vertex locations, texture data, etc. A Prop is a reference to a Deck and any information used to actually draw an instance of it - the actual location or any other … Continue Reading ››
After playing around with Box2D, I tried to make a simple platformer. After setting up a static body to represent the ground, and a dynamic box to represent the character, I ran into a problem - how do you know whether your character can jump? Essentially you need to know whether he is standing on … Continue Reading ››