feat(SS) 添加地图

This commit is contained in:
chicrobot committed 2026-02-04 21:48:37 +08:00
1 parent 2616dc21f1
commit d3669bd44e
13 files changed
+1359 -99

No files matched your search

+13 -5
View File
@@ -7,10 +7,11 @@
export default class WorldTime extends Phaser.Scene {
/**
* 构造函数
* 初始化场景并设置场景键名为 'WorldTime'
* 初始化场景并设置场景键名
* @param {string} sceneKey - 场景键名
*/
constructor() {
super('WorldTime')
constructor(sceneKey = 'WorldTime') {
super(sceneKey)
this.nextScene = 'WorldLand'
this.gameTime = 0 // 游戏中的时间戳(单位:秒)
@@ -34,6 +35,15 @@ export default class WorldTime extends Phaser.Scene {
// 设置场景背景颜色为深灰色
this.cameras.main.setBackgroundColor('#999999')
this.initInput() // 初始化输入事件
this.initDayNight(this.toGameTime('1999-12-30 23:57:00')) // 初始化时间,白天黑夜状态
}
/**
* 初始化输入事件
* 监听鼠标点击和键盘按键,触发场景过渡
*/
initInput() {
// 监听鼠标点击事件,点击后执行场景过渡动画
this.input.on('pointerdown', () => {
this.scene.start(this.nextScene);
@@ -43,8 +53,6 @@ export default class WorldTime extends Phaser.Scene {
this.input.keyboard.on('keydown', () => {
this.scene.start(this.nextScene);
})
this.initDayNight(this.toGameTime('2000-01-01 17:57:00')) // 初始化时间,白天黑夜状态
}
/**
* 更新游戏时间