Compare commits
2 commits
9f35dc7ddd
...
43e2a15197
| Author | SHA1 | Date | |
|---|---|---|---|
| 43e2a15197 | |||
| 420bd1f411 |
2 changed files with 6 additions and 9 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "polaris-task-force",
|
"name": "polaris-task-force",
|
||||||
"version": "0.2.1",
|
"version": "0.2.2",
|
||||||
"description": "Web app for the Arma 3 unit Polaris Task Force. Uses Next.js for client- and server-side rendering, with a Postgres database and some other neat libraries.",
|
"description": "Web app for the Arma 3 unit Polaris Task Force. Uses Next.js for client- and server-side rendering, with a Postgres database and some other neat libraries.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|
|
||||||
|
|
@ -325,9 +325,9 @@ export function AimTrainerGame({
|
||||||
}, [resetToReady, startGame]);
|
}, [resetToReady, startGame]);
|
||||||
|
|
||||||
const handleRestartAction = useCallback(() => {
|
const handleRestartAction = useCallback(() => {
|
||||||
if (phaseRef.current !== "playing") return;
|
if (phaseRef.current === "ready") return;
|
||||||
startGame();
|
resetToReady();
|
||||||
}, [startGame]);
|
}, [resetToReady]);
|
||||||
|
|
||||||
const handleShot = useCallback(
|
const handleShot = useCallback(
|
||||||
(event: PointerEvent<HTMLCanvasElement>) => {
|
(event: PointerEvent<HTMLCanvasElement>) => {
|
||||||
|
|
@ -458,10 +458,7 @@ export function AimTrainerGame({
|
||||||
if (remaining === 0) {
|
if (remaining === 0) {
|
||||||
finish();
|
finish();
|
||||||
} else {
|
} else {
|
||||||
const displayedSecond =
|
const displayedSecond = Math.ceil(remaining / 1000);
|
||||||
remaining <= FINAL_COUNTDOWN_WINDOW_MS
|
|
||||||
? Math.ceil(remaining / 1000)
|
|
||||||
: COURSE_DURATION_SECONDS;
|
|
||||||
if (displayedSecond !== game.lastDisplayedSecond) {
|
if (displayedSecond !== game.lastDisplayedSecond) {
|
||||||
game.lastDisplayedSecond = displayedSecond;
|
game.lastDisplayedSecond = displayedSecond;
|
||||||
setTimerSeconds(displayedSecond);
|
setTimerSeconds(displayedSecond);
|
||||||
|
|
@ -728,7 +725,7 @@ export function AimTrainerGame({
|
||||||
</div>
|
</div>
|
||||||
<div className="text-xs text-muted-foreground">
|
<div className="text-xs text-muted-foreground">
|
||||||
Headshots score {HEADSHOT_POINTS} · torso hits score {TORSO_POINTS} · civilians cost{" "}
|
Headshots score {HEADSHOT_POINTS} · torso hits score {TORSO_POINTS} · civilians cost{" "}
|
||||||
{CIVILIAN_PENALTY}. Press R to restart the lane.
|
{CIVILIAN_PENALTY}. Press R to reset the lane.
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue