improve rendering

This commit is contained in:
Asraelite 2016-03-29 21:21:01 +01:00
parent c47ad92f21
commit 8a059b92d5
30 changed files with 286 additions and 260 deletions

View file

@ -21,6 +21,7 @@
"Dragonfruit",
"Durian",
"Elderberry",
"Etrog",
"Feijoa",
"Fig",
"Goji Berry",
@ -100,7 +101,9 @@
],
"c": [
"Crazy",
"Cool"
"Cool",
"Cute",
"Careful"
],
"d": [
"Dizzy",
@ -108,7 +111,8 @@
],
"e": [
"Energetic",
"Easy"
"Easy",
"Evil"
],
"f": [
"Funny",

View file

@ -22,11 +22,12 @@ class Body {
this.rvel = data.rvel || 0;
this.mounts = data.mounts || [];
this.fixtures = data.fixtures || [];
this.health = data.health || 1;
this.mounts = this.mounts.map(m => new Mount(this, m));
let fixtures = data.fixtures || [];
this.fixtures = this.mounts.map((m, i) => fixtures[i] || 0);
this.mounts = this.mounts.map((m, i) => {
let fixture = this.fixtures[i];
return new Mount(this, m, fixture);
});
this.interface = {
order: [
@ -38,7 +39,7 @@ class Body {
'rvel'
],
type: 'body',
fixtures: this.fixtures.length
fixtures: this.mounts.length
};
}

View file

@ -36,10 +36,10 @@ class Grapple extends Projectile {
}
connect() {
let p1 = { x: 0, y: 0.5 };
let p1 = { x: 0.1, y: 0.5 };
let p2 = { x: 0.0625, y: 0 };
this.rope = new Rope(this.player.ship, this, p1, p2);
this.rope.initLength = 6;
this.rope.initLength = 8;
this.world.addCopula(this.rope);
}

View file

@ -9,7 +9,8 @@ class Ship extends Body {
constructor(world, pos, player, build) {
build = build || defaults.spawnShip;
let traits = shipTraits[build.ship];
super(world, traits, build);
traits.fixtures = build.fixtures;
super(world, traits);
// Body data.
this.x = pos.x || 0;

View file

@ -6,8 +6,6 @@ const Laser = require('./shot/laser.js');
class Blaster extends Fixture {
constructor(hardpoint, data) {
super(hardpoint, data);
console.log(data);
}
fire() {

View file

@ -23,7 +23,6 @@ class Fixture {
packFull() {
return {
traversal: this.traversal
}
}

View file

@ -7,7 +7,7 @@ class Mount {
this.ship = ship;
this.type = data.type || 'turret';
this.fixture = false;
this.fixture = fixture || false;
this.size = data.size || 0;
this.position = {
x: data.pos[0],
@ -24,7 +24,7 @@ class Mount {
destruct() {
if (!this.fixture) return;
this.fixture.destruct();
//this.fixture.destruct();
}
packDelta() {
@ -32,14 +32,14 @@ class Mount {
}
updateDeltaInterface() {
this.deltaInterface = this.fixture ? ['traversal'] : [];
this.deltaInterface = ['traversal'];
}
packFull() {
return {
x: this.position.x,
y: this.position.y,
turret: this.turret ? this.turret.type : 0
type: this.fixture ? this.fixture : 0
};
}
}

View file

@ -171,7 +171,8 @@ class World {
this.tps = this.tpsCount / 5 | 0;
this.tpsCount = 0;
this.tpsStart = Date.now();
//console.log('TPS: ' + this.tps);
if(this.tps < 50)
wingbase.warning(`${this.room.name} TPS: ${this.tps}`);
}
this.tpsCount++;

View file

@ -35,7 +35,11 @@ class ServerInterface {
}
error(msg) {
this.log(msg, 'red');
this.log(msg, 'red', 'bold');
}
warning(msg) {
this.log(msg, 'yellow');
}
capLogfile() {