repo: janusweb action: commit revision: path_from: revision_from: 096a458ea82bacc4eb6c7f168d03a9aa90a3f7d0: path_to: revision_to:
commit 096a458ea82bacc4eb6c7f168d03a9aa90a3f7d0 Author: James BaicoianuDate: Fri Jan 10 22:46:35 2020 -0800 Throw separate events for collisions vs triggers diff --git a/scripts/janusbase.js b/scripts/janusbase.js
--- a/scripts/janusbase.js
+++ b/scripts/janusbase.js
@@ -712,14 +712,16 @@ elation.require(['engine.things.generic', 'utils.template', 'janusweb.parts'], f
if (other.getProxyObject) {
var proxy = other.getProxyObject();
//console.log('I collided', proxy, this);
- elation.events.fire({type: 'collision', element: this, data: proxy});
if (this.collision_trigger || proxy.collision_trigger) {
+ this.dispatchEvent({type: 'trigger', data: { collision: ev.data, other: proxy }});
ev.preventDefault();
ev.stopPropagation();
+ } else {
+ this.dispatchEvent({type: 'collision', data: { collision: ev.data, other: proxy }});
}
} else {
-console.error('dunno what this is', other);
+ console.error('Collided with unknown object', this, other);
}
}
}
-----END OF PAGE-----