1 changed files with 14 additions and 30 deletions
@ -1,32 +1,16 @@ |
|||||
import { Assets } from "pixi.js"; |
import { Orientation } from "./enums/Orientation"; |
||||
import { EDirection } from "./enmu"; |
import { initApp, game, sceneManager } from "./init"; |
||||
import { gameManager, initGame, stageManager } from "./Game"; |
|
||||
import Game from "./Game/Game"; |
|
||||
import { initAssets } from "./Game/Assets"; |
|
||||
|
|
||||
// gameManager.loader
|
// 初始化应用
|
||||
// // .add("my-sound", "/bg.mp3", (e) => addSound(e)) // 背景音乐
|
setTimeout(async () => { |
||||
// .add("bg", "/bg.png") // 背景图片
|
await initApp(); |
||||
// .add("dnf", "https://www.kkkk1000.com/images/learnPixiJS-AnimatedSprite/dnf.png") // 背景图片
|
game.setOrientation(Orientation.Landscape); |
||||
// .add("btn-bg", "/assets/images/button_square_depth_gloss.png") // 背景图片
|
// 入口场景会自动由 SceneManager 发现和初始化
|
||||
// .add("btn-bg-press", "/assets/images/button_square_depth_gradient.png") // 背景图片
|
// 如果你的入口场景叫 "init",它会被自动初始化
|
||||
// .load();
|
|
||||
|
|
||||
// gameManager.loader.onProgress.add((loader) => {
|
|
||||
// console.log(loader.progress);
|
|
||||
// });
|
|
||||
// gameManager.loader.onComplete.once((loader) => {
|
|
||||
// console.log(loader.resources);
|
|
||||
// initGame();
|
|
||||
// gameManager.setDirection(EDirection.Landscape);
|
|
||||
// stageManager.initStage("init");
|
|
||||
// });
|
|
||||
|
|
||||
setTimeout(() => { |
|
||||
;(async ()=>{ |
|
||||
await initAssets(); |
|
||||
await Game.getInstance().init() |
|
||||
initGame(); |
|
||||
gameManager.setDirection(EDirection.Landscape); |
|
||||
})() |
|
||||
}, 200); |
}, 200); |
||||
|
|
||||
|
// 导出供全局调试
|
||||
|
if (import.meta.env.DEV) { |
||||
|
(window as any).game = game; |
||||
|
(window as any).sceneManager = sceneManager; |
||||
|
} |
||||
Loading…
Reference in new issue