added Constants module. fixes #4

This commit is contained in:
logsol 2012-07-15 22:32:44 +02:00
parent f3e186afb1
commit 3c1e7008e5
4 changed files with 29 additions and 13 deletions

View file

@ -1,4 +1,4 @@
define(["Vendor/Box2D"], function(Box2D) {
define(["Vendor/Box2D", "Chuck/Constants"], function(Box2D, Constants) {
function Detector(me) {
this.me = me;
@ -15,7 +15,9 @@ define(["Vendor/Box2D"], function(Box2D) {
}
Detector.prototype.handleStand = function(point, isColliding) {
if (point.GetFixtureA().GetUserData() == 'myFeet' || point.GetFixtureB().GetUserData() == 'myFeet') {
if (point.GetFixtureA().GetUserData() == Constants.COLLISION_IDENTIFIER_FOOTSENSOR
|| point.GetFixtureB().GetUserData() == Constants.COLLISION_IDENTIFIER_FOOTSENSOR) {
this.me.onFootSensorDetection(isColliding);
}
}