mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 10:01:23 +01:00
Significant work done porting to headless engine
This commit is contained in:
parent
ab08dc9429
commit
d1b07fff01
573 changed files with 50603 additions and 0 deletions
29
procedural/main.js
Normal file
29
procedural/main.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
// main.js (Viewer Entry Point)
|
||||
import './style.css';
|
||||
import { generateMap } from './src/engine/main.js'; // Import from our future engine
|
||||
|
||||
console.log("FMG Viewer Initialized!");
|
||||
|
||||
// Example of how you will eventually use the engine
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const generateButton = document.getElementById('generateMapButton'); // 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 = generateMap(config);
|
||||
|
||||
console.log("Map data generated by engine:", mapData);
|
||||
|
||||
// 3. Render the map (this function will be built out later)
|
||||
// renderMap(mapData);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue