From 323f0be900d95f269980375beeca7a8349ef78f9 Mon Sep 17 00:00:00 2001 From: Juan Sebastian Montoya Date: Wed, 26 Nov 2025 17:53:40 -0500 Subject: [PATCH] Feature/Gameloop enhancements (#17) Reviewed-on: https://git.jusemon.com/jusemon/threejs-test/pulls/17 Co-authored-by: Juan Sebastian Montoya Co-committed-by: Juan Sebastian Montoya --- index.html | 23 +- nginx.conf | 21 ++ src/components/CoinType.js | 39 ++ src/components/ObstacleType.js | 25 ++ src/components/ParticleEmitter.js | 28 ++ src/components/PowerUp.js | 42 +++ src/components/SoundEvent.js | 21 ++ src/game/EntityFactory.js | 172 ++++++++- src/game/Game.js | 362 +++++++++++++++++- src/game/GameConfig.js | 26 +- src/systems/ObstacleSystem.js | 51 ++- src/systems/ParticleSystem.js | 106 ++++++ src/systems/PlayerControlSystem.js | 35 +- src/systems/PowerUpSystem.js | 131 +++++++ src/systems/SoundSystem.js | 584 +++++++++++++++++++++++++++++ 15 files changed, 1629 insertions(+), 37 deletions(-) create mode 100644 src/components/CoinType.js create mode 100644 src/components/ObstacleType.js create mode 100644 src/components/ParticleEmitter.js create mode 100644 src/components/PowerUp.js create mode 100644 src/components/SoundEvent.js create mode 100644 src/systems/ParticleSystem.js create mode 100644 src/systems/PowerUpSystem.js create mode 100644 src/systems/SoundSystem.js diff --git a/index.html b/index.html index 3117536..63d7c83 100644 --- a/index.html +++ b/index.html @@ -96,6 +96,20 @@ z-index: 100; font-family: 'Courier New', monospace; } + #soundStatus { + position: absolute; + top: 20px; + right: 100px; + font-size: 20px; + cursor: pointer; + z-index: 100; + user-select: none; + opacity: 0.8; + transition: opacity 0.2s; + } + #soundStatus:hover { + opacity: 1; + } #perfMonitor { position: absolute; top: 60px; @@ -125,6 +139,11 @@ top: 10px; right: 10px; } + #soundStatus { + top: 10px; + right: 60px; + font-size: 18px; + } #perfMonitor { top: 40px; right: 10px; @@ -144,6 +163,8 @@
v-
+
🔊
+
FPS: 60
Frame: 16.7ms
@@ -159,7 +180,7 @@

Controls: WASD or Arrow Keys to move | Touch and drag to move (mobile) | Collect yellow coins | Avoid red obstacles!

-

Press "T" or shake device to toggle performance monitor

+

Press "T" to toggle performance monitor | Press "M" to toggle sound