Change the way of stage script
wateret opened this issue · 0 comments
wateret commented
As is:
- The script must have functions like
on_deploy
,end_condition
, ... - The engine calls the lua function by those keywords
To be:
- The script must have only one function
main
- The script must register functions via
game:set_on_deploy
,game:end_condition
, ...
With this way(registration of callbacks), benefits are:
- No need to match any function names between the engine and a script, other than
main
- Easily support optional or multiple callbacks
- For example, user-defined events can be none or many.
This is also a prerequisite for #61.