-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
49 lines (44 loc) · 1.95 KB
/
main.js
File metadata and controls
49 lines (44 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// main.js — modern entrypoint for the canvas-based idle game
import { initApp } from './modules/app.js';
// Initialize the app once the DOM is ready
document.addEventListener('DOMContentLoaded', () => {
const canvas = document.getElementById('main-canvas');
// The UI layer in index.html is #ui-layer — use it so UI controls (Start button, settings)
// are properly bound. Previously we looked for a non-existent #controls element.
const controls = document.getElementById('ui-layer') || document.body;
if (!canvas) {
console.warn('Game canvas not found in DOM.');
return;
}
initApp({ canvas, controls });
});
// Tombstones for legacy, removed code from the original main.js:
//
// removed global map generation and noise configuration variables
// (hash, seed, random_seed, dirlist, npc_elements, fgrx/fgrn/fgwx/fgwn,
// fgb/fgc, gbr/gbc/grid_height/grid_width, smoothing settings, sine/perlin/
// simplex/fourier/jacobi/chebyshev/permute parameters, etc.)
//
// removed function onPageLoad() {}
// removed function getSettings() {}
// removed function initGame() {}
// removed function getSeedFromDOM() {}
// removed function generateMiniMap() {}
// removed function generateMiniMapFromArray() {}
// removed function hashCode() {}
// removed function seededRand() {}
// removed function checkModifiedTile() {}
// removed function selectTile(noise) {}
// removed function generateTileRow(direction) {}
// removed function generateTileColumn(direction) {}
// removed function prepareTileElement(tiletype, col, innerhtml) {}
// removed function prepareCoinElement(money_amount) {}
//
// removed legacy timer-based game loop: gameStartPause(), gameStart(),
// gamePause(), game_step() {}
//
// removed NPC social-logic helpers: countAdjacentFriends(), npcVolition(),
// addToNPCArray() and related jQuery-based NPC coordinate scraping {}
//
// removed jQuery plugin extension $.fn.toggleText and other direct DOM-
// manipulation/game-logic coupling {}