mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 12:08:23 +02:00
more bug fixes
This commit is contained in:
parent
68fcf4ec8a
commit
7bd9e2653c
3 changed files with 14 additions and 20 deletions
|
@ -20,7 +20,6 @@ Script.include('../utilities/tools/vector.js');
|
|||
var URL = "https://s3.amazonaws.com/hifi-public/marketplace/hificontent/Scripts/planets/";
|
||||
|
||||
SatelliteCreator = function() {
|
||||
|
||||
print("initializing satellite game");
|
||||
|
||||
var MAX_RANGE = 50.0;
|
||||
|
@ -291,9 +290,6 @@ SatelliteCreator = function() {
|
|||
}
|
||||
|
||||
this.quitGame = function() {
|
||||
if(!this.isActive) {
|
||||
return;
|
||||
}
|
||||
print("ending satellite game");
|
||||
this.isActive = false;
|
||||
|
||||
|
|
|
@ -165,6 +165,7 @@ var rideButton = addImage(systemViewPanel, 'rocket');
|
|||
var tweening, tweeningPaused;
|
||||
Script.include('https://hifi-staff.s3.amazonaws.com/bridget/tween.js');
|
||||
|
||||
|
||||
pauseButton.addAction('onClick', function() {
|
||||
if (tweening) {
|
||||
if (!tweeningPaused) {
|
||||
|
@ -172,6 +173,7 @@ pauseButton.addAction('onClick', function() {
|
|||
} else {
|
||||
tweeningPaused = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!paused) {
|
||||
pause();
|
||||
|
@ -183,13 +185,6 @@ pauseButton.addAction('onClick', function() {
|
|||
// Allow to toggle pause with spacebar
|
||||
function keyPressEvent(event) {
|
||||
if (event.text == "SPACE") {
|
||||
if (tweening) {
|
||||
if (!tweeningPaused) {
|
||||
tweeningPaused = true;
|
||||
} else {
|
||||
tweeningPaused = false;
|
||||
}
|
||||
}
|
||||
if (!paused) {
|
||||
pause();
|
||||
} else {
|
||||
|
@ -214,13 +209,11 @@ rideButton.addAction('onClick', function() {
|
|||
tweening = true;
|
||||
tweeningPaused = false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
restartButton.addAction('onClick', function() {
|
||||
restart();
|
||||
tweening = false;
|
||||
|
||||
});
|
||||
|
||||
var zoomPanel = addPanel({
|
||||
|
|
|
@ -21,9 +21,8 @@
|
|||
CreateSimulation = function() {
|
||||
Script.include("https://hifi-public.s3.amazonaws.com/eric/scripts/tween.js");
|
||||
Script.include('games/satellite.js');
|
||||
|
||||
|
||||
trailsEnabled = true;
|
||||
|
||||
var trailsEnabled = this.trailsEnabled = true;
|
||||
|
||||
var DAMPING = this.DAMPING = 0.0;
|
||||
var LIFETIME = this.LIFETIME = 6000;
|
||||
|
@ -127,6 +126,9 @@ CreateSimulation = function() {
|
|||
}
|
||||
|
||||
this.pause = function() {
|
||||
if(paused) {
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < planets.length; ++i) {
|
||||
Entities.editEntity(planets[i].planet, {
|
||||
velocity: {
|
||||
|
@ -142,6 +144,9 @@ CreateSimulation = function() {
|
|||
}
|
||||
|
||||
this.resume = function() {
|
||||
if(!paused) {
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < planets.length; ++i) {
|
||||
planets[i].label.hide();
|
||||
}
|
||||
|
@ -216,18 +221,15 @@ CreateSimulation = function() {
|
|||
|
||||
this.clearTrails = function() {
|
||||
elapsed = 0.0;
|
||||
|
||||
for (var j = 0; j < this.lineStack.length; ++j) {
|
||||
Entities.editEntity(this.lineStack[j], {
|
||||
visible: false
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
this.resetTrails = function() {
|
||||
elapsed = 0.0;
|
||||
|
||||
this.trail = [];
|
||||
this.lineStack = [];
|
||||
//add the first line to both the line entity stack and the trail
|
||||
|
@ -488,12 +490,15 @@ CreateSimulation = function() {
|
|||
elapsed = 0.0;
|
||||
planets.length = 0;
|
||||
initPlanets();
|
||||
|
||||
|
||||
MyAvatar.position = startingPosition;
|
||||
Camera.setPosition(cameraStart);
|
||||
};
|
||||
|
||||
}
|
||||
CreateSimulation();
|
||||
|
||||
Script.update.connect(update);
|
||||
Script.scriptEnding.connect(scriptEnding);
|
||||
Script.scriptEnding.connect(scriptEnding);
|
||||
|
||||
|
|
Loading…
Reference in a new issue