Ok, so I just started a project in Defold.
All good and dandy(as a Web Dev I thought it would be a breeze to work with a Lua based game engine - I was wrong),
the engine works great, but I have some questions:
First of all I’m working on a grid based tower defense game, using jumper for the pathfinding.
How the event structure should look for the “unit movement”?
right now I’m calculating the path at init and using go.animate with a callback to a function that executes another go.animate for the same game object with different duration and delay. So they are all queued and executed in order. Is there a better way of doing this?
Does anybody have some resources about factories? I can’t find any. (I was expecting this because of the low, let’s say “popularity” of the engine). I don’t really understand what they do and how to use them.
Is there any way of creating plugins or extensions. I would be interested in integrating some JS to Lua transpiler of some sort.
Thanks for the awesome engine, I’m enjoying it more than I did Unity .
Welcome to Defold! Let me try and answer your question the best I can and maybe others can also assist:
How the event structure should look for the “unit movement”?
This is a very broad question with many answers. You mentioned a tower defense game. Are the units moving along a straight line, pre-defined path, a dynamic path using pathfinding? If it’s a straight line the go.animate() is your best choice. If it’s along a pre-defined path, then you can either use go.animate() between each point in the path or move programmatically in update(). If it’s a dynamic path based on path finding and reevaluated several times then you can use either go-animate() or update()
It depends on the kind of extensions you wish to create. You can write extensions in Lua. We are working on a extension system for C code. We might also add support for LuaJIT FFI extensions.
Thanks for the tips but still can’t get factories to work.
In the editor I click the browse prototype button ("…") and nothing shows up. My guess is I should select a game object but nothing shows up there.