fixed bug where trail would remain after user released rave stick

This commit is contained in:
ericrius1 2015-12-17 11:40:06 -08:00
parent 2aaefbcfcb
commit 8d25a666d1
3 changed files with 6 additions and 10 deletions

View file

@ -72,7 +72,6 @@ var lightZone = Entities.addEntity({
}
});
function cleanup() {
Entities.deleteEntity(raveRoom);

View file

@ -44,7 +44,7 @@ LightBall = function(spawnPosition) {
collisionsWillMove: true,
gravity: {
x: 0,
y: -.5,
y: -0.5,
z: 0
},
userData: JSON.stringify({

View file

@ -19,7 +19,7 @@
var MAX_POINTS_PER_LINE = 50;
var MIN_POINT_DISTANCE = 0.02;
var STROKE_WIDTH = 0.05
var ugLSD = 25;
var ugLSD = 35;
var RaveStick = function() {
_this = this;
this.colorPalette = [{
@ -117,8 +117,10 @@
},
releaseGrab: function() {
Script.clearInterval(this.trailEraseInterval);
this.trailEraseInterval = null;
Script.setTimeout(function() {
Script.clearInterval(_this.trailEraseInterval);
_this.trailEraseInterval = null;
}, 3000);
},
preload: function(entityID) {
@ -192,13 +194,8 @@
emitterShouldTrail: false
}
this.beam = Entities.addEntity(props);
// props.emitterShouldTrail = true;
// this.beamTrail = Entities.addEntity(props);
}
};
// entity scripts always need to return a newly constructed object of our type
return new RaveStick();
function computeNormal(p1, p2) {