Re: Some pointers wanted regarding user created content
Posted: Tue Dec 11, 2012 4:40 pm
This seems like a perfect solution for the user side of things for me, how would I implement the workings for an API like that on the other side?Robin wrote:I'd use a combination of callback functions and a few API functions for that (similar to the interface LÖVE exposes). For example:Frohman wrote:Well I was less concerned with how to go about obtaining the scripts, more about how to run them and how to allow them to interact with the game (obtain certain values from the game and also pass back instructions).For instructions, you could run them directly or use a queue to execute the instructions the user code gives back later.Code: Select all
function character.update(dt) -- do stuff if API.getMyCharacterX() > 10 * dt then API.goLeft(10 * dt) end end