java - Adding a Scripting Language to my Game Engine. Need help identifying a Design Pattern for passing execution between Engine and Script -
i've decided utilize lua script combat abilities java based game engine. need pass game thread execution , forth between lua , game engine, retaining state of ability script.
the way hope accomplish have sort of "lock" object on java side. when starting ability script, "key" passed parameter. lock "key" start locked. when ability script ready pass execution game engine thread until next game cycle, calls java method , passes "key" "unlock". java game thread waiting until "locks" unlocked, , go on on until next game cycle, it'd set locks of active ability scripts, run through list of ability scripts waiting, , "return", resuming execution of script. rinse , repeat until ability has finished.
i'm sure there's design pattern handles improve , takes business relationship situations haven't thought of yet. can point me in right direction?
java design-patterns game-engine
No comments:
Post a Comment