broadfield-dev commited on
Commit
21c90d6
·
verified ·
1 Parent(s): 72a021b

Update static/game.js

Browse files
Files changed (1) hide show
  1. static/game.js +9 -1
static/game.js CHANGED
@@ -48,7 +48,15 @@ class GameStage {
48
  this.renderer.render(this.scene, this.camera);
49
  }
50
  }
51
-
 
 
 
 
 
 
 
 
52
  // Global UI functions
53
  function gatherFood() { game.gatherFood(); }
54
  function buildHut() { game.buildHut(); }
 
48
  this.renderer.render(this.scene, this.camera);
49
  }
50
  }
51
+ document.addEventListener('DOMContentLoaded', function() {
52
+ const canvas = document.getElementById('gameCanvas');
53
+ if (canvas) {
54
+ game = new TribalStage(canvas);
55
+ game.init();
56
+ } else {
57
+ console.error('Canvas element not found');
58
+ }
59
+ });
60
  // Global UI functions
61
  function gatherFood() { game.gatherFood(); }
62
  function buildHut() { game.buildHut(); }