Book Image

Learning Game AI Programming with Lua

By : David Young
Book Image

Learning Game AI Programming with Lua

By: David Young

Overview of this book

Table of Contents (16 chapters)
Learning Game AI Programming with Lua
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
Getting Started with AI Sandbox
Index

Updating animation state machines


Now that we've created both the soldier and weapon ASMs, we need to add an update call within the sandbox update loop. This allows for both ASMs to update whatever animations they are playing:

Sandbox.lua:

function Sandbox_Update(sandbox, deltaTimeInMillis)
    soliderAsm:Update(
        deltaTimeInMillis, Sandbox.GetTimeInMillis(sandbox));
    weaponAsm:Update(
        deltaTimeInMillis, Sandbox.GetTimeInMillis(sandbox));
end