diff --git a/static/data/bobomb/bobomb battlefeild.mtl b/static/data/bobomb/bobomb battlefeild.mtl index e20dce2..0f9d502 100644 --- a/static/data/bobomb/bobomb battlefeild.mtl +++ b/static/data/bobomb/bobomb battlefeild.mtl @@ -36,7 +36,8 @@ map_Kd 3F485258_c.bmp newmtl Material.023_1FAAE88D_c.bmp Ns 0.000000 Ka 0.000000 0.000000 0.000000 -Kd 0.162500 0.162500 0.162500 +# Kd 0.162500 0.162500 0.162500 +Kd 0.615625 0.615625 0.615625 Ks 0.000000 0.000000 0.000000 Ni 1.000000 d 1.000000 @@ -91,7 +92,8 @@ map_Kd 10E99677_c.bmp newmtl Material.025_12436720_c.bmp Ns 0.000000 Ka 0.000000 0.000000 0.000000 -Kd 0.159375 0.159375 0.159375 +# Kd 0.159375 0.159375 0.159375 +Kd 0.615625 0.615625 0.615625 Ks 0.000000 0.000000 0.000000 Ni 1.000000 d 1.000000 diff --git a/static/data/music/redcoins/1.mp3 b/static/data/music/redcoins/1.mp3 new file mode 100644 index 0000000..058655d Binary files /dev/null and b/static/data/music/redcoins/1.mp3 differ diff --git a/static/data/music/redcoins/2.mp3 b/static/data/music/redcoins/2.mp3 new file mode 100644 index 0000000..c61806b Binary files /dev/null and b/static/data/music/redcoins/2.mp3 differ diff --git a/static/data/music/redcoins/3.mp3 b/static/data/music/redcoins/3.mp3 new file mode 100644 index 0000000..a2945f4 Binary files /dev/null and b/static/data/music/redcoins/3.mp3 differ diff --git a/static/data/music/redcoins/4.mp3 b/static/data/music/redcoins/4.mp3 new file mode 100644 index 0000000..8122d85 Binary files /dev/null and b/static/data/music/redcoins/4.mp3 differ diff --git a/static/data/music/redcoins/5.mp3 b/static/data/music/redcoins/5.mp3 new file mode 100644 index 0000000..bb161e5 Binary files /dev/null and b/static/data/music/redcoins/5.mp3 differ diff --git a/static/data/music/redcoins/6.mp3 b/static/data/music/redcoins/6.mp3 new file mode 100644 index 0000000..19ec5b1 Binary files /dev/null and b/static/data/music/redcoins/6.mp3 differ diff --git a/static/data/music/redcoins/7.mp3 b/static/data/music/redcoins/7.mp3 new file mode 100644 index 0000000..9cce86d Binary files /dev/null and b/static/data/music/redcoins/7.mp3 differ diff --git a/static/data/music/redcoins/8.mp3 b/static/data/music/redcoins/8.mp3 new file mode 100644 index 0000000..0ec623b Binary files /dev/null and b/static/data/music/redcoins/8.mp3 differ diff --git a/static/data/music/redcoins/Read this file please.text b/static/data/music/redcoins/Read this file please.text new file mode 100644 index 0000000..0dc59f0 --- /dev/null +++ b/static/data/music/redcoins/Read this file please.text @@ -0,0 +1,21 @@ +Super Mario 64 Red Coin Sound Effects (Low Quality) + +Recorded by nocturnal YL (formerly known as YoungLink) using Project 64 1.6 + + + +I searched around the internet for these sound effects, but I couldn't find any. + +I ended up having to record the sound from Project 64 (Lethal Lava Land makes this task very easy) and edit those sound with Adobe Soundbooth (very handy for Flash users like me). I am completely new to audio editing, so the audio quality here is far from perfect. + + +Please give credit when used. Best if you personally notify me, but it's not required. + +MFGG = YoungLink + +dA = younglink19 + +Astra = YoungLink + +FEDA = nocturnal YL + diff --git a/static/js/prototype/ArrowCamera.js b/static/js/prototype/ArrowCamera.js index 7245788..13e4a4e 100644 --- a/static/js/prototype/ArrowCamera.js +++ b/static/js/prototype/ArrowCamera.js @@ -27,7 +27,7 @@ var ArrowCamera = function(arg1, arg2, arg3, arg4, position, target) { this.target.add(Tools.mul(direction,20)); - this.arrow = new THREE.Mesh(new THREE.Geometry(), new THREE.MeshLambertMaterial({color: 0x00ff00, side:THREE.BackSide})); + this.arrow = new THREE.Mesh(new THREE.Geometry(), new THREE.MeshLambertMaterial({color: 0x0000ff, side:THREE.BackSide})); this.object3D = new THREE.Object3D(); this.object3D.add(this.initExtremity()); @@ -72,7 +72,7 @@ ArrowCamera.prototype.initExtremity = function() { geometry.computeFaceNormals(); var material = new THREE.MeshLambertMaterial({ - color : 0x00ff00, + color : 0x0000ff, transparent : true, opacity : 0.5, side: THREE.FrontSide diff --git a/static/js/prototype/Coin.js b/static/js/prototype/Coin.js index d3267cc..6a12cb7 100644 --- a/static/js/prototype/Coin.js +++ b/static/js/prototype/Coin.js @@ -1,19 +1,7 @@ var Coin = function(x,y,z) { - if (Coin.BASIC_MESH !== null) { - this.mesh = Coin.BASIC_MESH.clone(); - this.mesh.position.x = x; - this.mesh.position.y = y; - this.mesh.position.z = z; - } else { - (function(self) { - setTimeout(function() { - self.mesh = Coin.BASIC_MESH.clone(); - self.mesh.position.x = x; - self.mesh.position.y = y; - self.mesh.position.z = z; - },1000); - })(this); - } + this.ready = false; + this.got = false; + this.init(x,y,z); } Coin.prototype.init = function(x,y,z) { @@ -22,6 +10,8 @@ Coin.prototype.init = function(x,y,z) { this.mesh.position.x = x; this.mesh.position.y = y; this.mesh.position.z = z; + this.mesh.raycastable = true; + this.ready = true; } else { (function(self,x,y,z) { setTimeout(function() { @@ -36,9 +26,24 @@ Coin.prototype.addToScene = function(scene) { } Coin.prototype.update = function() { - this.mesh.rotation.y += 0.1; + if (this.ready) + (function(self) { + self.update = function() { + self.mesh.rotation.y += 0.1; + } + })(this); } +Coin.prototype.get = function() { + this.got = true; + this.mesh.visible = false; + Coin.total ++; + var sound = new Audio('/static/data/music/redcoins/' + Coin.total + '.mp3'); + sound.play(); + console.log(sound) +} + +Coin.total = 0; Coin.BASIC_MESH = null; Coin._loader = new THREE.OBJLoader(); diff --git a/static/js/prototype/initScene.js b/static/js/prototype/initScene.js index 6a51ecf..8efce0a 100644 --- a/static/js/prototype/initScene.js +++ b/static/js/prototype/initScene.js @@ -139,6 +139,7 @@ function initBobombScene(scene, collidableObjects, loader, static_path) { scene.add(object); object.traverse(function (object) { if (object instanceof THREE.Mesh) { + object.raycastable = true; object.material.side = THREE.DoubleSide; object.geometry.mergeVertices(); object.geometry.computeVertexNormals(); @@ -200,3 +201,40 @@ function createBobombCoins() { return coins; } + +function createBobombCameras(width, height) { + var cams = []; + + var createCamera = function(position, target) { + return new RecommendedCamera( + 50, + width / height, + 1, + 100000, + position, + target + ); + } + + cams.push( + createCamera( + new THREE.Vector3(-24.10987782946019,26.75997424452833,-24.7814217620827), + new THREE.Vector3(-13.724964120740987,14.939165978074758,11.993869660150779) + ), + createCamera( + new THREE.Vector3(-13.484471970922971,20.25938194278451,-30.850247430073622), + new THREE.Vector3(-42.04654352929252,-7.608886431102082,-28.099304657929874) + ), + createCamera( + new THREE.Vector3(23.58849177613168,18.628351213754488,31.516769692916675), + new THREE.Vector3(8.319765065757787,-0.5486703304136178,-0.09189730426033549) + ) + // createCamera( + // new THREE.Vector3(28.438969076366728,18.888756501203087,26.694456000440766), + // new THREE.Vector3(-5.369166248035665,2.54925886583683,12.909289954623416) + // ) + ); + + return cams; + +} diff --git a/static/js/prototype/main.js b/static/js/prototype/main.js index 271ba25..04aef86 100644 --- a/static/js/prototype/main.js +++ b/static/js/prototype/main.js @@ -75,12 +75,12 @@ function init() { directional_light.castShadow = false; scene.add(directional_light); - var ambient_light = new THREE.AmbientLight(0x444444); + var ambient_light = new THREE.AmbientLight(0x555555); scene.add(ambient_light); // Initialize pointer camera var camera1 = new PointerCamera(50, container_size.width() / container_size.height(), 0.01, 100000, container); - camera1.speed = 0.001; + camera1.speed = 0.005; camera1.resetBobomb(); camera1.save(); scene.add(camera1); @@ -90,7 +90,7 @@ function init() { // Initialize recommendations - var otherCams = createPeachCameras(container_size.width(), container_size.height()); + var otherCams = createBobombCameras(container_size.width(), container_size.height()); cameras = new CameraContainer(camera1, otherCams); otherCams.forEach(function(cam) { cam.addToScene(scene); }); diff --git a/static/js/prototype/raycasterTools.js b/static/js/prototype/raycasterTools.js index 7de8a31..ba2d2da 100644 --- a/static/js/prototype/raycasterTools.js +++ b/static/js/prototype/raycasterTools.js @@ -41,6 +41,13 @@ CameraSelecter.prototype.pointedCamera = function() { if (bestIndex !== undefined) { // if (this.cameras.getById(intersects[bestIndex].object.parent.id) !== undefined) { var obj = intersects[bestIndex].object; + + for (var coin in coins) { + if (obj === coins[coin].mesh) { + return coins[coin]; + } + } + return this.cameras.getByObject(intersects[bestIndex].object); // } } @@ -55,7 +62,7 @@ CameraSelecter.prototype.update = function(event) { var hovered = this.pointedCamera(event); - if (hovered !== undefined) { + if (hovered !== undefined && !hovered instanceof Coin) { this.prev.x = this.mouse.x; this.prev.y = this.mouse.y; this.prev.camera = hovered; @@ -67,8 +74,10 @@ CameraSelecter.prototype.update = function(event) { CameraSelecter.prototype.click = function(event) { var newCamera = this.pointedCamera(event); - if (newCamera !== undefined) { + if (newCamera !== undefined && !newCamera instanceof Coin) { this.cameras.mainCamera().moveHermite(newCamera); buttonManager.updateElements(); + } else if (newCamera instanceof Coin) { + newCamera.get(); } }