General improvements

I forgot what I actually changed. It may not even be playable, I just want to get this up there.
This commit is contained in:
Asraelite 2023-03-31 11:43:56 +02:00
parent 8a0bf0ada9
commit c73130e3ff
25 changed files with 584 additions and 274 deletions

View file

@ -22,6 +22,7 @@ export default class Ship extends Body {
this.rotationPower = 0;
this.cargoCapacity = 0;
this.thrust = 0;
this.computation = 0;
this.crashed = false;
this.timeWithoutFuel = 0;
}
@ -113,6 +114,7 @@ export default class Ship extends Body {
this.rotationPower = 0;
this.cargoCapacity = 0;
this.thrust = 0;
this.computation = 0;
this.modules.forEach(m => {
if (m.type === 'fuel') {
@ -120,12 +122,15 @@ export default class Ship extends Body {
} else if (m.type === 'capsule') {
this.rotationPower += m.data.rotation;
this.cargoCapacity += m.data.capacity;
this.computation += m.data.computation;
} else if (m.type === 'thruster') {
this.thrust += m.data.thrust;
} else if (m.type === 'gyroscope') {
this.rotationPower += m.data.rotation;
} else if (m.type === 'cargo') {
this.cargoCapacity += m.data.capacity;
} else if (m.type === 'navigation') {
this.computation += m.data.computation;
}
});
}