From ee90e420d603264b9148fb4a82c8ac02f8faf82c Mon Sep 17 00:00:00 2001 From: Michael Mainguy Date: Tue, 11 Nov 2025 06:13:48 -0600 Subject: [PATCH] Fix mesh rendering and CloudFlare proxy compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Major Fixes ### 1. Fixed Invisible Meshes Issue - Root cause: Emissive materials require disableLighting=true without scene lighting - Added disableLighting=true to all loaded materials in loadAsset.ts - Scene intentionally uses no dynamic lights (space game with emissive textures) ### 2. Fixed CloudFlare Proxy + Vite Cache Issues - Updated vite.config.ts to pre-bundle BabylonJS procedural textures - Added force:false to prevent unnecessary cache invalidation - Fixed 504 Gateway Timeout errors on shader module dynamic imports - Separated babylon-procedural chunk for better caching ### 3. Responsive Design Improvements - Consolidated all CSS into public/styles.css with design tokens - Removed duplicate styles.css file - Created semantic header with navigation - Extracted 300+ lines of inline styles to CSS classes - Added mobile-first responsive breakpoints (320px, 480px, 768px, 1024px, 1440px) - Implemented fluid typography with clamp() ### 4. Level Progression System - Fixed level unlocking logic (tutorial always unlocked, others require auth) - Updated DEFAULT_LEVEL_ORDER to match actual level names - Made populateLevelSelector() async to properly await authentication - Added 3-column carousel layout for level selection - Visual states: locked, unlocked, current, completed ### 5. Discord Widget Management - Disabled Discord widget initialization (commented out) to prevent GraphQL errors - Added hide() call during gameplay - Can be re-enabled when Discord bot is properly configured ### 6. TypeScript Error Fixes - Removed unused hasSavedLevels import - Updated replay callbacks to use appHeader instead of individual link references - Fixed all TS compilation errors ## Files Modified - index.html - Semantic header, removed inline styles - public/styles.css - Consolidated styles with design tokens - src/gameConfig.ts - Enabled progression by default - src/levelSelector.ts - Fixed progression logic, async auth check - src/loginScreen.ts - Removed inline styles - src/main.ts - Discord handling, header visibility, error suppression - src/preloader.ts - Removed inline styles - src/progression.ts - Added isLevelUnlocked() method - src/utils/loadAsset.ts - Fixed emissive materials (disableLighting=true) - vite.config.ts - Pre-bundle procedural textures, prevent cache issues - styles.css - DELETED (consolidated into public/styles.css) ๐Ÿค– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- index.html | 128 ++-- public/styles.css | 1418 +++++++++++++++++++++++++++++++--------- src/gameConfig.ts | 6 +- src/levelSelector.ts | 433 ++++-------- src/loginScreen.ts | 90 +-- src/main.ts | 83 ++- src/preloader.ts | 77 +-- src/progression.ts | 25 +- src/utils/loadAsset.ts | 51 +- styles.css | 91 --- vite.config.ts | 17 +- 11 files changed, 1449 insertions(+), 970 deletions(-) delete mode 100644 styles.css diff --git a/index.html b/index.html index b71e8d4..fea89f1 100644 --- a/index.html +++ b/index.html @@ -17,40 +17,37 @@
- -
- - + + + +
- -
-

- ๐Ÿš€ Space Combat VR -

-

+

+

๐Ÿš€ Space Combat VR

+

Pilot your spaceship through asteroid fields and complete missions

-
-

Your Mission

-

+

+

Your Mission

+

Complete levels to unlock new challenges and the level editor

@@ -59,8 +56,8 @@
-
- +
+ ๐ŸŽฎ How to Play (Click to expand)
@@ -87,15 +84,17 @@ โš ๏ธ Note: This game is designed for VR headsets with controllers. Desktop controls are provided for preview and testing purposes only.

-
+ + + @@ -294,30 +293,17 @@
- @@ -334,19 +320,13 @@

โš›๏ธ Physics

-

+

Disabling physics can significantly improve performance but will prevent gameplay.

-