feat: character/NPC management system with spritesheet support
Add drag & drop spritesheet upload in editor, character registry in sprites.js, character selector for NPCs, sprite rendering on editor canvas, server API for character persistence, and game-side character loading via characterLoader.js. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import { initWorldInput, destroyWorldInput, setInteractionHandler } from './worl
|
||||
import { getMap } from './maps.js';
|
||||
import { saveGadget, openBackpack, getGadgets, openNamingScreen, showNotification } from './inventory.js';
|
||||
import { openWiringPanel } from './wiringPanel.js';
|
||||
import { loadCharacters } from './characterLoader.js';
|
||||
|
||||
// Circuit editor stop function (to stop its render loop when switching modes)
|
||||
import { stopCircuitLoop } from '../renderer.js';
|
||||
@@ -28,7 +29,10 @@ export function registerCircuitEditor(initFn, destroyFn) {
|
||||
/**
|
||||
* Boot the game — start in world mode
|
||||
*/
|
||||
export function startGame() {
|
||||
export async function startGame() {
|
||||
// Load character spritesheets before entering world
|
||||
await loadCharacters();
|
||||
|
||||
// Set spawn
|
||||
const map = getMap(worldState.currentMap);
|
||||
if (map && map.spawn) {
|
||||
|
||||
Reference in New Issue
Block a user