mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 05:58:35 +02:00
rats deleting on hit
This commit is contained in:
parent
90ef96746f
commit
cb524d540d
1 changed files with 10 additions and 4 deletions
|
@ -16,6 +16,9 @@
|
||||||
Script.include("../../libraries/utils.js");
|
Script.include("../../libraries/utils.js");
|
||||||
Script.include("../../libraries/constants.js");
|
Script.include("../../libraries/constants.js");
|
||||||
|
|
||||||
|
var GUN_FORCE = 10;
|
||||||
|
|
||||||
|
|
||||||
var gameName = "Kill All The Rats!"
|
var gameName = "Kill All The Rats!"
|
||||||
// var HOST = "localhost:5000"
|
// var HOST = "localhost:5000"
|
||||||
var HOST = "desolate-bastion-1742.herokuapp.com";
|
var HOST = "desolate-bastion-1742.herokuapp.com";
|
||||||
|
@ -37,7 +40,6 @@ HIFI_PUBLIC_BUCKET = "http://s3.amazonaws.com/hifi-public/";
|
||||||
var fireSound = SoundCache.getSound("https://s3.amazonaws.com/hifi-public/sounds/Guns/GUN-SHOT2.raw");
|
var fireSound = SoundCache.getSound("https://s3.amazonaws.com/hifi-public/sounds/Guns/GUN-SHOT2.raw");
|
||||||
var LASER_LENGTH = 100;
|
var LASER_LENGTH = 100;
|
||||||
var LASER_WIDTH = 2;
|
var LASER_WIDTH = 2;
|
||||||
var GUN_FORCE = 10;
|
|
||||||
var POSE_CONTROLS = [Controller.Standard.LeftHand, Controller.Standard.RightHand];
|
var POSE_CONTROLS = [Controller.Standard.LeftHand, Controller.Standard.RightHand];
|
||||||
var TRIGGER_CONTROLS = [Controller.Standard.LT, Controller.Standard.RT];
|
var TRIGGER_CONTROLS = [Controller.Standard.LT, Controller.Standard.RT];
|
||||||
var MIN_THROWER_DELAY = 1000;
|
var MIN_THROWER_DELAY = 1000;
|
||||||
|
@ -57,12 +59,15 @@ var GUN_OFFSETS = [{
|
||||||
|
|
||||||
var GUN_ORIENTATIONS = [Quat.fromPitchYawRollDegrees(0, 90, 90), Quat.fromPitchYawRollDegrees(0, -90, 270)];
|
var GUN_ORIENTATIONS = [Quat.fromPitchYawRollDegrees(0, 90, 90), Quat.fromPitchYawRollDegrees(0, -90, 270)];
|
||||||
|
|
||||||
|
//x -> y
|
||||||
|
//y -> z
|
||||||
|
// z -> x
|
||||||
var BARREL_OFFSETS = [{
|
var BARREL_OFFSETS = [{
|
||||||
x: -0.12,
|
x: 0,
|
||||||
y: 0.12,
|
y: 0.12,
|
||||||
z: 0.04
|
z: 0.04
|
||||||
}, {
|
}, {
|
||||||
x: 0.12,
|
x: 0.0,
|
||||||
y: 0.12,
|
y: 0.12,
|
||||||
z: 0.04
|
z: 0.04
|
||||||
}];
|
}];
|
||||||
|
@ -185,6 +190,7 @@ function fire(side, value) {
|
||||||
if (intersection.properties.name === "rat") {
|
if (intersection.properties.name === "rat") {
|
||||||
score();
|
score();
|
||||||
createBloodSplatter(intersection.intersection);
|
createBloodSplatter(intersection.intersection);
|
||||||
|
Entities.deleteEntity(intersection.entityID);
|
||||||
|
|
||||||
}
|
}
|
||||||
//Attempt to call entity method's shot method
|
//Attempt to call entity method's shot method
|
||||||
|
@ -193,7 +199,7 @@ function fire(side, value) {
|
||||||
});
|
});
|
||||||
Entities.callEntityMethod(intersection.entityID, 'onShot', [forceDirection]);
|
Entities.callEntityMethod(intersection.entityID, 'onShot', [forceDirection]);
|
||||||
|
|
||||||
}, 50);
|
}, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue