Driftwood2D / Driftwood

Driftwood 2D Tiling Game Engine and Development Suite
http://tileengine.org/
MIT License
24 stars 1 forks source link

Support multiple on_focus functions per area #132

Closed pmer closed 7 years ago

pmer commented 7 years ago

A map author might want to have a global script that runs on each game area (doing some common post-processing of the map), and then also run a specific one-off script for some areas (running area-specific code).

This can be fixed by any of:

pmer commented 7 years ago

Actually the third way seems cleanest to me. You can then add the handler once you need it without having to edit every map file.

pmer commented 7 years ago

The bonus of the first two though is that you can see all the functions that will get called on an area being loaded by reading it's JSON descriptor. "It's more local" which enhanses readability.

seisatsu commented 7 years ago

I like the idea of a registry of global trigger callbacks.