ISSUE-054 - Basic animating of the Timing Tower added.
Provided basic controls to switch between. Still need to properly round the bottom rows of both the running and retired cars.
This commit is contained in:
1 parent
00d2c671cb
commit
c9388b86fc
12 files changed
+204
-114
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { random } from "lodash";
|
||||
import { Car, Grid } from "../types/state";
|
||||
|
||||
import { Meters } from "../types/util";
|
||||
|
||||
@@ -14,3 +15,15 @@ export function timeDiff(
|
||||
|
||||
return random(0.95, 1.05) * ((front - back) / 61.015);
|
||||
}
|
||||
|
||||
|
||||
export function getCarAtPos(
|
||||
grid: Grid,
|
||||
targetPosition: number,
|
||||
): Car {
|
||||
const foundCar = grid.find(car => car.position === targetPosition);
|
||||
if (!foundCar) {
|
||||
return grid[0];
|
||||
}
|
||||
return foundCar;
|
||||
}
|
||||
Reference in new issue
Block a user