1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

箱庭でUnityを動かしてみる(7日目)

Posted at

2025/03/21(7日目)実施内容

OutOfRangeExceptionの解決

6日目では確認しなかったが,射撃の実装でOutOfRangeのエラーが出ていたので解決する
-> 既にDestroyしたオブジェクトを参照している部分があった(順序論理エラー)
-> 修正完了

センサは後回しで先にゲームルールを作りたくなった

ゲーム名考えてなかったので考える

ゲーム名は「FlowBot」で

構成

元のROS2シミュレータの WorldController.cs へ繋げて構成する

  1. ゲーム開始
  2. 自分と相手のロボット,ロボットのHPは100,フローチャートの命令通りに動く
  3. いずれかのロボットのHPが0になったら終了
  4. 結果表示

この部分をScriptで構成すると

root. GameMaster

  1. InitGame
  2. GamePlaying
  3. FinishGame
  4. ShowResult

これを組んでいく

GameMaster

  • プレイヤー情報とゲーム進行を持つ
  • 都度,子に情報を提供して処理させる

InitGame

  • ロボットを初期配置に配置する
  • プレイヤー情報のインスタンス生成

とりあえずここまで決めた

次回やること

ルールを組んでいく
とりあえず,Unityで完結して動けるように頑張る

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?