Tweak: Camera movement and door glow and chances of movement

This commit is contained in:
Dejvino 2025-11-17 08:47:05 +01:00
parent 192fc39461
commit c521828a08
2 changed files with 10 additions and 10 deletions

View File

@ -5,11 +5,11 @@ import { state } from '../state.js';
function updateCamera() {
const globalTime = Date.now() * 0.00005;
const lookAtTime = Date.now() * 0.00003;
const globalTime = Date.now() * 0.00003;
const lookAtTime = Date.now() * 0.0002;
const camAmplitude = 0.5;
const lookAmplitude = 0.05;
const camAmplitude = 0.2;
const lookAmplitude = 0.1;
// Base Camera Position in front of the TV
const baseX = -0.5;

View File

@ -77,15 +77,15 @@ export function updateDoor() {
if (stateTimer <= 0) {
const nextState = Math.random();
if (nextState < 0.4) {
if (nextState < 0.1) {
doorState = DOOR_STATES.RESTING;
stateTimer = 2 + Math.random() * 5;
} else if (nextState < 0.7) {
} else if (nextState < 0.5) {
doorState = DOOR_STATES.OPENING;
stateTimer = 2 + Math.random() * 4;
stateTimer = 2 + Math.random() * 5;
} else {
doorState = DOOR_STATES.CLOSING;
stateTimer = 3 + Math.random() * 3;
stateTimer = 3 + Math.random() * 2;
}
}
@ -97,7 +97,7 @@ export function updateDoor() {
break;
case DOOR_STATES.CLOSING:
if (doorGroupPanel.rotation.y < minAngle) {
doorGroupPanel.rotation.y += speed;
doorGroupPanel.rotation.y += speed * 2;
}
break;
}
@ -105,7 +105,7 @@ export function updateDoor() {
// Outside material pulsating glow
if (outsideMaterial) {
const glowMin = 0.001;
const glowMax = 0.01;
const glowMax = 0.005;
const glowSpeed = 0.0001; // Speed of the pulsation
glowIntensity += glowDirection * glowSpeed;
if (glowIntensity >= glowMax) {