diff --git a/src/Station.ts b/src/Station.ts index 32d683c..d918d43 100644 --- a/src/Station.ts +++ b/src/Station.ts @@ -40,7 +40,7 @@ export default class Station { stationCount += 1; this.id = stationCount; this.label = new PIXI.Text(`${this.id}`, { - fill: 'orange', + fill: '#FFA500', fontFamily: 'monospace', fontSize: '12px', }); diff --git a/src/Train.ts b/src/Train.ts index 5c6034f..36f2ca5 100644 --- a/src/Train.ts +++ b/src/Train.ts @@ -23,7 +23,7 @@ export default class Train { trainCount += 1; this.id = trainCount; this.label = new PIXI.Text(`${this.id}`, { - fill: 'white', + fill: '#AEAEAE', fontFamily: 'monospace', fontSize: '12px', }); diff --git a/src/transport.ts b/src/transport.ts index 5930934..f22dcb9 100644 --- a/src/transport.ts +++ b/src/transport.ts @@ -70,7 +70,9 @@ const moveTrains = (trains: Train[], stations: Station[]) => { for (const train of trains) { // choose a destination randomly with a bias towards larger stations if (train.destination === undefined) { - const closeStations = Station.stationsWithinRadius(stations, train.location, MAX_JOURNEY); + const otherStations = stations.filter(station => station !== train.origin); + const closeStations = Station.stationsWithinRadius(otherStations, train.location, + MAX_JOURNEY); const closeStationWeights = closeStations.map(station => station.population); train.destination = weightedRandom(closeStations, closeStationWeights); } @@ -140,10 +142,14 @@ const run = () => { graphics.clear(); fpsText.text = `${Math.round(ticker.FPS)}`; - graphics.lineStyle(1, 0xaeaeae, 1); + graphics.lineStyle(1, 0xFFA500, 1); drawStations(stations, graphics); + + graphics.lineStyle(1, 0xAEAEAE, 1); drawTrains(trains, graphics); + + // TODO: ? // drawLine(line, graphics); }); ticker.start();