質問編集履歴
3
MainActivity
test
CHANGED
File without changes
|
test
CHANGED
@@ -56,31 +56,19 @@
|
|
56
56
|
|
57
57
|
private var hitoSize = 0
|
58
58
|
|
59
|
-
private var kenSize = 0
|
60
|
-
|
61
59
|
private var screenWidth = 0
|
62
60
|
|
63
61
|
private var screenHeight = 0
|
64
62
|
|
65
63
|
// 位置
|
66
64
|
|
67
|
-
private var hito
|
65
|
+
private var hitoX = 0f
|
68
|
-
|
66
|
+
|
69
|
-
private var kenX = 0f
|
67
|
+
private var kenX : Float = 0f
|
70
|
-
|
68
|
+
|
71
|
-
private var kenY = 0f
|
69
|
+
private var kenY : Float = 0f
|
72
|
-
|
73
|
-
|
70
|
+
|
74
|
-
|
75
|
-
|
71
|
+
|
76
|
-
|
77
|
-
private var yariX = 0f
|
78
|
-
|
79
|
-
private var yariY = 0f
|
80
|
-
|
81
|
-
private var yumiX = 0f
|
82
|
-
|
83
|
-
private var yumiY = 0f
|
84
72
|
|
85
73
|
// スピード
|
86
74
|
|
@@ -88,11 +76,7 @@
|
|
88
76
|
|
89
77
|
private var kenSpeed = 0
|
90
78
|
|
91
|
-
|
79
|
+
|
92
|
-
|
93
|
-
private var yariSpeed = 0
|
94
|
-
|
95
|
-
private var yumiSpeed = 0
|
96
80
|
|
97
81
|
// Score
|
98
82
|
|
@@ -152,27 +136,13 @@
|
|
152
136
|
|
153
137
|
kenSpeed = Math.round(screenHeight / 60f)
|
154
138
|
|
155
|
-
|
139
|
+
|
156
|
-
|
157
|
-
yariSpeed = Math.round(screenHeight / 45f)
|
158
|
-
|
159
|
-
yumiSpeed = Math.round(screenHeight / 45f)
|
160
140
|
|
161
141
|
ken.x = -100.0f
|
162
142
|
|
163
143
|
ken.y = -100.0f
|
164
144
|
|
165
|
-
|
145
|
+
|
166
|
-
|
167
|
-
syuri.y = -100.0f
|
168
|
-
|
169
|
-
yari.x = -100.0f
|
170
|
-
|
171
|
-
yari.y = -100.0f
|
172
|
-
|
173
|
-
yumi.x = -100.0f
|
174
|
-
|
175
|
-
yumi.y = -100.0f
|
176
146
|
|
177
147
|
scoreLabel.text = "Score : 0f"
|
178
148
|
|
@@ -188,7 +158,7 @@
|
|
188
158
|
|
189
159
|
// ken
|
190
160
|
|
191
|
-
kenY
|
161
|
+
kenY += kenSpeed.toFloat()
|
192
162
|
|
193
163
|
if (kenY < 0) {
|
194
164
|
|
@@ -196,7 +166,7 @@
|
|
196
166
|
|
197
167
|
kenX =
|
198
168
|
|
199
|
-
Math.floor(Math.random() * (frameside
|
169
|
+
Math.floor(Math.random() * ( frameside-ken.width)).toFloat()
|
200
170
|
|
201
171
|
}
|
202
172
|
|
@@ -206,234 +176,232 @@
|
|
206
176
|
|
207
177
|
|
208
178
|
|
179
|
+
|
180
|
+
|
181
|
+
// hito
|
182
|
+
|
183
|
+
if (action_flg) {
|
184
|
+
|
185
|
+
hitoX -= hitoSpeed.toFloat()
|
186
|
+
|
187
|
+
} else {
|
188
|
+
|
189
|
+
hitoX += hitoSpeed.toFloat()
|
190
|
+
|
191
|
+
}
|
192
|
+
|
193
|
+
if (hitoX < 0) hitoX = 0f
|
194
|
+
|
195
|
+
if (hitoX > frameside - hitoSize) hitoX = frameside - hitoSize.toFloat()
|
196
|
+
|
197
|
+
hito.x = hitoX
|
198
|
+
|
199
|
+
scoreLabel!!.text = "Score : $score"
|
200
|
+
|
201
|
+
}
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
private fun hitCheck() { // Orange
|
206
|
+
|
207
|
+
val kenCenterX = kenX + ken!!.width / 2
|
208
|
+
|
209
|
+
val kenCenterY = kenY + ken!!.height / 2
|
210
|
+
|
211
|
+
if (hitStatus(kenCenterX, kenCenterY)) {
|
212
|
+
|
213
|
+
kenX = -10.0f
|
214
|
+
|
215
|
+
score += 10
|
216
|
+
|
217
|
+
soundPlayer.playHitSound()
|
218
|
+
|
219
|
+
}
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
}
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
private fun hitStatus(centerX: Float, centerY: Float): Boolean {
|
228
|
+
|
229
|
+
return if (0 <= centerX && centerX <= hitoSize && hitoX <= centerY && centerY <= hitoX + hitoSize
|
230
|
+
|
231
|
+
) true else false
|
232
|
+
|
233
|
+
}
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
override fun onTouchEvent(event: MotionEvent): Boolean {
|
238
|
+
|
239
|
+
if (!start_flg) {
|
240
|
+
|
241
|
+
start_flg = true
|
242
|
+
|
243
|
+
val frame: FrameLayout = findViewById(R.id.frame);
|
244
|
+
|
245
|
+
frameside = frame.width;
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
hitoX = hito.x;
|
250
|
+
|
251
|
+
hitoSize = hito.height;
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
startLabel.visibility = View.GONE;
|
260
|
+
|
261
|
+
timer!!.schedule(object : TimerTask() {
|
262
|
+
|
263
|
+
override fun run() {
|
264
|
+
|
265
|
+
handler.post { changePos() }
|
266
|
+
|
267
|
+
}
|
268
|
+
|
269
|
+
}, 0, 20)
|
270
|
+
|
271
|
+
} else {
|
272
|
+
|
273
|
+
if (event.action == MotionEvent.ACTION_DOWN) {
|
274
|
+
|
275
|
+
action_flg = true
|
276
|
+
|
277
|
+
} else if (event.action == MotionEvent.ACTION_UP) {
|
278
|
+
|
279
|
+
action_flg = false
|
280
|
+
|
281
|
+
}
|
282
|
+
|
283
|
+
}
|
284
|
+
|
285
|
+
return true
|
286
|
+
|
287
|
+
}
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
override fun onBackPressed() {}
|
292
|
+
|
293
|
+
}
|
294
|
+
|
295
|
+
```
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
activity_main.xml
|
300
|
+
|
301
|
+
```
|
302
|
+
|
303
|
+
<?xml version="1.0" encoding="utf-8"?>
|
304
|
+
|
305
|
+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
306
|
+
|
307
|
+
xmlns:app="http://schemas.android.com/apk/res-auto"
|
308
|
+
|
309
|
+
xmlns:tools="http://schemas.android.com/tools"
|
310
|
+
|
311
|
+
android:layout_width="match_parent"
|
312
|
+
|
313
|
+
android:layout_height="match_parent"
|
314
|
+
|
315
|
+
tools:context=".MainActivity"
|
316
|
+
|
317
|
+
android:orientation="vertical">
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
<TextView
|
324
|
+
|
325
|
+
android:id="@+id/scoreLabel"
|
326
|
+
|
327
|
+
android:layout_width="match_parent"
|
328
|
+
|
329
|
+
android:layout_height="50dp"
|
330
|
+
|
331
|
+
android:text="Score : 300"
|
332
|
+
|
333
|
+
android:textSize="18sp"
|
334
|
+
|
335
|
+
android:paddingLeft="10dp"
|
336
|
+
|
337
|
+
android:gravity="center_vertical"/>
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
<FrameLayout
|
342
|
+
|
343
|
+
android:id="@+id/frame"
|
344
|
+
|
345
|
+
android:layout_width="match_parent"
|
346
|
+
|
347
|
+
android:layout_height="match_parent">
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
<TextView
|
352
|
+
|
353
|
+
android:id="@+id/startLabel"
|
354
|
+
|
355
|
+
android:layout_width="wrap_content"
|
356
|
+
|
357
|
+
android:layout_height="wrap_content"
|
358
|
+
|
359
|
+
android:text="タップしてスタート"
|
360
|
+
|
361
|
+
android:textSize="20sp"
|
362
|
+
|
363
|
+
android:layout_gravity="center"/>
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
<ImageView
|
368
|
+
|
369
|
+
android:id="@+id/hito"
|
370
|
+
|
371
|
+
android:layout_width="100dp"
|
372
|
+
|
373
|
+
android:layout_height="100dp"
|
374
|
+
|
375
|
+
android:layout_gravity="center_vertical"
|
376
|
+
|
377
|
+
android:src="@drawable/hito" />
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
<ImageView
|
382
|
+
|
383
|
+
android:id="@+id/ken"
|
384
|
+
|
385
|
+
android:layout_width="100dp"
|
386
|
+
|
387
|
+
android:layout_height="100dp"
|
388
|
+
|
389
|
+
android:src="@drawable/ken"/>
|
390
|
+
|
391
|
+
|
392
|
+
|
209
393
|
|
210
394
|
|
211
|
-
// hito
|
212
|
-
|
213
|
-
if (action_flg) {
|
214
|
-
|
215
|
-
hitoY -= hitoSpeed.toFloat()
|
216
|
-
|
217
|
-
} else {
|
218
|
-
|
219
|
-
hitoY += hitoSpeed.toFloat()
|
220
|
-
|
221
|
-
}
|
222
|
-
|
223
|
-
if (hitoY < 0) hitoY = 0f
|
224
|
-
|
225
|
-
if (hitoY > frameside - hitoSize) hitoY = frameside - hitoSize.toFloat()
|
226
|
-
|
227
|
-
hito.y = hitoY
|
228
|
-
|
229
|
-
scoreLabel!!.text = "Score : $score"
|
230
|
-
|
231
|
-
}
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
private fun hitCheck() { // Orange
|
236
|
-
|
237
|
-
val kenCenterX = kenX + ken!!.width / 2
|
238
|
-
|
239
|
-
val kenCenterY = kenY + ken!!.height / 2
|
240
|
-
|
241
|
-
if (hitStatus(kenCenterX, kenCenterY)) {
|
242
|
-
|
243
|
-
kenX = -10.0f
|
244
|
-
|
245
|
-
score += 10
|
246
|
-
|
247
|
-
soundPlayer.playHitSound()
|
248
|
-
|
249
|
-
}
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
}
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
private fun hitStatus(centerX: Float, centerY: Float): Boolean {
|
258
|
-
|
259
|
-
return if (0 <= centerX && centerX <= hitoSize && hitoY <= centerY && centerY <= hitoY + hitoSize
|
260
|
-
|
261
|
-
) true else false
|
262
|
-
|
263
|
-
}
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
override fun onTouchEvent(event: MotionEvent): Boolean {
|
268
|
-
|
269
|
-
if (!start_flg) {
|
270
|
-
|
271
|
-
start_flg = true
|
272
|
-
|
273
|
-
val frame: FrameLayout = findViewById(R.id.frame);
|
274
|
-
|
275
|
-
|
395
|
+
</FrameLayout>
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
396
|
+
|
280
|
-
|
397
|
+
|
398
|
+
|
281
|
-
|
399
|
+
</LinearLayout>
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
kenY =ken.y;
|
286
|
-
|
287
|
-
kenSize =ken.height;
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
startLabel.visibility = View.GONE;
|
292
|
-
|
293
|
-
timer!!.schedule(object : TimerTask() {
|
294
|
-
|
295
|
-
override fun run() {
|
296
|
-
|
297
|
-
handler.post { changePos() }
|
298
|
-
|
299
|
-
}
|
300
|
-
|
301
|
-
}, 0, 20)
|
302
|
-
|
303
|
-
} else {
|
304
|
-
|
305
|
-
if (event.action == MotionEvent.ACTION_DOWN) {
|
306
|
-
|
307
|
-
action_flg = true
|
308
|
-
|
309
|
-
} else if (event.action == MotionEvent.ACTION_UP) {
|
310
|
-
|
311
|
-
action_flg = false
|
312
|
-
|
313
|
-
}
|
314
|
-
|
315
|
-
}
|
316
|
-
|
317
|
-
return true
|
318
|
-
|
319
|
-
}
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
override fun onBackPressed() {}
|
324
|
-
|
325
|
-
}
|
326
400
|
|
327
401
|
```
|
328
402
|
|
329
403
|
|
330
404
|
|
331
|
-
activity_main.xml
|
332
|
-
|
333
|
-
```
|
334
|
-
|
335
|
-
<?xml version="1.0" encoding="utf-8"?>
|
336
|
-
|
337
|
-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
338
|
-
|
339
|
-
xmlns:app="http://schemas.android.com/apk/res-auto"
|
340
|
-
|
341
|
-
xmlns:tools="http://schemas.android.com/tools"
|
342
|
-
|
343
|
-
android:layout_width="match_parent"
|
344
|
-
|
345
|
-
android:layout_height="match_parent"
|
346
|
-
|
347
|
-
tools:context=".MainActivity"
|
348
|
-
|
349
|
-
android:orientation="vertical">
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
<TextView
|
356
|
-
|
357
|
-
android:id="@+id/scoreLabel"
|
358
|
-
|
359
|
-
android:layout_width="match_parent"
|
360
|
-
|
361
|
-
android:layout_height="50dp"
|
362
|
-
|
363
|
-
android:text="Score : 300"
|
364
|
-
|
365
|
-
android:textSize="18sp"
|
366
|
-
|
367
|
-
android:paddingLeft="10dp"
|
368
|
-
|
369
|
-
android:gravity="center_vertical"/>
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
<FrameLayout
|
374
|
-
|
375
|
-
android:id="@+id/frame"
|
376
|
-
|
377
|
-
android:layout_width="match_parent"
|
378
|
-
|
379
|
-
android:layout_height="match_parent">
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
<TextView
|
384
|
-
|
385
|
-
android:id="@+id/startLabel"
|
386
|
-
|
387
|
-
android:layout_width="wrap_content"
|
388
|
-
|
389
|
-
android:layout_height="wrap_content"
|
390
|
-
|
391
|
-
android:text="タップしてスタート"
|
392
|
-
|
393
|
-
android:textSize="20sp"
|
394
|
-
|
395
|
-
android:layout_gravity="center"/>
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
<ImageView
|
400
|
-
|
401
|
-
android:id="@+id/hito"
|
402
|
-
|
403
|
-
android:layout_width="100dp"
|
404
|
-
|
405
|
-
android:layout_height="100dp"
|
406
|
-
|
407
|
-
android:layout_gravity="center_vertical"
|
408
|
-
|
409
|
-
android:src="@drawable/hito" />
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
<ImageView
|
414
|
-
|
415
|
-
android:id="@+id/ken"
|
416
|
-
|
417
|
-
android:layout_width="100dp"
|
418
|
-
|
419
|
-
android:layout_height="100dp"
|
420
|
-
|
421
|
-
android:src="@drawable/ken"/>
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
</FrameLayout>
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
</LinearLayout>
|
432
|
-
|
433
|
-
```
|
434
|
-
|
435
|
-
|
436
|
-
|
437
405
|
### 試したこと
|
438
406
|
|
439
407
|
|
2
MainActivity更新
test
CHANGED
File without changes
|
test
CHANGED
@@ -54,8 +54,6 @@
|
|
54
54
|
|
55
55
|
private var frameside = 0
|
56
56
|
|
57
|
-
private var frameheight = 0
|
58
|
-
|
59
57
|
private var hitoSize = 0
|
60
58
|
|
61
59
|
private var kenSize = 0
|
@@ -72,7 +70,17 @@
|
|
72
70
|
|
73
71
|
private var kenY = 0f
|
74
72
|
|
75
|
-
|
73
|
+
private var syuriX = 0f
|
74
|
+
|
75
|
+
private var syuriY = 0f
|
76
|
+
|
77
|
+
private var yariX = 0f
|
78
|
+
|
79
|
+
private var yariY = 0f
|
80
|
+
|
81
|
+
private var yumiX = 0f
|
82
|
+
|
83
|
+
private var yumiY = 0f
|
76
84
|
|
77
85
|
// スピード
|
78
86
|
|
@@ -80,7 +88,11 @@
|
|
80
88
|
|
81
89
|
private var kenSpeed = 0
|
82
90
|
|
83
|
-
|
91
|
+
private var syuriSpeed = 0
|
92
|
+
|
93
|
+
private var yariSpeed = 0
|
94
|
+
|
95
|
+
private var yumiSpeed = 0
|
84
96
|
|
85
97
|
// Score
|
86
98
|
|
@@ -140,13 +152,27 @@
|
|
140
152
|
|
141
153
|
kenSpeed = Math.round(screenHeight / 60f)
|
142
154
|
|
143
|
-
|
155
|
+
syuriSpeed = Math.round(screenHeight / 36f)
|
156
|
+
|
144
|
-
|
157
|
+
yariSpeed = Math.round(screenHeight / 45f)
|
158
|
+
|
159
|
+
yumiSpeed = Math.round(screenHeight / 45f)
|
160
|
+
|
145
|
-
ken.x = -
|
161
|
+
ken.x = -100.0f
|
146
|
-
|
162
|
+
|
147
|
-
ken.y = -
|
163
|
+
ken.y = -100.0f
|
164
|
+
|
148
|
-
|
165
|
+
syuri.x = -100.0f
|
166
|
+
|
149
|
-
|
167
|
+
syuri.y = -100.0f
|
168
|
+
|
169
|
+
yari.x = -100.0f
|
170
|
+
|
171
|
+
yari.y = -100.0f
|
172
|
+
|
173
|
+
yumi.x = -100.0f
|
174
|
+
|
175
|
+
yumi.y = -100.0f
|
150
176
|
|
151
177
|
scoreLabel.text = "Score : 0f"
|
152
178
|
|
@@ -180,7 +206,9 @@
|
|
180
206
|
|
181
207
|
|
182
208
|
|
209
|
+
|
210
|
+
|
183
|
-
|
211
|
+
// hito
|
184
212
|
|
185
213
|
if (action_flg) {
|
186
214
|
|
@@ -196,7 +224,7 @@
|
|
196
224
|
|
197
225
|
if (hitoY > frameside - hitoSize) hitoY = frameside - hitoSize.toFloat()
|
198
226
|
|
199
|
-
hito
|
227
|
+
hito.y = hitoY
|
200
228
|
|
201
229
|
scoreLabel!!.text = "Score : $score"
|
202
230
|
|
@@ -220,108 +248,78 @@
|
|
220
248
|
|
221
249
|
}
|
222
250
|
|
251
|
+
|
252
|
+
|
253
|
+
}
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
private fun hitStatus(centerX: Float, centerY: Float): Boolean {
|
258
|
+
|
259
|
+
return if (0 <= centerX && centerX <= hitoSize && hitoY <= centerY && centerY <= hitoY + hitoSize
|
260
|
+
|
223
|
-
|
261
|
+
) true else false
|
262
|
+
|
224
|
-
|
263
|
+
}
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
override fun onTouchEvent(event: MotionEvent): Boolean {
|
268
|
+
|
225
|
-
|
269
|
+
if (!start_flg) {
|
270
|
+
|
226
|
-
|
271
|
+
start_flg = true
|
272
|
+
|
273
|
+
val frame: FrameLayout = findViewById(R.id.frame);
|
274
|
+
|
275
|
+
frameside = frame.height;
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
hitoY = hito.y;
|
280
|
+
|
281
|
+
hitoSize = hito.height;
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
kenY =ken.y;
|
286
|
+
|
287
|
+
kenSize =ken.height;
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
startLabel.visibility = View.GONE;
|
292
|
+
|
293
|
+
timer!!.schedule(object : TimerTask() {
|
294
|
+
|
227
|
-
|
295
|
+
override fun run() {
|
296
|
+
|
228
|
-
|
297
|
+
handler.post { changePos() }
|
298
|
+
|
299
|
+
}
|
300
|
+
|
301
|
+
}, 0, 20)
|
302
|
+
|
303
|
+
} else {
|
304
|
+
|
305
|
+
if (event.action == MotionEvent.ACTION_DOWN) {
|
306
|
+
|
307
|
+
action_flg = true
|
308
|
+
|
309
|
+
} else if (event.action == MotionEvent.ACTION_UP) {
|
310
|
+
|
229
|
-
ti
|
311
|
+
action_flg = false
|
230
312
|
|
231
313
|
}
|
232
314
|
|
233
|
-
|
234
|
-
|
235
|
-
// Game Over!
|
236
|
-
|
237
|
-
if (timer != null) {
|
238
|
-
|
239
|
-
timer!!.cancel()
|
240
|
-
|
241
|
-
timer = null
|
242
|
-
|
243
|
-
}
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
// 結果画面へ
|
252
|
-
|
253
|
-
val intent = Intent(applicationContext, ResultActivity::class.java)
|
254
|
-
|
255
|
-
intent.putExtra("SCORE", score)
|
256
|
-
|
257
|
-
startActivity(intent)
|
258
|
-
|
259
315
|
}
|
260
316
|
|
317
|
+
return true
|
318
|
+
|
261
319
|
}
|
262
320
|
|
263
321
|
|
264
322
|
|
265
|
-
private fun hitStatus(centerX: Float, centerY: Float): Boolean {
|
266
|
-
|
267
|
-
return if (0 <= centerX && centerX <= hitoSize && hitoY <= centerY && centerY <= hitoY + hitoSize
|
268
|
-
|
269
|
-
) true else false
|
270
|
-
|
271
|
-
}
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
override fun onTouchEvent(event: MotionEvent): Boolean {
|
276
|
-
|
277
|
-
if (!start_flg) {
|
278
|
-
|
279
|
-
start_flg = true
|
280
|
-
|
281
|
-
val frame: FrameLayout = findViewById(R.id.frame);
|
282
|
-
|
283
|
-
frameside = frame.height;
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
hitoY = hito.y;
|
288
|
-
|
289
|
-
hitoSize = hito.height;
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
startLabel.visibility = View.GONE;
|
294
|
-
|
295
|
-
timer!!.schedule(object : TimerTask() {
|
296
|
-
|
297
|
-
override fun run() {
|
298
|
-
|
299
|
-
handler.post { changePos() }
|
300
|
-
|
301
|
-
}
|
302
|
-
|
303
|
-
}, 0, 20)
|
304
|
-
|
305
|
-
} else {
|
306
|
-
|
307
|
-
if (event.action == MotionEvent.ACTION_DOWN) {
|
308
|
-
|
309
|
-
action_flg = true
|
310
|
-
|
311
|
-
} else if (event.action == MotionEvent.ACTION_UP) {
|
312
|
-
|
313
|
-
action_flg = false
|
314
|
-
|
315
|
-
}
|
316
|
-
|
317
|
-
}
|
318
|
-
|
319
|
-
return true
|
320
|
-
|
321
|
-
}
|
322
|
-
|
323
|
-
|
324
|
-
|
325
323
|
override fun onBackPressed() {}
|
326
324
|
|
327
325
|
}
|
1
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
避けるゲーム作成中、落下物が上から下まで落ちたきりで戻ってこない
|
test
CHANGED
File without changes
|