feat: add CREATURE_SPEED and FLASHLIGHT_INTENSITY_BASE
This commit is contained in:
@@ -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<number>(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;
|
||||
|
||||
Reference in New Issue
Block a user