neoboxels/js/event.js
2024-02-28 11:59:54 -05:00

14 lines
No EOL
285 B
JavaScript

/*
Code for handling events.
*/
function GameEvent(type, target, data, canvas) {
this.type = type;
this.data = data;
this.canvas = canvas;
this.target = target;
for (let interaction of target.interactions) {
if (interaction(this)) return this;
}
}