by eastoeast · 1y ago · 0 comments
It was messy. I ended up having NPC, Item, Attack classes and for each a NPC Manager, Item Manager, and Attack Manager to calculate all their interactions and states.
That's why your project seems interesting because it seems to handle the heavy lifting of behaviors and "behind the scenes".
Is the ID computed based on the shape of the expression at runtime or on something else?
Great documentation, by the by!
for i in RangeInclusive(1, 10) { TextSprite(i) }
Yes, you found the right place in the documentation. Thanks, yes I worked very hard on the documentation!
I've actually gone with a 100% declarative approach. Basically you define effects, which are executed in response to certain interactions. There's a comprehensive targeting system. But the best part is this is all type-safe using TypeScript, the declarative structure is enforced. That means even when you chain effects, nested effects are able to access (incl. autocomplete) the targets of parent effects etc. Whilst this provides a super nice experience to consume, it's definitely non-trivial to build this system.