init
This commit is contained in:
commit
6b926e53bf
19 changed files with 1365 additions and 0 deletions
14
js/event.js
Normal file
14
js/event.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue