by Spittie · 14y ago · 0 comments
[1] http://www.kickstarter.com/projects/inxile/wasteland-2/posts...
Each graphical element (a "prop" in Moai parlance), when moved, rotated or scaled, defines its own coordinate system, and other props can be added as children and share some or all of the new coordinates. It makes it very easy to compose elements. People familiar with 3D graphics would know this as affine transforms and UV coordinates.
For example, you can tie the position and scale of a text label to a sprite, but not its rotation, and tie the scale, rotation and position of the sprite to the background. You can then zoom everyting in one command, rotate the wole game world or and keep the label next to the sprite and rotate the whole scene or the sprite relative to the map while leaving the label straight. You don't have to track the relative angles, the engine does it for you.
Similarly, every object whose properties depends on time ("actions") can be attached or detached not only to the root action (which provide a tick each frame) but to other actions as well. When you detach an item, its descendants are also paused. Actions include animations, coroutines, physiscs worlds, you name it...
Both trees are defined declaratively in Lua, and implemented in C++, giving the best of both worlds: expressivity and speed.
Moai's biggest flaw at the moment is the sparse documentation, and we're tackling it. Right now, the main focus of the dev team is the cloud offering (which is our revenue source, after all), so it does not proceed as fast as we would like, but come back in a few weeks and you should see a vastly improved documentation.