refactor(sfx.js): use vite imports for npm run build to work properly
This commit is contained in:
17
README.md
17
README.md
@@ -218,13 +218,10 @@ window.mazeGameState = {
|
||||
|
||||
## Known Issues & Limitations
|
||||
|
||||
### ⚠️ Known Behavior
|
||||
1. **Chest Memory:** Once a chest is opened, its visual state persists for the remainder of the game session (not reset per level)
|
||||
- *Workaround:* Intentional game design—players learn chest locations
|
||||
2. **Pointer Lock Exit:** Pressing ESC exits pointer lock but doesn't pause gameplay
|
||||
- *Workaround:* Intentional—players can exit anytime (no pause feature)
|
||||
3. **Chunk Size Warning:** Built JavaScript is ~9.1 MB due to image assets (job application image is 3MB)
|
||||
- *Workaround:* Not an issue for local play; consider asset compression for production
|
||||
### ⚠️ Known Problems
|
||||
1. **Pointer Lock Exit:** Pointer lock may be annoying for newcomers to web browser games
|
||||
2. **Chunk Size Warning:** Built JavaScript is ~9.1 MB due to image assets
|
||||
- Not an issue for local play
|
||||
|
||||
### ⭐ Special Features to Note
|
||||
- **Seeded Randomization:** Players can use the same seed to replay identical mazes (debug button: "Randomize seed")
|
||||
@@ -284,12 +281,6 @@ window.mazeGameState = {
|
||||
- **Babylon.js Playground:** Reference for collision detection and camera control
|
||||
- **p5.js Documentation:** Async setup pattern for p5.js 2.0+ (no `preload()`)
|
||||
- **MDN Web Audio API:** Context priming for cross-browser audio compatibility
|
||||
- **Vite Documentation:** Asset bundling and import resolution
|
||||
|
||||
### Game Design Inspiration
|
||||
- *Portal series:* Puzzle-based spatial reasoning and exit goals
|
||||
- *Deus Ex:* Multiple approaches to objectives (fast routing vs. exploration)
|
||||
- *Pac-Man:* Time pressure and progressive difficulty
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -1,12 +1,22 @@
|
||||
// Import audio files as modules so Vite bundles them
|
||||
import chestCloseUrl from "../../sfx/sfx_chest_close.wav";
|
||||
import chestOpenUrl from "../../sfx/sfx_chest_open.wav";
|
||||
import clickUrl from "../../sfx/sfx_click.wav";
|
||||
import clockUrl from "../../sfx/sfx_clock.wav";
|
||||
import keyUrl from "../../sfx/sfx_key.wav";
|
||||
import loseUrl from "../../sfx/sfx_lose.wav";
|
||||
import stepUrl from "../../sfx/sfx_step.wav";
|
||||
import winUrl from "../../sfx/sfx_win.wav";
|
||||
|
||||
const soundFiles = {
|
||||
chestClose: "/sfx/sfx_chest_close.wav",
|
||||
chestOpen: "/sfx/sfx_chest_open.wav",
|
||||
click: "/sfx/sfx_click.wav",
|
||||
clock: "/sfx/sfx_clock.wav",
|
||||
key: "/sfx/sfx_key.wav",
|
||||
lose: "/sfx/sfx_lose.wav",
|
||||
step: "/sfx/sfx_step.wav",
|
||||
win: "/sfx/sfx_win.wav",
|
||||
chestClose: chestCloseUrl,
|
||||
chestOpen: chestOpenUrl,
|
||||
click: clickUrl,
|
||||
clock: clockUrl,
|
||||
key: keyUrl,
|
||||
lose: loseUrl,
|
||||
step: stepUrl,
|
||||
win: winUrl,
|
||||
};
|
||||
|
||||
const sounds = {};
|
||||
|
||||
Reference in New Issue
Block a user