Open rosshadden opened 9 years ago
I figure it's going to be extremely common to be all:
events: { use: function(entity) { if (entity.id === 'player') { ... } } }
So instead of having to worry about stuff like that, let's make the event system more powerful. I want it to support a css-ish seletor syntax, and essentially translate it to the above.
An example of some things I want to support:
events: { 'use#player': function(entity) { ... }, 'enter.enemy': function(entity) { ... }, 'leave.enemy[health<=50]': function(entity) { ... }, 'enter.item, enter[health], enter#player': function(entity) { ... } }
I figure it's going to be extremely common to be all:
So instead of having to worry about stuff like that, let's make the event system more powerful. I want it to support a css-ish seletor syntax, and essentially translate it to the above.
An example of some things I want to support: