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:
parent
8a0bf0ada9
commit
c73130e3ff
25 changed files with 584 additions and 274 deletions
|
@ -9,6 +9,8 @@ export const tracers = new Set();
|
|||
|
||||
export let playerShip = null;
|
||||
|
||||
export let speed = 1;
|
||||
|
||||
export function setPlayerShip(ship) {
|
||||
playerShip = ship;
|
||||
}
|
||||
|
@ -33,11 +35,22 @@ export function remove(object) {
|
|||
celestials.delete(object);
|
||||
}
|
||||
|
||||
export function tick() {
|
||||
particles.forEach(p => p.tick());
|
||||
celestials.forEach(c => c.tick());
|
||||
entities.forEach(e => e.tick());
|
||||
ships.forEach(s => s.tick());
|
||||
if (graphics.trace) tracers.forEach(t => t.tick());
|
||||
spawn.tick();
|
||||
export function increaseSpeed() {
|
||||
if (speed < 5) speed += 1;
|
||||
}
|
||||
|
||||
export function decreaseSpeed() {
|
||||
if (speed > 1) speed -= 1;
|
||||
}
|
||||
|
||||
export function tick() {
|
||||
for (let i = 0; i < speed; i++) {
|
||||
particles.forEach(p => p.tick());
|
||||
celestials.forEach(c => c.tick());
|
||||
entities.forEach(e => e.tick());
|
||||
ships.forEach(s => s.tick());
|
||||
}
|
||||
|
||||
spawn.tick();
|
||||
if (graphics.trace) tracers.forEach(t => t.tick());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue