Skip to content

Commit

Permalink
Jump
Browse files Browse the repository at this point in the history
  • Loading branch information
robashton committed Dec 20, 2011
1 parent df88b69 commit c4e773e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 19 deletions.
3 changes: 0 additions & 3 deletions build.js
Expand Up @@ -9,9 +9,6 @@ paperboy = require('paperboy');
Services = require('./src/server/services').Services;
LandscapeHandler = require('./src/server/landscapehandler').LandscapeHandler;

startup.check_config_exists(DB_CONFIG_FILE);
startup.check_config_exists(KEYS_CONFIG_FILE);

var stitch = require('stitch');
var fs = require('fs');
var ShaderGeneration = require('./src/server/shadergeneration').ShaderGeneration;
Expand Down
33 changes: 23 additions & 10 deletions site/app/src/game.js
Expand Up @@ -3046,7 +3046,7 @@ exports.Bot = function(communication) {

var onMissileLock = function(data) {
waitingToFire = true;
waitingToFireCount = Math.random() * 30;
waitingToFireCount = Math.random() * 60;
};

var startFollowingTarget = function(targetid) {
Expand Down Expand Up @@ -3628,25 +3628,30 @@ var Hovercraft = function() {
vec3.add(self._velocity, acceleration);
};
self.impulseLeft = function() {
var amount = 0.07;
var amount = 0.1;
self.rotationY += amount;
};
self.impulseRight = function() {
var amount = 0.07;
var amount = 0.11;
self.rotationY -= amount;
};

var count = 0;
self.impulseUp = function() {
var amount = 0.25;
var forward = 0.05;
var terrain = self._scene.getEntity("terrain");

var terrainHeight = terrain.getHeightAt(self.position[0], self.position[2]);
var heightDelta = self.position[1] - terrainHeight;

if(heightDelta < 20.0 && heightDelta > -5.0) {
self._velocity[1] += amount;
}
if(heightDelta < 20.0 && heightDelta > -5.0) {
acceleration[0] = (-forward) * Math.sin(self.rotationY);
acceleration[1] = amount;
acceleration[2] = (-forward) * Math.cos(self.rotationY);
vec3.add(self._velocity, acceleration);
acceleration[1] = 0;
}
};

var processInput = function() {
Expand Down Expand Up @@ -5024,11 +5029,13 @@ exports.ServerCommunication = ServerCommunication;
return JSON.parse(fs.readFileSync(file_name, 'utf8'))[ENV];
};
}).call(this);
}, "server/data": function(exports, require, module) {var config = require('./config');

}, "server/data": function(exports, require, module) {/*var config = require('./config');
/
var url = config(DB_CONFIG_FILE)
var CouchClient = require('couch-client');
var db = new CouchClient(url);
var db = new CouchClient(url); */

var db = {};

var bcrypt = require('bcrypt');
var salt = bcrypt.gen_salt_sync(4);
Expand Down Expand Up @@ -5290,7 +5297,13 @@ exports.Handler = function() {
var Keygrip = require('keygrip');
var config = require('./config');

var keys = config(KEYS_CONFIG_FILE);
var keys = null;

if(process.env.COOKIE_KEYS) {
keys = JSON.parse(process.env.COOKIE_KEYS);
} else {
keys = config(KEYS_CONFIG_FILE);
}

exports.Identity = {
verifyUsername: function(username, sign) {
Expand Down
2 changes: 1 addition & 1 deletion src/entities/bot.js
Expand Up @@ -202,7 +202,7 @@ exports.Bot = function(communication) {

var onMissileLock = function(data) {
waitingToFire = true;
waitingToFireCount = Math.random() * 30;
waitingToFireCount = Math.random() * 60;
};

var startFollowingTarget = function(targetid) {
Expand Down
15 changes: 10 additions & 5 deletions src/entities/hovercraft.js
Expand Up @@ -79,25 +79,30 @@ var Hovercraft = function() {
vec3.add(self._velocity, acceleration);
};
self.impulseLeft = function() {
var amount = 0.07;
var amount = 0.1;
self.rotationY += amount;
};
self.impulseRight = function() {
var amount = 0.07;
var amount = 0.11;
self.rotationY -= amount;
};

var count = 0;
self.impulseUp = function() {
var amount = 0.25;
var forward = 0.05;
var terrain = self._scene.getEntity("terrain");

var terrainHeight = terrain.getHeightAt(self.position[0], self.position[2]);
var heightDelta = self.position[1] - terrainHeight;

if(heightDelta < 20.0 && heightDelta > -5.0) {
self._velocity[1] += amount;
}
if(heightDelta < 20.0 && heightDelta > -5.0) {
acceleration[0] = (-forward) * Math.sin(self.rotationY);
acceleration[1] = amount;
acceleration[2] = (-forward) * Math.cos(self.rotationY);
vec3.add(self._velocity, acceleration);
acceleration[1] = 0;
}
};

var processInput = function() {
Expand Down

0 comments on commit c4e773e

Please sign in to comment.