Added red coins

This commit is contained in:
Thomas FORGIONE 2015-05-11 14:37:41 +02:00
parent 687b84f438
commit c0cca33814
15 changed files with 100 additions and 25 deletions

View File

@ -36,7 +36,8 @@ map_Kd 3F485258_c.bmp
newmtl Material.023_1FAAE88D_c.bmp newmtl Material.023_1FAAE88D_c.bmp
Ns 0.000000 Ns 0.000000
Ka 0.000000 0.000000 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 Ks 0.000000 0.000000 0.000000
Ni 1.000000 Ni 1.000000
d 1.000000 d 1.000000
@ -91,7 +92,8 @@ map_Kd 10E99677_c.bmp
newmtl Material.025_12436720_c.bmp newmtl Material.025_12436720_c.bmp
Ns 0.000000 Ns 0.000000
Ka 0.000000 0.000000 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 Ks 0.000000 0.000000 0.000000
Ni 1.000000 Ni 1.000000
d 1.000000 d 1.000000

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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

View File

@ -27,7 +27,7 @@ var ArrowCamera = function(arg1, arg2, arg3, arg4, position, target) {
this.target.add(Tools.mul(direction,20)); 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 = new THREE.Object3D();
this.object3D.add(this.initExtremity()); this.object3D.add(this.initExtremity());
@ -72,7 +72,7 @@ ArrowCamera.prototype.initExtremity = function() {
geometry.computeFaceNormals(); geometry.computeFaceNormals();
var material = new THREE.MeshLambertMaterial({ var material = new THREE.MeshLambertMaterial({
color : 0x00ff00, color : 0x0000ff,
transparent : true, transparent : true,
opacity : 0.5, opacity : 0.5,
side: THREE.FrontSide side: THREE.FrontSide

View File

@ -1,19 +1,7 @@
var Coin = function(x,y,z) { var Coin = function(x,y,z) {
if (Coin.BASIC_MESH !== null) { this.ready = false;
this.mesh = Coin.BASIC_MESH.clone(); this.got = false;
this.mesh.position.x = x; this.init(x,y,z);
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);
}
} }
Coin.prototype.init = function(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.x = x;
this.mesh.position.y = y; this.mesh.position.y = y;
this.mesh.position.z = z; this.mesh.position.z = z;
this.mesh.raycastable = true;
this.ready = true;
} else { } else {
(function(self,x,y,z) { (function(self,x,y,z) {
setTimeout(function() { setTimeout(function() {
@ -36,9 +26,24 @@ Coin.prototype.addToScene = function(scene) {
} }
Coin.prototype.update = function() { 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.BASIC_MESH = null;
Coin._loader = new THREE.OBJLoader(); Coin._loader = new THREE.OBJLoader();

View File

@ -139,6 +139,7 @@ function initBobombScene(scene, collidableObjects, loader, static_path) {
scene.add(object); scene.add(object);
object.traverse(function (object) { object.traverse(function (object) {
if (object instanceof THREE.Mesh) { if (object instanceof THREE.Mesh) {
object.raycastable = true;
object.material.side = THREE.DoubleSide; object.material.side = THREE.DoubleSide;
object.geometry.mergeVertices(); object.geometry.mergeVertices();
object.geometry.computeVertexNormals(); object.geometry.computeVertexNormals();
@ -200,3 +201,40 @@ function createBobombCoins() {
return coins; 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;
}

View File

@ -75,12 +75,12 @@ function init() {
directional_light.castShadow = false; directional_light.castShadow = false;
scene.add(directional_light); scene.add(directional_light);
var ambient_light = new THREE.AmbientLight(0x444444); var ambient_light = new THREE.AmbientLight(0x555555);
scene.add(ambient_light); scene.add(ambient_light);
// Initialize pointer camera // Initialize pointer camera
var camera1 = new PointerCamera(50, container_size.width() / container_size.height(), 0.01, 100000, container); 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.resetBobomb();
camera1.save(); camera1.save();
scene.add(camera1); scene.add(camera1);
@ -90,7 +90,7 @@ function init() {
// Initialize recommendations // 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); cameras = new CameraContainer(camera1, otherCams);
otherCams.forEach(function(cam) { cam.addToScene(scene); }); otherCams.forEach(function(cam) { cam.addToScene(scene); });

View File

@ -41,6 +41,13 @@ CameraSelecter.prototype.pointedCamera = function() {
if (bestIndex !== undefined) { if (bestIndex !== undefined) {
// if (this.cameras.getById(intersects[bestIndex].object.parent.id) !== undefined) { // if (this.cameras.getById(intersects[bestIndex].object.parent.id) !== undefined) {
var obj = intersects[bestIndex].object; 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); return this.cameras.getByObject(intersects[bestIndex].object);
// } // }
} }
@ -55,7 +62,7 @@ CameraSelecter.prototype.update = function(event) {
var hovered = this.pointedCamera(event); var hovered = this.pointedCamera(event);
if (hovered !== undefined) { if (hovered !== undefined && !hovered instanceof Coin) {
this.prev.x = this.mouse.x; this.prev.x = this.mouse.x;
this.prev.y = this.mouse.y; this.prev.y = this.mouse.y;
this.prev.camera = hovered; this.prev.camera = hovered;
@ -67,8 +74,10 @@ CameraSelecter.prototype.update = function(event) {
CameraSelecter.prototype.click = function(event) { CameraSelecter.prototype.click = function(event) {
var newCamera = this.pointedCamera(event); var newCamera = this.pointedCamera(event);
if (newCamera !== undefined) { if (newCamera !== undefined && !newCamera instanceof Coin) {
this.cameras.mainCamera().moveHermite(newCamera); this.cameras.mainCamera().moveHermite(newCamera);
buttonManager.updateElements(); buttonManager.updateElements();
} else if (newCamera instanceof Coin) {
newCamera.get();
} }
} }