refactor: implement inventory item spawner and config

- Add cell and text styling constants to `GRID_CONFIG`
- Replace manual item drawing in `InventoryTestScene` with
  `InventoryItemSpawner`
- Update `InventoryTestScene` to use dynamic inventory dimensions for
  grid rendering
- Register `InventoryTestScene` in the main `App` component
This commit is contained in:
2026-04-20 16:45:14 +08:00
parent b06876ccc0
commit 5884e74d8d
4 changed files with 212 additions and 101 deletions
+2
View File
@@ -4,6 +4,7 @@ import { MapViewerScene } from "@/scenes/MapViewerScene";
import { GridViewerScene } from "@/scenes/GridViewerScene";
import { ShapeViewerScene } from "@/scenes/ShapeViewerScene";
import { GAME_CONFIG } from "@/config";
import { InventoryTestScene } from "@/scenes/InventoryTestScene";
export default function App() {
return (
@@ -11,6 +12,7 @@ export default function App() {
<div className="flex-1 flex relative justify-center items-center">
<PhaserGame initialScene="IndexScene" config={GAME_CONFIG}>
<PhaserScene scene={IndexScene} />
<PhaserScene scene={InventoryTestScene} />
<PhaserScene scene={MapViewerScene} />
<PhaserScene scene={GridViewerScene} />
<PhaserScene scene={ShapeViewerScene} />