質問編集履歴
4
コードの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -27,3 +27,641 @@
|
|
27
27
|
別javaファイルに書いたゲームをどのように
|
28
28
|
|
29
29
|
メニュー画面の処理を書いたファイルから開始させたらいいのかわかりません
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
これがメニュー画面で
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
```JAVA
|
38
|
+
|
39
|
+
public class MyGame2 extends JFrame implements ActionListener{
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
JPanel MenuPanel;
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
JButton GameStart;
|
48
|
+
|
49
|
+
JButton Custom;
|
50
|
+
|
51
|
+
JButton DeveloperCode;
|
52
|
+
|
53
|
+
JButton Option;
|
54
|
+
|
55
|
+
JButton GameEnd;
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
public static final String Cmd_GameStart = "GameStart";
|
60
|
+
|
61
|
+
public static final String Cmd_Custom = "Custom";
|
62
|
+
|
63
|
+
public static final String Cmd_DeveloperCode = "DeveloperCode";
|
64
|
+
|
65
|
+
public static final String Cmd_Option = "Option";
|
66
|
+
|
67
|
+
public static final String Cmd_GameEnd = "GameEnd";
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
public static void main(String[] args){
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
MyGame2 MenuFrame = new MyGame2();//ウィンドウを内部的に作成
|
76
|
+
|
77
|
+
MenuFrame.setSize(900, 550);//ウィンドウサイズ設定
|
78
|
+
|
79
|
+
MenuFrame.setTitle("シューティングゲーム");
|
80
|
+
|
81
|
+
MenuFrame.setLocationRelativeTo(null);//ウィンドウの位置を中央に設定
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
MenuFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
86
|
+
|
87
|
+
//ウィンドウを×で閉じるようにする設定
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
MenuFrame.setVisible(true);//ウィンドウを可視化
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
}
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
MyGame2(){
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
MenuPanel = new JPanel();//menupanel設定
|
104
|
+
|
105
|
+
MenuPanel.setLayout(null);//レイアウトマネージャー無効化
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
GameStart = new JButton("ゲーム開始");//ボタンの文字列設定
|
110
|
+
|
111
|
+
Custom = new JButton("カスタム");
|
112
|
+
|
113
|
+
DeveloperCode = new JButton("開発者コード");
|
114
|
+
|
115
|
+
Option = new JButton("設定");
|
116
|
+
|
117
|
+
GameEnd = new JButton("ゲーム終了");
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
GameStart.setForeground(Color.BLACK);//文字の色設定
|
122
|
+
|
123
|
+
GameStart.setBackground(Color.WHITE);//背景の色設定
|
124
|
+
|
125
|
+
Custom.setForeground(Color.BLACK);
|
126
|
+
|
127
|
+
Custom.setBackground(Color.WHITE);
|
128
|
+
|
129
|
+
DeveloperCode.setForeground(Color.BLACK);
|
130
|
+
|
131
|
+
DeveloperCode.setBackground(Color.WHITE);
|
132
|
+
|
133
|
+
Option.setForeground(Color.BLACK);
|
134
|
+
|
135
|
+
Option.setBackground(Color.WHITE);
|
136
|
+
|
137
|
+
GameEnd.setForeground(Color.BLACK);
|
138
|
+
|
139
|
+
GameEnd.setBackground(Color.WHITE);
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
GameStart.setHorizontalAlignment(JButton.CENTER);//文字の大まかな位置の設定
|
144
|
+
|
145
|
+
GameStart.setVerticalAlignment(JButton.CENTER);
|
146
|
+
|
147
|
+
Custom.setHorizontalAlignment(JButton.CENTER);
|
148
|
+
|
149
|
+
Custom.setVerticalAlignment(JButton.CENTER);
|
150
|
+
|
151
|
+
DeveloperCode.setHorizontalAlignment(JButton.CENTER);
|
152
|
+
|
153
|
+
DeveloperCode.setVerticalAlignment(JButton.CENTER);
|
154
|
+
|
155
|
+
Option.setHorizontalAlignment(JButton.CENTER);
|
156
|
+
|
157
|
+
Option.setVerticalAlignment(JButton.CENTER);
|
158
|
+
|
159
|
+
GameEnd.setHorizontalAlignment(JButton.CENTER);
|
160
|
+
|
161
|
+
GameEnd.setVerticalAlignment(JButton.CENTER);
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
GameStart.setBounds(769, 0, 115, 100);//ボタンの座標とサイズ設定
|
166
|
+
|
167
|
+
Custom.setBounds(769, 100, 115, 100);
|
168
|
+
|
169
|
+
DeveloperCode.setBounds(769, 200, 115, 100);
|
170
|
+
|
171
|
+
Option.setBounds(769, 300, 115, 100);
|
172
|
+
|
173
|
+
GameEnd.setBounds(769, 400, 115, 100);
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
GameStart.setActionCommand(Cmd_GameStart);
|
178
|
+
|
179
|
+
Custom.setActionCommand(Cmd_Custom);
|
180
|
+
|
181
|
+
DeveloperCode.setActionCommand(Cmd_DeveloperCode);
|
182
|
+
|
183
|
+
Option.setActionCommand(Cmd_Option);
|
184
|
+
|
185
|
+
GameEnd.setActionCommand(Cmd_GameEnd);
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
GameStart.addActionListener(this);
|
190
|
+
|
191
|
+
Custom.addActionListener(this);
|
192
|
+
|
193
|
+
DeveloperCode.addActionListener(this);
|
194
|
+
|
195
|
+
Option.addActionListener(this);
|
196
|
+
|
197
|
+
GameEnd.addActionListener(this);
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
MenuPanel.add(GameStart);//ボタンをMenuPanelに追加
|
202
|
+
|
203
|
+
MenuPanel.add(Custom);
|
204
|
+
|
205
|
+
MenuPanel.add(DeveloperCode);
|
206
|
+
|
207
|
+
MenuPanel.add(Option);
|
208
|
+
|
209
|
+
MenuPanel.add(GameEnd);
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
getContentPane().add(MenuPanel, BorderLayout.CENTER);//???
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
}
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
public void actionPerformed(ActionEvent e){
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
String cmd = e.getActionCommand();
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
if(cmd.equals(Cmd_GameStart)){
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
}
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
if(cmd.equals(Cmd_Custom)){
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
}
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
if(cmd.equals(Cmd_DeveloperCode)){
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
}
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
if(cmd.equals(Cmd_Option)){
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
}
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
if(cmd.equals(Cmd_GameEnd)){
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
}
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
}
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
}
|
274
|
+
|
275
|
+
```
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
これがシューティングゲームです
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
```java
|
284
|
+
|
285
|
+
public class MyGame extends JFrame implements ActionListener, MouseMotionListener{
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
int zikiX = 750;//自機のX座標
|
290
|
+
|
291
|
+
int zikiY = 225;//自機のY座標
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
int teki1X = 130;//敵機1のX座標
|
296
|
+
|
297
|
+
int teki1Y = 200;//敵機1のY座標
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
int zikidamaX = zikiX-30;//自機の弾のX座標
|
302
|
+
|
303
|
+
int zikidamaY = zikiY;//自機の弾のY座標
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
int count;//カウント感知用変数
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
ImageIcon icon1 = new ImageIcon
|
312
|
+
|
313
|
+
("C:\Users\miyab\Desktop\シューティングゲーム\画像ファイル\自機.png");//自機の画像ファイル指定;//ImageIconのicon1作成
|
314
|
+
|
315
|
+
ImageIcon icon2 = new ImageIcon
|
316
|
+
|
317
|
+
("C:\Users\miyab\Desktop\シューティングゲーム\画像ファイル\自機弾.png");//自機弾の画像ファイル指定;//ImageIconのicon2作成
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
ImageIcon icon3 = new ImageIcon
|
322
|
+
|
323
|
+
("C:\Users\miyab\Desktop\シューティングゲーム\画像ファイル\敵機.png");//敵機の画像ファイル指定;//ImageIconのicon3作成
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
JLabel ziki;//自機作成
|
328
|
+
|
329
|
+
JLabel zikizahyou;//自機の座標作成
|
330
|
+
|
331
|
+
JLabel zikidamazahyou;////自機弾の座標作成
|
332
|
+
|
333
|
+
JLabel zikidama;//自機弾作成
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
JLabel teki1;//敵機1作成
|
338
|
+
|
339
|
+
JLabel teki1zahyou;//敵機1の座標作成
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
JPanel panel;//panel作成
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
Timer timer;//timer作成
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
public static void main(String[] args){
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
MyGame frame = new MyGame();//ウィンドウを内部的に作成
|
356
|
+
|
357
|
+
frame.setSize(900, 550);//ウィンドウサイズ設定
|
358
|
+
|
359
|
+
frame.setTitle("シューティングゲーム");
|
360
|
+
|
361
|
+
frame.setLocationRelativeTo(null);//ウィンドウの位置を中央に設定
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
366
|
+
|
367
|
+
//ウィンドウを×で閉じるようにする設定
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
frame.setVisible(true);//ウィンドウを可視化
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
}
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
MyGame(){
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
panel = new JPanel();//panel設定
|
384
|
+
|
385
|
+
panel.setLayout(null);//レイアウトマネージャー無効化
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
ziki = new JLabel(icon1);//JLabelに自機の画像ファイル設定
|
390
|
+
|
391
|
+
zikizahyou = new JLabel();//自機の座標を入れる
|
392
|
+
|
393
|
+
zikidamazahyou = new JLabel();//自機の弾の座標を入れる
|
394
|
+
|
395
|
+
zikidama = new JLabel(icon2);//JLabelに自機の弾の画像ファイル設定
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
teki1 = new JLabel(icon3);//JLabelに敵機の画像ファイル設定
|
400
|
+
|
401
|
+
teki1zahyou = new JLabel();//敵機の座標を入れ
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
ziki.setBounds(zikiX, zikiY, 80, 40);//zikiのサイズと座標設定
|
406
|
+
|
407
|
+
zikizahyou.setText("自機 "+"X座標:"+zikiX+" Y座標:"+zikiY);//自機の座標を設定
|
408
|
+
|
409
|
+
zikizahyou.setBounds(5, 5, 200, 15);//自機の座標の座標とサイズを設定
|
410
|
+
|
411
|
+
zikidamazahyou.setText("自機の弾 "+"X座標:"+zikidamaX+" Y座標:"+zikidamaY);//自機の座標を設定
|
412
|
+
|
413
|
+
zikidamazahyou.setBounds(5, 17, 200, 15);//自機の座標の座標とサイズを設定
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
teki1.setBounds(teki1X, teki1Y, 40, 20);//teki1のサイズと座標設定
|
418
|
+
|
419
|
+
teki1zahyou.setText("敵機1 "+"X座標:"+teki1X+" Y座標:"+teki1Y);//自機の座標を設定
|
420
|
+
|
421
|
+
teki1zahyou.setBounds(5, 30, 200, 15);//自機の座標の座標とサイズを設定
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
timer = new Timer(10, this);//タイマーの間隔
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
panel.add(ziki);//自機画像をpanelに追加
|
430
|
+
|
431
|
+
panel.add(zikizahyou);//自機の座標を画面に表示
|
432
|
+
|
433
|
+
panel.add(zikidamazahyou);//自機の弾の座標を画面に表示
|
434
|
+
|
435
|
+
|
436
|
+
|
437
|
+
panel.add(teki1);//敵機を追加
|
438
|
+
|
439
|
+
panel.add(teki1zahyou);//敵機1の座標を画面に表示
|
440
|
+
|
441
|
+
|
442
|
+
|
443
|
+
pack();//???
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
getContentPane().add(panel, BorderLayout.CENTER);//???
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
enableEvents(java.awt.AWTEvent.KEY_EVENT_MASK);//キーイベントの有効化
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
addMouseMotionListener(this);//マウスの動きの感知を有効化
|
456
|
+
|
457
|
+
|
458
|
+
|
459
|
+
}
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
protected void processKeyEvent(java.awt.event.KeyEvent e){//キーイベントの関数
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
if(e.getID() == java.awt.event.KeyEvent.KEY_PRESSED){
|
468
|
+
|
469
|
+
|
470
|
+
|
471
|
+
if(e.getKeyCode() == java.awt.event.KeyEvent.VK_A){
|
472
|
+
|
473
|
+
|
474
|
+
|
475
|
+
if(zikidama.getParent() == panel){
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
//zikidamaがpanelにある時は何もしない
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
}else{
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
zikidamaX = zikiX-10;//zikidamaXを初期化
|
488
|
+
|
489
|
+
zikidamaY = zikiY;//zikidamaYを初期化
|
490
|
+
|
491
|
+
|
492
|
+
|
493
|
+
zikidama.setBounds(zikidamaX, zikidamaY, 20, 20);//自機の弾のサイズと座標を設定
|
494
|
+
|
495
|
+
panel.add(zikidama);//panelにzikidamaを追加
|
496
|
+
|
497
|
+
|
498
|
+
|
499
|
+
}
|
500
|
+
|
501
|
+
timer.start();//タイマースタート
|
502
|
+
|
503
|
+
|
504
|
+
|
505
|
+
}
|
506
|
+
|
507
|
+
|
508
|
+
|
509
|
+
}
|
510
|
+
|
511
|
+
}
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
public void actionPerformed(ActionEvent e){
|
516
|
+
|
517
|
+
|
518
|
+
|
519
|
+
if(zikidamaX <= 0){
|
520
|
+
|
521
|
+
|
522
|
+
|
523
|
+
timer.stop();//timerストップ
|
524
|
+
|
525
|
+
panel.remove(zikidama);//panelからzikidama削除
|
526
|
+
|
527
|
+
panel.repaint();//panelを更新
|
528
|
+
|
529
|
+
|
530
|
+
|
531
|
+
zikidamaX = zikiX-10;//zikidamaXを初期化
|
532
|
+
|
533
|
+
zikidamaY = zikiY;//zikidamaYを初期化
|
534
|
+
|
535
|
+
zikidama.setBounds(zikidamaX, zikidamaY, 20, 20);//自機の弾のサイズと座標を設定
|
536
|
+
|
537
|
+
|
538
|
+
|
539
|
+
}else{
|
540
|
+
|
541
|
+
|
542
|
+
|
543
|
+
zikidamaX -= 15;//zikidamaXを-15
|
544
|
+
|
545
|
+
zikidama.setLocation(zikidamaX,zikidamaY);//座標を再設定
|
546
|
+
|
547
|
+
zikidamazahyou.setText("自機の弾 "+"X座標:"+zikidamaX+" Y座標:"+zikidamaY);
|
548
|
+
|
549
|
+
//座標表示を更新
|
550
|
+
|
551
|
+
|
552
|
+
|
553
|
+
}
|
554
|
+
|
555
|
+
|
556
|
+
|
557
|
+
if(zikidamaX >= teki1X-10 && zikidamaX <= teki1X+10 &&
|
558
|
+
|
559
|
+
zikidamaY >= teki1Y-10 && zikidamaY <= teki1Y+10 &&
|
560
|
+
|
561
|
+
teki1.getParent() == panel){
|
562
|
+
|
563
|
+
|
564
|
+
|
565
|
+
timer.stop();//タイマーストップ
|
566
|
+
|
567
|
+
panel.remove(zikidama);//zikidama削除
|
568
|
+
|
569
|
+
panel.remove(teki1);//teki1削除
|
570
|
+
|
571
|
+
panel.repaint();//panel更新
|
572
|
+
|
573
|
+
|
574
|
+
|
575
|
+
}
|
576
|
+
|
577
|
+
|
578
|
+
|
579
|
+
}
|
580
|
+
|
581
|
+
|
582
|
+
|
583
|
+
public void mouseMoved(MouseEvent e){
|
584
|
+
|
585
|
+
|
586
|
+
|
587
|
+
Point point = e.getPoint();
|
588
|
+
|
589
|
+
zikiX = point.x-43;//マウスに画像のX座標の中心を合わせる
|
590
|
+
|
591
|
+
zikiY = point.y-45;//マウスに画像のY座標の中心を合わせる
|
592
|
+
|
593
|
+
|
594
|
+
|
595
|
+
if(zikiX <= 0){//座標が画面外に行ったら左端に戻す
|
596
|
+
|
597
|
+
|
598
|
+
|
599
|
+
zikiX = 0;//zikiのX座標を0に設定
|
600
|
+
|
601
|
+
|
602
|
+
|
603
|
+
}
|
604
|
+
|
605
|
+
|
606
|
+
|
607
|
+
if(zikiX >= 804){//座標が画面外に行ったら右端に戻す
|
608
|
+
|
609
|
+
|
610
|
+
|
611
|
+
zikiX = 804;//zikiのX座標を804に設定
|
612
|
+
|
613
|
+
|
614
|
+
|
615
|
+
}
|
616
|
+
|
617
|
+
|
618
|
+
|
619
|
+
if(zikiY <= 1){//座標が画面外に行ったら上端に戻す
|
620
|
+
|
621
|
+
|
622
|
+
|
623
|
+
zikiY = 1;//zikiのY座標を1に設定
|
624
|
+
|
625
|
+
|
626
|
+
|
627
|
+
}
|
628
|
+
|
629
|
+
|
630
|
+
|
631
|
+
if(zikiY >= 471){//座標が画面外に行ったら下端に戻す
|
632
|
+
|
633
|
+
|
634
|
+
|
635
|
+
zikiY = 471;//zikiのY座標を471に設定
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
}
|
640
|
+
|
641
|
+
|
642
|
+
|
643
|
+
ziki.setLocation(zikiX,zikiY);//座標を再設定
|
644
|
+
|
645
|
+
zikizahyou.setText("自機 "+"X座標:"+zikiX+" Y座標:"+zikiY);//座標表示を更新
|
646
|
+
|
647
|
+
|
648
|
+
|
649
|
+
}
|
650
|
+
|
651
|
+
|
652
|
+
|
653
|
+
public void mouseDragged(MouseEvent e){
|
654
|
+
|
655
|
+
|
656
|
+
|
657
|
+
//マウスがドラッグされたときに呼び出される
|
658
|
+
|
659
|
+
|
660
|
+
|
661
|
+
}
|
662
|
+
|
663
|
+
|
664
|
+
|
665
|
+
}
|
666
|
+
|
667
|
+
```
|
3
タイトルと追記の編集
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ボタンを押したら別の
|
1
|
+
ボタンを押したら別のjavaファイルを実行したい
|
test
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
シューティングゲームのメニューでボタンを押したら
|
2
2
|
|
3
|
-
シューティングゲーム(別の
|
3
|
+
シューティングゲーム(別のjavaファイル)を実行するようにしたいのですが
|
4
4
|
|
5
5
|
どのようにしたらいいのか調べてもよくわかりませんでした
|
6
6
|
|
@@ -24,6 +24,6 @@
|
|
24
24
|
|
25
25
|
そこでボタンを押したら{}内を処理するというのは出来たのですが
|
26
26
|
|
27
|
-
別ファイルに書いたゲームをどのように
|
27
|
+
別javaファイルに書いたゲームをどのように
|
28
28
|
|
29
29
|
メニュー画面の処理を書いたファイルから開始させたらいいのかわかりません
|
2
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -5,3 +5,25 @@
|
|
5
5
|
どのようにしたらいいのか調べてもよくわかりませんでした
|
6
6
|
|
7
7
|
回答よろしくお願いします
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
###追記
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
まず自分は今シューティングゲームを作っていて
|
16
|
+
|
17
|
+
そのメニュー画面を今作っていて
|
18
|
+
|
19
|
+
そのメニュー画面にボタンを表示していて
|
20
|
+
|
21
|
+
そのボタンを押したらゲームが始まるようにしたいです
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
そこでボタンを押したら{}内を処理するというのは出来たのですが
|
26
|
+
|
27
|
+
別ファイルに書いたゲームをどのように
|
28
|
+
|
29
|
+
メニュー画面の処理を書いたファイルから開始させたらいいのかわかりません
|
1
本文の編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -3,3 +3,5 @@
|
|
3
3
|
シューティングゲーム(別のクラス)を実行するようにしたいのですが
|
4
4
|
|
5
5
|
どのようにしたらいいのか調べてもよくわかりませんでした
|
6
|
+
|
7
|
+
回答よろしくお願いします
|