Skip to content

Commit 0e747d8

Browse files
committed
Revert "Merge pull request #1 from crs48/claude/0003-magnetic-particle-substrate"
This reverts commit 4e450a2, reversing changes made to e32c3b4.
1 parent 4e450a2 commit 0e747d8

16 files changed

Lines changed: 3 additions & 1571 deletions

docs/explorations/0003_[x]_MAGNETIC_PARTICLE_SUBSTRATE.md

Lines changed: 0 additions & 395 deletions
This file was deleted.

eslint.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export default tseslint.config(
66
ignores: [
77
"dist/**",
88
"node_modules/**",
9-
".claude/**",
109
".opencode/**",
1110
".playwright-cli/**",
1211
"playwright-report/**",

src/game/impacts.ts

Lines changed: 0 additions & 137 deletions
This file was deleted.

src/game/run.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import { resolveCollisionFrame } from "./collision";
66
import { BOOST_MULTIPLIERS } from "./config";
7-
import { advanceImpacts, detectNearMisses, type RippleImpact } from "./impacts";
87
import { maybeUpdateHighScore, scoreFromDistance } from "./scoring";
98
import { advancePlayer, createInitialGameState, type GameState } from "./state";
109
import {
@@ -23,8 +22,6 @@ export type RunState = {
2322
readonly bend: BendParams;
2423
readonly collectedBoosts: ReadonlySet<string>;
2524
readonly crashFlashSeconds: number;
26-
// Presentational only: near-miss ripples the particle substrate renders.
27-
readonly impacts: readonly RippleImpact[];
2825
};
2926

3027
export const createRunState = (highScore: number, seed: number): RunState => ({
@@ -33,7 +30,6 @@ export const createRunState = (highScore: number, seed: number): RunState => ({
3330
bend: createBend(seed),
3431
collectedBoosts: new Set(),
3532
crashFlashSeconds: 0,
36-
impacts: [],
3733
});
3834

3935
type CollisionPass = {
@@ -99,13 +95,6 @@ export const updateRun = (
9995
: Math.max(state.game.highScore, score);
10096
const safeDt = Math.min(Math.max(dtSeconds, 0), 0.05);
10197

102-
const detectedImpacts = detectNearMisses(
103-
framesNearDistance(world, advancedPlayer.distance),
104-
state.game.player.distance,
105-
advancedPlayer.distance,
106-
advancedPlayer.angle,
107-
);
108-
10998
return {
11099
game: {
111100
...state.game,
@@ -118,6 +107,5 @@ export const updateRun = (
118107
crashFlashSeconds: collisionState.crashed
119108
? 0.75
120109
: Math.max(0, state.crashFlashSeconds - safeDt),
121-
impacts: advanceImpacts(state.impacts, detectedImpacts, safeDt),
122110
};
123111
};

src/main.ts

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ import { createRunState, updateRun, type RunState } from "./game/run";
66
import { readHighScore, scoreFromDistance } from "./game/scoring";
77
import { findSection } from "./game/world";
88
import { createInputController } from "./input/controller";
9-
import { CELL_DEPTH, TELEGRAPH_FAR_CELLS } from "./tube/space";
9+
import { TELEGRAPH_FAR_CELLS } from "./tube/space";
1010
import { updateCameraRig } from "./render/camera";
11-
import { magnetizationCoherence } from "./render/particles/coherence";
1211
import { createDebugOverlay, updateDebugOverlay } from "./render/debugOverlay";
1312
import { createHud, updateHud } from "./render/hud";
1413
import { updateObstacleView } from "./render/obstacles";
15-
import { updateParticleSystem } from "./render/particles/system";
1614
import { createRenderScene } from "./render/scene";
1715
import { updateShipView } from "./render/ship";
1816
import { updateTubeView } from "./render/tubeMesh";
@@ -53,9 +51,6 @@ const hud = createHud(app);
5351
const debugOverlay = createDebugOverlay(app);
5452
const renderScene = createRenderScene(canvasHost, {
5553
preserveDrawingBuffer: import.meta.env.MODE === "test",
56-
// Opt out with ?particles=off to confirm the substrate is a clean layer.
57-
showParticles:
58-
new URLSearchParams(window.location.search).get("particles") !== "off",
5954
});
6055
const input = createInputController(hud.gyro, hud.gyroStatus);
6156

@@ -66,7 +61,6 @@ const newRun = (): RunState => {
6661

6762
let run = newRun();
6863
let lastTimeMs: number | undefined;
69-
let elapsedSeconds = 0;
7064

7165
const restart = (): void => {
7266
run = newRun();
@@ -84,15 +78,6 @@ const renderFrame = (state: RunState, dtSeconds: number): void => {
8478
const player = state.game.player;
8579
const section = findSection(state.world, player.distance);
8680
const speedFactor = BOOST_MULTIPLIERS[player.boostLevel];
87-
const guidance = guidanceAhead(state.world, player.distance, state.collectedBoosts);
88-
const coherence = magnetizationCoherence({
89-
timeSeconds: elapsedSeconds,
90-
boostLevel: player.boostLevel,
91-
obstacleDistance:
92-
guidance.obstacle === undefined
93-
? Number.POSITIVE_INFINITY
94-
: guidance.obstacle.cell * CELL_DEPTH - player.distance,
95-
});
9681

9782
updateTubeView(
9883
renderScene.tube,
@@ -108,7 +93,6 @@ const renderFrame = (state: RunState, dtSeconds: number): void => {
10893
player.distance,
10994
state.bend,
11095
state.collectedBoosts,
111-
state.impacts,
11296
);
11397
updateCameraRig(
11498
renderScene.cameraRig,
@@ -124,16 +108,6 @@ const renderFrame = (state: RunState, dtSeconds: number): void => {
124108
state.bend,
125109
state.crashFlashSeconds,
126110
);
127-
updateParticleSystem(renderScene.particles, {
128-
bend: state.bend,
129-
playerS: player.distance,
130-
playerAngle: player.angle,
131-
speedFactor,
132-
timeSeconds: elapsedSeconds,
133-
pixelRatio: renderScene.renderer.getPixelRatio(),
134-
impacts: state.impacts,
135-
coherence,
136-
});
137111
renderScene.renderer.render(renderScene.scene, renderScene.cameraRig.camera);
138112
updateDebugOverlay(
139113
debugOverlay,
@@ -156,7 +130,6 @@ renderScene.renderer.setAnimationLoop((timeMs: number) => {
156130
const dtSeconds =
157131
lastTimeMs === undefined ? 0 : (timeMs - lastTimeMs) / 1_000;
158132
lastTimeMs = timeMs;
159-
elapsedSeconds = timeMs / 1_000;
160133

161134
run = updateRun(run, input.getSteer(), dtSeconds, window.localStorage);
162135
renderFrame(run, dtSeconds);

src/render/obstacles.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
} from "three";
1010

1111
import {
12-
cellCenterS,
1312
CELL_DEPTH,
1413
CUBE_DEPTH,
1514
CUBE_SIZE,
@@ -19,8 +18,7 @@ import {
1918
} from "../tube/space";
2019
import type { BendParams } from "../tube/centerline";
2120
import { cellTransform } from "../tube/transform";
22-
import { angleForLane, hasLane } from "../game/coordinates";
23-
import { impactRadialOffset, type RippleImpact } from "../game/impacts";
21+
import { hasLane } from "../game/coordinates";
2422
import { boostKey, frameAtDistance, type World } from "../game/world";
2523
import { CUBE_PALETTE } from "./palette";
2624

@@ -34,10 +32,6 @@ export type ObstacleView = {
3432
const MAX_CUBES = VISIBLE_CELLS * LANES;
3533
const MAX_BOOSTS = VISIBLE_CELLS;
3634
const BOOST_THICKNESS = 0.14;
37-
// A near miss nudges the cube radially. Scaled below the wall-ripple amplitude
38-
// so the cube shivers rather than lurches. Collision is unaffected — this is a
39-
// render-only radial inset, exactly like the ship's.
40-
const CUBE_SHIVER_SCALE = 0.45;
4135

4236
const PALETTE_COLORS: readonly Color[] = CUBE_PALETTE.map(
4337
({ r, g, b }) => new Color(r, g, b),
@@ -94,7 +88,6 @@ export const updateObstacleView = (
9488
playerS: number,
9589
bend: BendParams,
9690
collectedBoosts: ReadonlySet<string>,
97-
impacts: readonly RippleImpact[] = [],
9891
): void => {
9992
const baseCell = Math.floor(playerS / CELL_DEPTH);
10093
let cubeCount = 0;
@@ -113,9 +106,6 @@ export const updateObstacleView = (
113106
continue;
114107
}
115108

116-
const shiver =
117-
impactRadialOffset(cellCenterS(absoluteCell), angleForLane(lane), impacts) *
118-
CUBE_SHIVER_SCALE;
119109
placeInstance(
120110
view.cubes,
121111
cubeCount,
@@ -124,7 +114,7 @@ export const updateObstacleView = (
124114
lane,
125115
playerS,
126116
bend,
127-
CUBE_SIZE / 2 + CUBE_SURFACE_GAP + shiver,
117+
CUBE_SIZE / 2 + CUBE_SURFACE_GAP,
128118
);
129119
view.cubes.setColorAt(
130120
cubeCount,

0 commit comments

Comments
 (0)