質問編集履歴

1

文章を追加

2022/08/22 13:57

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -205,3 +205,29 @@
205
205
 
206
206
  ```
207
207
 
208
+ ##### Game.cpp
209
+ ```cpp
210
+ /*#################################################
211
+ # 更新
212
+ ###################################################*/
213
+ void Game::Update()
214
+ {
215
+ for(std::vector<std::shared_ptr<SDL::GameObject>>::const_iterator itr = gameObject.begin(); itr != gameObject.end(); itr++)
216
+ {
217
+ (*itr)->Update();
218
+ }
219
+
220
+ for(std::vector<std::shared_ptr<SDL::GameObject>>::const_iterator itr = gameObject.begin(); itr != gameObject.end(); itr++)
221
+ {
222
+ for(std::vector<std::shared_ptr<SDL::GameObject>>::const_iterator it = gameObject.begin(); it != gameObject.end(); it++)
223
+ {
224
+ if(it != itr)
225
+ {
226
+ (*itr)->Collision(*it);
227
+ }
228
+ }
229
+ }
230
+ }
231
+
232
+ ```
233
+