14 lines
No EOL
285 B
JavaScript
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;
|
|
}
|
|
} |