mirror of
http://junepve.top:3000/chicrobot/CINC.git
synced 2026-10-30 05:41:29 +08:00
feat(SS) 故事场景添加摇杆
This commit is contained in:
1 parent
5644f9c1eb
commit
942ba567f3
2 files changed
+91
No files matched your search
@@ -4,6 +4,7 @@
|
||||
* 允许用户控制角色
|
||||
*/
|
||||
import BreatheLife from './BreatheLife.js'
|
||||
import Joystick from './Joystick.js'
|
||||
export default class Control extends BreatheLife {
|
||||
constructor(sceneKey = 'Control') {
|
||||
// 场景相关
|
||||
@@ -38,6 +39,9 @@ export default class Control extends BreatheLife {
|
||||
const { x, y } = this.input.activePointer
|
||||
this.handleClick(x, y)
|
||||
})
|
||||
|
||||
// 添加摇杆
|
||||
this.addJoystick()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,4 +93,12 @@ export default class Control extends BreatheLife {
|
||||
})
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 添加摇杆
|
||||
*/
|
||||
addJoystick() {
|
||||
this.joystick = new Joystick(this, 100, this.game.config.height - 100, 50, 0x888888, 0xcccccc)
|
||||
this.joystick.createJoystick(this.UIDepth) // 创建并设置摇杆层级为UI层
|
||||
this.joystick.listenJoystickInput()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user