repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 096a458ea82bacc4eb6c7f168d03a9aa90a3f7d0:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 096a458ea82bacc4eb6c7f168d03a9aa90a3f7d0
Author: James Baicoianu 
Date:   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
index 1859bc9f4d174b27262b1cd4962f44e11afeea60..
index ..5875e1352093bd45bc9a989973e133f0305aaf94 100644
--- 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-----