about summary refs log tree commit diff stats
path: root/html/rogue/js/config.js
diff options
context:
space:
mode:
Diffstat (limited to 'html/rogue/js/config.js')
-rw-r--r--html/rogue/js/config.js115
1 files changed, 90 insertions, 25 deletions
diff --git a/html/rogue/js/config.js b/html/rogue/js/config.js
index 77100e1..6ed925f 100644
--- a/html/rogue/js/config.js
+++ b/html/rogue/js/config.js
@@ -1,32 +1,97 @@
-const CONFIG = {
+const Config = {
+    colors: {
+        BACKGROUND: 'rgba(135, 207, 235, 1)',
+        GRID: 'rgba(0, 0, 0, 0.25)',
+        PLAYER: 'red',
+        HEX_FILL: '#ffffff',
+        FOG: {
+            HIDDEN: 'rgba(0, 0, 0, 1)',
+            REVEALED: 'rgba(0, 0, 0, 0.25)',
+            GRID_DIM: 'rgba(0, 0, 0, 0.0)'
+        },
+        UI: {
+            INVENTORY: {
+                BACKGROUND: 'rgba(0, 0, 0, 0.7)',
+                WINDOW: '#ffffff',
+                TEXT: '#000000'
+            }
+        },
+        ITEMS: {
+            COIN: '#FFD700',
+            GEM: '#50C878'
+        }
+    },
+    
+    hex: {
+        SIZE: 40, // Size of a single hex
+        GRID_SIZE: 30, // Number of hexes in the grid (width/height)
+        get WIDTH() { // Computed hex width
+            return this.SIZE * 2;
+        },
+        get HEIGHT() { // Computed hex height
+            return Math.sqrt(3) * this.SIZE;
+        }
+    },
+
+    game: {
+        FPS: 60,
+        get FRAME_TIME() {
+            return 1000 / this.FPS;
+        }
+    },
+
     player: {
-        width: 32,
-        height: 48,
-        speed: 5,
-        jumpForce: 12,
-        gravity: 0.5,
-        color: '#ff0000'
+        MOVE_SPEED: 0.1,
+        SIZE_RATIO: 1/3,
+        VISION_RANGE: 3,
+        SPRITE_SCALE: 0.8,
+        ANIMATION_SPEED: 500
     },
-    world: {
-        groundHeight: 12,
-        wilderness: {
-            vegetation: {
-                grass: {
-                    colors: ['#3a5', '#294'],
-                    hatch: {
-                        angle: Math.PI / 4,
-                        variation: Math.PI / 6,
-                        spacing: 4,
-                        length: 8,
-                        margin: 2
-                    }
-                }
+
+    camera: {
+        FOLLOW_SPEED: 0.1,
+        DEADZONE_RATIO_X: {
+            NARROW: 0.1,
+            WIDE: 0.2
+        },
+        DEADZONE_RATIO_Y: 0.2,
+        MIN_DEADZONE: 30,
+        MAX_DEADZONE: 200,
+        NARROW_SCREEN_THRESHOLD: 600
+    },
+
+    ui: {
+        inventory: {
+            PADDING: 20,
+            WIDTH: 300,
+            HEIGHT: 400,
+            TITLE_FONT: '20px Arial',
+            ITEM_FONT: '16px Arial',
+            ITEM_SPACING: 30,
+            TITLE_OFFSET: 20,
+            ITEMS_START_OFFSET: 60
+        }
+    },
+    
+    items: {
+        SPAWN_COUNT: 10,
+        types: {
+            COIN: {
+                name: 'Coin',
+                size: 0.2
+            },
+            GEM: {
+                name: 'Gem',
+                size: 0.25
             }
         }
     },
-    camera: {
-        width: window.innerWidth,
-        height: window.innerHeight,
-        followSpeed: 0.1
+
+    fog: {
+        states: {
+            HIDDEN: { alpha: 1.0 },
+            REVEALED: { alpha: 0.5 },
+            VISIBLE: { alpha: 0 }
+        }
     }
 }; 
\ No newline at end of file