質問編集履歴

1

〈code〉内にソースコードを書きました。

2019/06/28 06:49

投稿

Alex_M
Alex_M

スコア32

test CHANGED
File without changes
test CHANGED
@@ -14,6 +14,8 @@
14
14
 
15
15
  ```
16
16
 
17
+ ```Processing
18
+
17
19
  int scene = 1;//ステージ
18
20
 
19
21
 
@@ -162,255 +164,317 @@
162
164
 
163
165
  //---------------------------------------------------↑ドアの部屋
164
166
 
165
- else if (scene == 2) {
166
-
167
- room();
168
-
169
- fill(#AFAFAF);
170
-
171
- rect(290, 320, 80, 80);//カギ1}
172
-
173
-
174
-
175
- if (a) {//a = カギ1GET
176
-
177
- room();
178
-
179
- textSize(30);
180
-
181
- fill(#FF0000);
182
-
183
- text("YOU GET A KEY1 !", 100, 280);
184
-
185
- c = true;
186
-
187
-
188
-
189
-
190
-
191
- //ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー↑2つ目の部屋+カギ1
192
-
193
- else if (scene == 3) {
194
-
195
- room();
196
-
197
-
198
-
199
- if (d) {//カギ2出現
200
-
201
- room();
202
-
203
- fill(#03FFF9);
204
-
205
- rect(290, 320, 80, 80);//カギ2
206
-
207
- e = true;
208
-
209
-
210
-
211
- if (f) {//カギ2GET
212
-
213
- room();
214
-
215
- textSize(30);
216
-
217
- fill(#FF0000);
218
-
219
- text("YOU GET A KEY2 !", 100, 280);
220
-
221
- g = true;
222
-
223
-
224
-
225
- //ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー↑3つ目の部屋+カギ2
226
-
227
- else if (scene==4) {
228
-
229
- room();
167
+ } else if (scene == 2) {
168
+
169
+ room();
170
+
171
+ fill(#AFAFAF);
172
+
173
+ rect(290, 320, 80, 80);//カギ1}
174
+
175
+
176
+
177
+ if (a) {//a = カギ1GET
178
+
179
+ room();
180
+
181
+ textSize(30);
182
+
183
+ fill(#FF0000);
184
+
185
+ text("YOU GET A KEY1 !", 100, 280);
186
+
187
+ c = true;
188
+
189
+
190
+
191
+
192
+
193
+ //ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー↑2つ目の部屋+カギ1
194
+
195
+ } else if (scene == 3) {
196
+
197
+ room();
198
+
199
+
200
+
201
+ if (d) {//カギ2出現
202
+
203
+ room();
204
+
205
+ fill(#03FFF9);
206
+
207
+ rect(290, 320, 80, 80);//カギ2
208
+
209
+ e = true;
210
+
211
+
212
+
213
+ if (f) {//カギ2GET
214
+
215
+ room();
216
+
217
+ textSize(30);
218
+
219
+ fill(#FF0000);
220
+
221
+ text("YOU GET A KEY2 !", 100, 280);
222
+
223
+ g = true;
224
+
225
+
226
+
227
+ //ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー↑3つ目の部屋+カギ2
228
+
229
+ } else if (scene==4) {
230
+
231
+ room();
232
+
233
+ }
234
+
235
+
236
+
237
+ if (g) {//カギ3出現
238
+
239
+ room();
240
+
241
+ fill(#FAFF03);
242
+
243
+ rect(290, 320, 80, 80);//カギ3
244
+
245
+
246
+
247
+
248
+
249
+ if (h) {//カギ3GET
250
+
251
+ room();
252
+
253
+ textSize(30);
254
+
255
+ fill(#FF0000);
256
+
257
+ text("YOU GET A KEY3 !", 100, 280);
258
+
259
+ b = true;
260
+
261
+
262
+
263
+ //ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー↑4つ目の部屋+カギ3
264
+
265
+ }
266
+
267
+ }
268
+
269
+ }
270
+
271
+ }
272
+
273
+ }
274
+
275
+ }
276
+
277
+ }
278
+
279
+ }
280
+
281
+ }
230
282
 
231
283
  }
232
284
 
233
-
234
-
235
- if (g) {//カギ3出現
236
-
237
- room();
238
-
239
- fill(#FAFF03);
240
-
241
- rect(290, 320, 80, 80);//カギ3
242
-
243
-
244
-
245
-
246
-
247
- if (h) {//カギ3GET
248
-
249
- room();
250
-
251
- textSize(30);
252
-
253
- fill(#FF0000);
254
-
255
- text("YOU GET A KEY3 !", 100, 280);
256
-
257
- b = true;
258
-
259
-
260
-
261
- //ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー↑4つ目の部屋+カギ3
285
+ void mousePressed() {
286
+
287
+ if (scene == 1) {
288
+
289
+ if (mouseX < 40 && mouseX > 0 && mouseY > 215 && mouseY < 255) {
290
+
291
+ scene = 4;
292
+
293
+ }
294
+
295
+
296
+
297
+ if (mouseX < 480 && mouseX > 440 && mouseY > 215 && mouseY < 255) {
298
+
299
+ scene = 2;
300
+
301
+ }
302
+
303
+
304
+
305
+ //if (i) {//扉クリック
306
+
307
+ //if (mouseX > 330 && mouseX < 440 && mouseY > 140 && mouseY < 370) {
308
+
309
+ //b = true;
310
+
311
+ //}
312
+
313
+
314
+
315
+
316
+
317
+
318
+
319
+ //ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー↑ドアの部屋
320
+
321
+ } else if (scene == 2) {
322
+
323
+ if (mouseX < 40 && mouseX > 0 && mouseY > 215 && mouseY < 255) {
324
+
325
+ scene = 1;
326
+
327
+ }
328
+
329
+
330
+
331
+ if (mouseX < 480 && mouseX > 440 && mouseY > 215 && mouseY < 255) {
332
+
333
+ scene = 3;
334
+
335
+ }
336
+
337
+ //if (c) {//カギ1拾ってからカギ2クリック
338
+
339
+ //if (mouseX > 290 && mouseX < 370 && mouseY > 320 && mouseY < 400) {//鍵1クリック
340
+
341
+ //d = true;
342
+
343
+ //}
344
+
345
+
346
+
347
+ //ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー↑2つ目の部屋
348
+
349
+ } else if (scene == 3) {
350
+
351
+ if (mouseX < 40 && mouseX > 0 && mouseY > 215 && mouseY < 255) {
352
+
353
+ scene = 2;
354
+
355
+ }
356
+
357
+
358
+
359
+ if (mouseX < 480 && mouseX > 440 && mouseY > 215 && mouseY < 255) {
360
+
361
+ scene = 4;
362
+
363
+ }
364
+
365
+
366
+
367
+ //if (e) {
368
+
369
+ //if (mouseX > 290 && mouseX < 370 && mouseY > 320 && mouseY < 400) {//鍵2クリック
370
+
371
+ //f = true;
372
+
373
+ //}
374
+
375
+
376
+
377
+ //ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー↑3つ目の部屋
378
+
379
+ } else if (scene == 4) {
380
+
381
+ if (mouseX < 40 && mouseX > 0 && mouseY > 215 && mouseY < 255) {
382
+
383
+ scene = 3;
384
+
385
+ }
386
+
387
+
388
+
389
+ if (mouseX < 480 && mouseX > 440 && mouseY > 215 && mouseY < 255) {
390
+
391
+ scene = 1;
392
+
393
+ }
394
+
395
+
396
+
397
+ //if (g) {
398
+
399
+ //if (mouseX > 290 && mouseX < 370 && mouseY > 320 && mouseY < 400) {//鍵3クリック
400
+
401
+ // h = true;
402
+
403
+ //}
262
404
 
263
405
  }
264
406
 
265
407
  }
266
408
 
409
+
410
+
411
+
412
+
413
+
414
+
415
+
416
+
417
+
418
+
419
+
420
+
421
+ void mouseClicked() {
422
+
423
+ if (scene == 1) {
424
+
425
+ if (i) {//扉クリック
426
+
427
+ if (mouseX > 330 && mouseX < 440 && mouseY > 140 && mouseY < 370) {
428
+
429
+ b = true;
430
+
431
+ } else if (scene == 2) {
432
+
433
+ if (c) {//カギ1拾ってからカギ2クリック
434
+
435
+ if (mouseX > 290 && mouseX < 370 && mouseY > 320 && mouseY < 400) {//鍵1クリック
436
+
437
+ d = true;
438
+
439
+ } else if (scene == 3) {
440
+
441
+ if (e) {
442
+
443
+ if (mouseX > 290 && mouseX < 370 && mouseY > 320 && mouseY < 400) {//鍵2クリック
444
+
445
+ f = true;
446
+
447
+ } else if (scene == 4) {
448
+
449
+ if (g) {
450
+
451
+ if (mouseX > 290 && mouseX < 370 && mouseY > 320 && mouseY < 400) {//鍵3クリック
452
+
453
+ h = true;
454
+
455
+ }
456
+
457
+ }
458
+
459
+ }
460
+
461
+ }
462
+
463
+ }
464
+
465
+ }
466
+
467
+ }
468
+
469
+ }
470
+
471
+ }
472
+
267
473
  }
268
474
 
269
- }
475
+
270
-
271
- void mousePressed() {
476
+
272
-
273
- if (scene == 1) {
274
-
275
- if (mouseX < 40 && mouseX > 0 && mouseY > 215 && mouseY < 255) {
276
-
277
- scene = 4;
278
-
279
- }
280
-
281
-
282
-
283
- if (mouseX < 480 && mouseX > 440 && mouseY > 215 && mouseY < 255) {
284
-
285
- scene = 2;
286
-
287
- }
288
-
289
-
290
-
291
- if (i) {//扉クリック
292
-
293
- if (mouseX > 330 && mouseX < 440 && mouseY > 140 && mouseY < 370) {
294
-
295
- b = true;
296
-
297
- }
298
-
299
- }
300
-
301
- }
302
-
303
- }
304
-
305
- //ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー↑ドアの部屋
306
-
307
-
308
-
309
- else if (scene == 2) {
310
-
311
- if (mouseX < 40 && mouseX > 0 && mouseY > 215 && mouseY < 255) {
312
-
313
- scene = 1;
314
-
315
- }
316
-
317
-
318
-
319
- if (mouseX < 480 && mouseX > 440 && mouseY > 215 && mouseY < 255) {
320
-
321
- scene = 3;
322
-
323
- }
324
-
325
- if (c) {//カギ1拾ってからカギ2クリック
326
-
327
- if (mouseX > 290 && mouseX < 370 && mouseY > 320 && mouseY < 400) {//鍵1クリック
328
-
329
- d = true;
330
-
331
- }
332
-
333
-
334
-
335
- //ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー↑2つ目の部屋
336
-
337
-
338
-
339
- else if (scene==3) {
340
-
341
- if (mouseX < 40 && mouseX > 0 && mouseY > 215 && mouseY < 255) {
342
-
343
- scene = 2;
344
-
345
- }
346
-
347
-
348
-
349
- if (mouseX < 480 && mouseX > 440 && mouseY > 215 && mouseY < 255) {
350
-
351
- scene = 4;
352
-
353
- }
354
-
355
-
356
-
357
- if (e) {
477
+ ```
358
-
359
- if (mouseX > 290 && mouseX < 370 && mouseY > 320 && mouseY < 400) {//鍵2クリック
360
-
361
- f = true;
362
-
363
- }
364
-
365
-
366
-
367
- //ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー↑3つ目の部屋
368
-
369
-
370
-
371
- else if (scene==4) {
372
-
373
- if (mouseX < 40 && mouseX > 0 && mouseY > 215 && mouseY < 255) {
374
-
375
- scene = 3;
376
-
377
- }
378
-
379
-
380
-
381
- if (mouseX < 480 && mouseX > 440 && mouseY > 215 && mouseY < 255) {
382
-
383
- scene = 1;
384
-
385
- }
386
-
387
-
388
-
389
- if (g) {
390
-
391
- if (mouseX > 290 && mouseX < 370 && mouseY > 320 && mouseY < 400) {//鍵3クリック
392
-
393
- h = true;
394
-
395
- }
396
-
397
- }
398
-
399
- }
400
-
401
- }
402
-
403
- }
404
-
405
- }
406
-
407
- }
408
-
409
- }
410
-
411
-
412
-
413
-
414
478
 
415
479
 
416
480