/** * Control 场景类 * * 允许用户控制角色 */ import BreatheLife from './BreatheLife.js' export default class Control extends BreatheLife { constructor(sceneKey = 'Control') { // 场景相关 super(sceneKey) this.nextScene = 'InfoBar' } preload() { super.preload() } create() { super.create() // 覆盖场景切换条件 this.initSceneTransition() } initSceneTransition() { // 初始化角色计数器,用于跟踪创建的角色数量 this.smallGrassObjects = [] // 维护小草集合 } }