teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

コードの追加

2021/05/18 12:48

投稿

THETA97556919
THETA97556919

スコア5

title CHANGED
File without changes
body CHANGED
@@ -129,8 +129,40 @@
129
129
  }
130
130
  }
131
131
  ```
132
+ MethodBox生成 GameScene.cpp
133
+ ```C++
134
+ #include "GameScene.h"
135
+ #include <DxLib.h>
132
136
 
137
+ using namespace std;
133
138
 
139
+ //このシーンで使用するオブジェクトの生成
140
+ GameScene::GameScene()
141
+ {
142
+ m_field = make_shared<Field>();
143
+ m_reader = make_shared<Reader>();
144
+ m_methodBox = make_shared<MethodBox>(200,200,130,50,"赤い丸を表示", &Method::RedCircle);
145
+ }
146
+
147
+ //現在のシーンのフレーム処理
148
+ bool GameScene::update()
149
+ {
150
+ m_field->update();
151
+ m_reader->update();
152
+ m_methodBox->update();
153
+ return true;
154
+ }
155
+
156
+ //現在のシーンの描画処理
157
+ void GameScene::draw() const
158
+ {
159
+ m_field->draw();
160
+ m_reader->draw();
161
+ m_methodBox->draw();
162
+ }
163
+
164
+ ```
165
+
134
166
  ### 試したこと
135
167
 
136
168
  Typedefの使い方などを調べなおした。