mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
29 lines
849 B
JavaScript
29 lines
849 B
JavaScript
// main.js (Viewer Entry Point)
|
|
import './style.css';
|
|
import { generate } from './src/engine/main.js';
|
|
|
|
console.log("FMG Viewer Initialized!");
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const generateButton = document.getElementById('generateButton'); // Assuming you have a button with this ID
|
|
|
|
generateButton.addEventListener('click', () => {
|
|
console.log("Generating map...");
|
|
|
|
// 1. Build config from UI
|
|
const config = {
|
|
seed: document.getElementById('optionsSeed').value || '12345',
|
|
graph: { width: 1024, height: 768, points: 10000 },
|
|
// ... more config from UI
|
|
};
|
|
|
|
// 2. Call the engine
|
|
const mapData = generate(config);
|
|
|
|
console.log("Map data generated by engine:", mapData);
|
|
|
|
// 3. Render the map (this function will be built out later)
|
|
// renderMap(mapData);
|
|
});
|
|
});
|