diff --git a/unpublishedScripts/DomainContent/Home/dressingRoom/transformer.js b/unpublishedScripts/DomainContent/Home/dressingRoom/transformer.js index 251d56f38c..435f96ab20 100644 --- a/unpublishedScripts/DomainContent/Home/dressingRoom/transformer.js +++ b/unpublishedScripts/DomainContent/Home/dressingRoom/transformer.js @@ -28,16 +28,7 @@ var otherProps = Entities.getEntityProperties(otherID); if (otherProps.name === "hifi-home-dressing-room-transformer-collider" && _this.locked === false) { - var myProps = Entities.getEntityProperties(myID); - var distance = Vec3.distance(myProps.position, otherProps.position); - if (distance < TRIGGER_DISTANCE) { - print('transformer should do magic!!!') - // this.playTransformationSound(collisionInfo.contactPoint); - // this.createTransformationParticles(); - _this.findRotatorBlock(); - } else { - return; - } + _this.findRotatorBlock(); this.locked = true; } else { @@ -75,11 +66,19 @@ removeCurrentBigVersion: function(rotatorBlock) { print('transformer should remove big version') + var blacklistKey = 'Hifi-Hand-RayPick-Blacklist'; + + var myProps = Entities.getEntityProperties(_this.entityID); var results = Entities.findEntities(myProps.position, 10); results.forEach(function(result) { var resultProps = Entities.getEntityProperties(result); if (resultProps.name === "hifi-home-dressing-room-big-transformer") { + Messages.sendMessage(blacklistKey, JSON.stringify({ + action: 'remove', + id: result + })); + Entities.deleteEntity(result); } }); @@ -89,6 +88,7 @@ }, createBigVersion: function(smallProps) { + print('transformer should create big version!!') print('transformer has rotatorBlock??' + _this.rotatorBlock); var rotatorProps = Entities.getEntityProperties(_this.rotatorBlock); @@ -110,12 +110,26 @@ } var bigVersion = Entities.addEntity(bigVersionProps); - print('transformer created big version: ' + bigVersion) + print('transformer created big version: ' + bigVersion); + + var blacklistKey = 'Hifi-Hand-RayPick-Blacklist'; + Messages.sendMessage(blacklistKey, JSON.stringify({ + action: 'add', + id: bigVersion + })); + _this.putNewVersionOnShelf(); }, putTransformerOnRotatorBlock: function(blockPosition) { print('transformer should get set on rotator block') + + blockPosition.y = blockPosition.y + 1; + // var newPosition = { + // x:blockPosition.x, + // y:blockPosition.y+1, + // z:blockPosition + // }; return blockPosition }, diff --git a/unpublishedScripts/DomainContent/Home/dressingRoom/wrapper.js b/unpublishedScripts/DomainContent/Home/dressingRoom/wrapper.js index 5f3d2c8ae7..8d24b4a668 100644 --- a/unpublishedScripts/DomainContent/Home/dressingRoom/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/dressingRoom/wrapper.js @@ -20,6 +20,7 @@ }, visible: true, damping: 0.8, + angularDamping:0.8, userData: JSON.stringify({ 'grabbableKey': { 'grabbable': true @@ -32,6 +33,7 @@ 'reset': true } }), + density:5000, dimensions: dimensions, script: TRANSFORMER_SCRIPT } diff --git a/unpublishedScripts/DomainContent/Home/tiltMaze/maze.js b/unpublishedScripts/DomainContent/Home/tiltMaze/maze.js index 776fa94400..5b0d7dbe44 100644 --- a/unpublishedScripts/DomainContent/Home/tiltMaze/maze.js +++ b/unpublishedScripts/DomainContent/Home/tiltMaze/maze.js @@ -64,6 +64,7 @@ preload: function(entityID) { this.entityID = entityID; VICTORY_SOUND = SoundCache.getSound("http://hifi-content.s3.amazonaws.com/DomainContent/Home/tiltMaze/levelUp.wav"); + Script.update.connect(this.update); }, startNearGrab: function() { //check to make sure a ball is in range, otherwise create one @@ -165,6 +166,7 @@ var ballSpawnerPosition = Entities.getEntityProperties(data.tiltMaze.ballSpawner, 'position').position; var separation = Vec3.distance(ballPosition, ballSpawnerPosition); + print('ball separation: ' + separation) if (separation > BALL_DISTANCE_THRESHOLD) { this.destroyBall(); this.createBall(); @@ -226,9 +228,13 @@ } else { return; } - } + } + print('in update loop for maze, look for balls to clear') - this.testBallDistance() + _this.testBallDistance() + }, + unload:function(){ + Script.update.disconnect(this.update); } };