1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-09 21:27:13 +08:00

feat: 添加游戏控制和管理功能

- 新增GameControl节点用于统一处理游戏重启和退出
- 添加GameBusManager管理游戏重启时的资源清理
- 修改Pause和GameOver面板使用新的GameControl
- 为EffectController和ItemDropped添加分组管理
- 统一使用WorldManager管理游戏时间
This commit is contained in:
2026-05-05 06:51:48 +08:00
parent f6e71507ce
commit 30527a18a8
16 changed files with 89 additions and 53 deletions
+2 -2
View File
@@ -52,7 +52,7 @@ func tryLaunch(action: String, weaponIndex: int):
var weapon = weapons[weaponIndex]
if weapon.emitType == Weapon.EmitType.CHARGE:
if weapon.canAttackBy(self ):
chargeStartTime[weaponIndex] = Time.get_ticks_msec()
chargeStartTime[weaponIndex] = WorldManager.getTime()
chargeParticle.emitting = true
chargeParticle.speed_scale = 1
elif weapon.emitType == Weapon.EmitType.CLICK_SHOOT || weapon.emitType == Weapon.EmitType.HOLD_LOOP:
@@ -70,7 +70,7 @@ func tryLaunch(action: String, weaponIndex: int):
if weapon.emitType == Weapon.EmitType.CHARGE:
if chargeStartTime.has(weaponIndex):
var startTime = chargeStartTime[weaponIndex]
var endTime = Time.get_ticks_msec()
var endTime = WorldManager.getTime()
var chargedTime = endTime - startTime
chargeStartTime.erase(weaponIndex)
weapon.chargedTime = chargedTime * self.fields.get(FieldStore.Entity.CHARGE_SPEED)