mirror of
http://junepve.top:3000/chicrobot/CINC.git
synced 2026-10-30 00:31:29 +08:00
feat(inventory) 添加网格背包系统
This commit is contained in:
1 parent
b9a5180293
commit
ae26209a24
8 files changed
+1857
-43
No files matched your search
@@ -14,6 +14,8 @@ import MovementTestScene5 from './scenes/MovementTestScene5.js';
|
||||
import MovementTestScene6 from './scenes/MovementTestScene6.js';
|
||||
// 导入物品系统测试场景
|
||||
import ItemTestScene from './scenes/ItemTestScene.js';
|
||||
// 导入背包系统测试场景
|
||||
import InventoryTestScene from './scenes/InventoryTestScene.js';
|
||||
|
||||
// 创建游戏的最终配置对象
|
||||
const config = {
|
||||
@@ -30,7 +32,8 @@ const config = {
|
||||
MovementTestScene4,
|
||||
MovementTestScene5,
|
||||
MovementTestScene6,
|
||||
ItemTestScene
|
||||
ItemTestScene,
|
||||
InventoryTestScene
|
||||
]
|
||||
};
|
||||
|
||||
@@ -39,10 +42,10 @@ const config = {
|
||||
window.game = new Phaser.Game(config);
|
||||
|
||||
// 添加一个函数,用于从控制台切换到测试场景
|
||||
window.startMovementTest = function(sceneIndex = 1) {
|
||||
const sceneKey = `MovementTestScene${sceneIndex}`;
|
||||
if (window.game.scene.getIndex(sceneKey) !== -1) {
|
||||
window.game.scene.start(sceneKey);
|
||||
window.startTest = function(sceneIndex = 1) {
|
||||
const scenes = window.game.scene.scenes;
|
||||
if (sceneIndex >= 0 && sceneIndex < scenes.length) {
|
||||
window.game.scene.start(scenes[sceneIndex]);
|
||||
console.log(`已切换到测试场景${sceneIndex}`);
|
||||
} else {
|
||||
console.error(`测试场景${sceneIndex}不存在`);
|
||||
|
||||
Reference in new issue
Block a user