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() { function cleanup() {
Entities.deleteEntity(raveRoom); Entities.deleteEntity(raveRoom);

View file

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

View file

@ -19,7 +19,7 @@
var MAX_POINTS_PER_LINE = 50; var MAX_POINTS_PER_LINE = 50;
var MIN_POINT_DISTANCE = 0.02; var MIN_POINT_DISTANCE = 0.02;
var STROKE_WIDTH = 0.05 var STROKE_WIDTH = 0.05
var ugLSD = 25; var ugLSD = 35;
var RaveStick = function() { var RaveStick = function() {
_this = this; _this = this;
this.colorPalette = [{ this.colorPalette = [{
@ -117,8 +117,10 @@
}, },
releaseGrab: function() { releaseGrab: function() {
Script.clearInterval(this.trailEraseInterval); Script.setTimeout(function() {
this.trailEraseInterval = null; Script.clearInterval(_this.trailEraseInterval);
_this.trailEraseInterval = null;
}, 3000);
}, },
preload: function(entityID) { preload: function(entityID) {
@ -192,13 +194,8 @@
emitterShouldTrail: false emitterShouldTrail: false
} }
this.beam = Entities.addEntity(props); 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(); return new RaveStick();
function computeNormal(p1, p2) { function computeNormal(p1, p2) {