BaseEnemyをShooterとDasherに継承・弾発射敵をダメージ処理抜きで実装 #42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
概要
既存の突進敵を
BaseEnemyControllerとRushEnemyControllerに分割し、弾発射敵(ShooterEnemyController)を追加しました。乗っ取り時の突進可否を敵タイプごとに制御します。変更内容
1. アーキテクチャ変更
2. 新規ファイル
敵タイプごとの仕様
突進敵(Rush / Dasher)
通常時: 検知 → プレイヤーへ接近 → 回転 → 突進
乗っ取り時: ジョイスティックを離すと突進可能(別敵への乗っ取り)
弾発射敵(Shooter)
通常時: 一定間隔で弾を発射し、プレイヤーが範囲内ならプレイヤー方向へ回転(移動なし)
乗っ取り時: ジョイスティックを離しても突進せず、その場で停止。弾の発射は継続
後方互換性
EnemyControllerはRushEnemyControllerを継承しているため、既存のプレハブ・シーンはそのまま利用可能です。未実装(別 Issue 想定)
弾がプレイヤーに当たったときのダメージ処理(乗っ取り解除 / ゲームオーバー) これは [important] 敵からの攻撃によるダメージ処理の実装 #41 イシューで、突進敵がプレイヤーに当たったときのダメージ処理とともに解決予定なので、今回は未実装。
弾は衝突で
Destroyするのみで、OnPlayerDamaged等のダメージ処理は呼び出していません。確認してほしいこと
突進敵が従来どおり動作するか
BulletEnemy1が弾を発射し、プレイヤーを向いて回転するか弾発射敵を乗っ取った際、ジョイスティックを離すと突進せず停止するか
突進敵を乗っ取った際、ジョイスティックを離すと突進するか