top | item 45864200

(no title)

levzettelin | 3 months ago

I'm probably not gonna do it, but just out of interest: What is the syntax?

discuss

order

Razengan|3 months ago

I'll start a brainstorming/drafting repo once I'm confident in deciding what I want.

Stating my sources of inspiration will win some people and turn off some people: In terms of syntax, Godot's GDScript comes closest to my ideal. In terms of features, Swift.

One thing I really want to try: instead of "functions" I want it to be "event handlers", so instead of

    func doSomething()
you'd say

    on doSomething()
A class instance could "contain" or "own" another class instance at runtime, similar to Godot's node-based hierarchy, and sending the `update()` event/signal to an instance could propagate it down the tree, making it easy to implement an entity+components architecture.

and you could overload handlers based on which type raised the event or emitted the signal:

    on doSomething() by PlayerClass
`caller` would be a keyword/object just like `self` is, in every handler scope so you could see `if caller is Player` or Monster for example.

Most relevant in terms of gameplay, I want `Stat` to be a core type: a number that has a maximum and minimum, and conditional buffs/debuffs affecting the final value, and so on.

levzettelin|3 months ago

Hmm, interesting! Sounds a bit like a DSL for ECS with tight integration of event handling.