var time = 0; var realTime = 0; var blockSize = 1.0; var gridSize = 10; var width = (blockSize*gridSize); var position = Vec3.sum(Vec3.sum(MyAvatar.position,{x:0,y:-1,z:0}), Vec3.multiply(Quat.getFront(MyAvatar.orientation),width+0)); var colorList = [{red: 255, green: 0, blue: 0},{red: 0, green: 255, blue: 0},{red: 0, green: 0, blue: 255}, {red: 255, green: 255, blue: 0},{red: 255, green: 0, blue: 255},{red: 0, green: 255, blue: 255}] var colorScheme = 0; //Make base var properties = { type: "Box", name: "Dancefloor_base", position: position, color: { red: 0, green: 0, blue: 0}, collisionless: false, grab: { grabbable: false }, localDimensions: {x:width+blockSize,y:0.25,z:width+blockSize} }; base = Entities.addEntity(properties); var tx = position.x; var tz = position.z; //spagonfetti particles properties = { type: "ParticleEffect", name: "Dancefloor_confetti", grab: { grabbable: false }, position: Vec3.sum(position,{x:0,y:7,z:0}), textures: "https://hifi-content.s3.amazonaws.com/andrewh/Dancefloor_app/confetti.png", maxParticles: 10000, lifespan: 10, emitRate: 50, emitSpeed: 0, speedSpread: 0, emitOrientation: { x: -0.0000152587890625, y: -0.0000152587890625, z: -0.0000152587890625, w: 1 }, emitDimensions: { x: 10, y: 0, z: 10 }, polarFinish: 3.1415927410125732, emitAcceleration: { x: 0, y: -0.20000000298023224, z: 0 }, accelerationSpread: { x: 0, y: 0.20000000298023224, z: 0 }, particleRadius: 0.10000000149011612, radiusStart: 0.10000000149011612, radiusFinish: 0.10000000149011612, colorSpread: { red: 255, green: 255, blue: 255 }, colorStart: { red: 255, green: 255, blue: 255 }, colorFinish: { red: null, green: null, blue: null }, alphaStart: 0, alphaFinish: 1, emitterShouldTrail: false, particleSpin: 0.3490658402442932, spinSpread: 6.2831854820251465, spinStart: 0, spinFinish: 0.6981316804885864, parentID: base }; var confetti = Entities.addEntity(properties); properties = { type: "ParticleEffect", name: "Dancefloor_confetti_floor", grab: { grabbable: false }, position: Vec3.sum(position,{x:0,y:0.42,z:0}), textures: "https://hifi-content.s3.amazonaws.com/andrewh/Dancefloor_app/confetti.png", maxParticles: 10000, lifespan: 5, emitRate: 0, emitSpeed: 0, speedSpread: 0, emitOrientation: { x: -0.0000152587890625, y: -0.0000152587890625, z: -0.0000152587890625, w: 1 }, emitDimensions: { x: 10, y: 0, z: 10 }, polarFinish: 3.1415927410125732, emitAcceleration: { x: 0, y: 0, z: 0 }, accelerationSpread: { x: 0, y: 0, z: 0 }, particleRadius: 0.10000000149011612, radiusStart: 0.10000000149011612, radiusFinish: 0.10000000149011612, colorSpread: { red: 255, green: 255, blue: 255 }, colorStart: { red: 255, green: 255, blue: 255 }, colorFinish: { red: null, green: null, blue: null }, alphaStart: 0, alphaFinish: 1, emitterShouldTrail: false, spinSpread: 6.2831854820251465, spinStart: 0, spinFinish: 0, parentID: base }; var confettiFloor = Entities.addEntity(properties); //light rotators properties = { type: "Sphere", name: "Dancefloor_lightmover_1", position: Vec3.sum(position,{ x: 1.5937108993530273, y: 0.2123088836669922, z: 0 }), grab: { grabbable: false }, angularVelocity: { x: 0, y: -0.6, z: 0 }, angularDamping: 0, collisionless: true, ignoreForCollisions: true, parentID: base } var light_rotator1 = Entities.addEntity(properties); properties = { type: "Sphere", name: "Dancefloor_lightmover_2", position: Vec3.sum(position,{ x: 0, y: 0, z: 0.29303932189941406 }), grab: { grabbable: false }, angularVelocity: { x: 0, y: 1.0, z: 0 }, angularDamping: 0, collisionless: true, ignoreForCollisions: true, parentID: base } var light_rotator2 = Entities.addEntity(properties); //lights properties = { type: "Light", name: "Dacefloor_light_1", position: Vec3.sum(position,{ x: -2.5197582244873047, y: 0.5514755249023438, z: -0.6430681347846985 }), dimensions: { x: 5.1181488037109375, y: 5.1181488037109375, z: 5.1181488037109375 }, grab: { grabbable: false }, color: { red: 0, green: 0, blue: 255 }, intensity: 75, exponent: 1, cutoff: 90, falloffRadius: 100, parentID: light_rotator1 } var light1 = Entities.addEntity(properties); properties = { type: "Light", name: "Dancefloor_light_2", position: Vec3.sum(position,{ x: 1.535553216934204, y: 0.5515842437744141, z: 2.098341941833496 }), dimensions: { x: 5.1181488037109375, y: 5.1181488037109375, z: 5.1181488037109375 }, grab: { grabbable: false }, color: { red: 255, green: 0, blue: 0 }, intensity: 75, exponent: 1, cutoff: 90, falloffRadius: 100, parentID: light_rotator2 } var light2 = Entities.addEntity(properties); //calzone properties = { type: "Zone", name: "Dancefloor_zone", position: position, dimensions: { x: 12, y: 12, z: 12 }, grab: { grabbable: false }, shapeType: "box", keyLight: { intensity: 2.0, color: { red: 255, green: 0, blue: 0 }, direction: { x: 0, y: -0.7071067690849304, z: 0.7071067690849304 }, castShadows: false }, bloom: { bloomIntensity: 1, bloomThreshold: 0.20000000298023224, bloomSize: 1 }, keyLightMode: "enabled", bloomMode: "enabled", parentID: base } var partyZone = Entities.addEntity(properties); //add tiles var tiles = []; for(var i=0;i 3){ colorScheme = 0; } // swap to white solid tiles for pastel color scheme if (colorScheme == 3){ for(var i=0;i 6 && floorStarted.emitRate == 0){ //delay floor confetti to maintain the Great Illusion Entities.editEntity(confettiFloor,{emitRate:50}); } } function cleanup() { Entities.deleteEntity(base); } Script.scriptEnding.connect(cleanup);