diff --git a/src/app/fear/scene-components/creature.tsx b/src/app/fear/scene-components/creature.tsx index 0559c59..cabe933 100644 --- a/src/app/fear/scene-components/creature.tsx +++ b/src/app/fear/scene-components/creature.tsx @@ -3,7 +3,7 @@ import { useFrame, useThree } from "@react-three/fiber"; import { useEffect, useRef, useState } from "react"; import * as THREE from "three"; -import { fearState } from "../state"; +import { FEAR_SETTINGS, fearState } from "../state"; export default function TheCreature() { const texture = useTexture('fear/img/creature.png'); @@ -14,7 +14,6 @@ export default function TheCreature() { const [hasTriggered, setHasTriggered] = useState(false); const [isSpawned, setIsSpawned] = useState(false); - const speed = 15; const globalDistance = useRef(32); const [currentLoop, setCurrentLoop] = useState(fearState.loopCount); @@ -56,7 +55,7 @@ export default function TheCreature() { } if (hasTriggered) { - globalDistance.current -= speed * delta; + globalDistance.current -= FEAR_SETTINGS.CREATURE_SPEED * delta; if (audioRef.current && !audioPlaying.current) { audioPlaying.current = true; diff --git a/src/app/fear/scene-components/player.tsx b/src/app/fear/scene-components/player.tsx index ebd6ab6..d304712 100644 --- a/src/app/fear/scene-components/player.tsx +++ b/src/app/fear/scene-components/player.tsx @@ -92,7 +92,7 @@ export default function Player() { flashlightRef.current.target.position.lerp(targetDest, 10 * delta); flashlightRef.current.target.updateMatrixWorld(); - flashlightRef.current.intensity = 5 + Math.sin(state.clock.elapsedTime * 30) * 0.3; + flashlightRef.current.intensity = FEAR_SETTINGS.FLASHLIGHT_INTENSITY_BASE + Math.sin(state.clock.elapsedTime * 30) * 0.3; } const minX = -fearState.currentWidth / 2 + FEAR_SETTINGS.WALL_BUFFER; diff --git a/src/app/fear/state.ts b/src/app/fear/state.ts index 18065d9..d6daddf 100644 --- a/src/app/fear/state.ts +++ b/src/app/fear/state.ts @@ -6,7 +6,9 @@ export const FEAR_SETTINGS = { HALLWAY_HEIGHT: 5, PLAYER_HEIGHT: 3, PLAYER_SPEED: 4, + FLASHLIGHT_INTENSITY_BASE: 8, WALL_BUFFER: 0.6, + CREATURE_SPEED: 12, }; const listeners = new Set<() => void>();