-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkurukuru.frm
1990 lines (1631 loc) · 49.5 KB
/
kurukuru.frm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
VERSION 5.00
Begin VB.Form Form1
AutoRedraw = -1 'True
BackColor = &H00808080&
BorderStyle = 1 '固定(実線)
Caption = "クルクルコッシー"
ClientHeight = 5835
ClientLeft = 3555
ClientTop = 2310
ClientWidth = 6255
FillStyle = 0 '塗りつぶし
BeginProperty Font
Name = "System"
Size = 13.5
Charset = 128
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "kurukuru.frx":0000
KeyPreview = -1 'True
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
PaletteMode = 1 'Z オーダー
ScaleHeight = 389
ScaleMode = 3 'ピクセル
ScaleWidth = 417
Begin VB.PictureBox Picture5
AutoRedraw = -1 'True
Height = 495
Left = 3600
Picture = "kurukuru.frx":030A
ScaleHeight = 435
ScaleWidth = 2115
TabIndex = 4
Top = 3600
Visible = 0 'False
Width = 2175
End
Begin VB.PictureBox Picture4
AutoRedraw = -1 'True
Height = 495
Left = 3600
Picture = "kurukuru.frx":060C
ScaleHeight = 435
ScaleWidth = 2115
TabIndex = 3
Top = 3000
Visible = 0 'False
Width = 2175
End
Begin VB.Timer Timer2
Enabled = 0 'False
Interval = 5000
Left = 960
Top = 240
End
Begin VB.PictureBox Picture3
AutoRedraw = -1 'True
Height = 495
Left = 3600
Picture = "kurukuru.frx":0CCA
ScaleHeight = 435
ScaleWidth = 1635
TabIndex = 2
Top = 2280
Visible = 0 'False
Width = 1695
End
Begin VB.PictureBox Picture2
AutoRedraw = -1 'True
Height = 615
Left = 4440
Picture = "kurukuru.frx":12B0
ScaleHeight = 555
ScaleWidth = 555
TabIndex = 1
Top = 240
Visible = 0 'False
Width = 615
End
Begin VB.PictureBox Picture1
AutoRedraw = -1 'True
BackColor = &H00808080&
Height = 975
Left = 5160
Picture = "kurukuru.frx":1BF2
ScaleHeight = 915
ScaleWidth = 555
TabIndex = 0
Top = 240
Visible = 0 'False
Width = 615
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 2000
Left = 240
Top = 240
End
Begin VB.Image Image3
Height = 360
Left = 3960
Picture = "kurukuru.frx":2034
Top = 5040
Visible = 0 'False
Width = 1560
End
Begin VB.Image Image2
Height = 375
Left = 3960
Picture = "kurukuru.frx":2596
Top = 4200
Visible = 0 'False
Width = 1560
End
Begin VB.Image Image1
Height = 1815
Left = 360
Stretch = -1 'True
Top = 1920
Visible = 0 'False
Width = 5535
End
Begin VB.Line Line1
BorderColor = &H000000FF&
X1 = 31
X2 = 208
Y1 = 56
Y2 = 56
End
Begin VB.Menu m01
Caption = "ゲーム(&G)"
Begin VB.Menu m11
Caption = "スタート(&N)"
Shortcut = {F2}
End
Begin VB.Menu m17
Caption = "-"
Visible = 0 'False
End
Begin VB.Menu m16
Caption = "一時停止(&P)"
Enabled = 0 'False
Shortcut = {F3}
End
Begin VB.Menu m14
Caption = "-"
End
Begin VB.Menu m02
Caption = "クルクルコッシーの終了(&X)"
End
End
Begin VB.Menu m03
Caption = "ルール(&R)"
Begin VB.Menu m35
Caption = "フィールドの広さ(&F)"
Begin VB.Menu m36
Caption = "狭い(&N)"
Index = 0
End
Begin VB.Menu m36
Caption = "中っくらい(&M)"
Index = 1
End
Begin VB.Menu m36
Caption = "広い(&W)"
Index = 2
End
End
Begin VB.Menu m04
Caption = "色の数(&C)"
Begin VB.Menu m25
Caption = "&2"
Index = 0
End
Begin VB.Menu m25
Caption = "&3"
Index = 1
End
Begin VB.Menu m25
Caption = "&4"
Index = 2
End
Begin VB.Menu m25
Caption = "&5"
Index = 3
End
Begin VB.Menu m25
Caption = "&6"
Index = 4
End
Begin VB.Menu m25
Caption = "&10"
Index = 5
End
Begin VB.Menu m25
Caption = "&256"
Index = 6
End
End
Begin VB.Menu m05
Caption = "つなげる数(&J)"
Begin VB.Menu m26
Caption = "&2"
Index = 0
End
Begin VB.Menu m26
Caption = "&3"
Index = 1
End
Begin VB.Menu m26
Caption = "&4"
Index = 2
End
Begin VB.Menu m26
Caption = "&5"
Index = 3
End
Begin VB.Menu m26
Caption = "&6"
Index = 4
End
Begin VB.Menu m26
Caption = "&10"
Index = 5
End
End
Begin VB.Menu m29
Caption = "ななめで(&D)"
Begin VB.Menu m30
Caption = "つながる(&T)"
Index = 0
End
Begin VB.Menu m30
Caption = "つながらない(&F)"
Index = 1
End
End
Begin VB.Menu m31
Caption = "まがって(&O)"
Begin VB.Menu m32
Caption = "つながる(&T)"
Index = 0
End
Begin VB.Menu m32
Caption = "つながらない(&F)"
Index = 1
End
End
Begin VB.Menu m18
Caption = "時間制限(&T)"
Visible = 0 'False
Begin VB.Menu m19
Caption = "なし(&F)"
Index = 0
End
Begin VB.Menu m19
Caption = "あり(&T)"
Index = 1
End
End
Begin VB.Menu m23
Caption = "ちびコッシーの出現頻度(&M)"
Begin VB.Menu m24
Caption = "出ない(&D)"
Index = 0
End
Begin VB.Menu m24
Caption = "たまに出る(&T)"
Index = 1
End
Begin VB.Menu m24
Caption = "ばんばん出る(&B)"
Index = 2
End
End
Begin VB.Menu m33
Caption = "-"
End
Begin VB.Menu m34
Caption = "初期状態に戻す(&I)"
End
End
Begin VB.Menu m22
Caption = "オプション(&O)"
Begin VB.Menu m12
Caption = "コッシーの降る速さ(&S)"
Begin VB.Menu m13
Caption = "ゆっくり(&S)"
Index = 0
End
Begin VB.Menu m13
Caption = "たらたら(&N)"
Index = 1
End
Begin VB.Menu m13
Caption = "すーっ(&F)"
Index = 2
End
Begin VB.Menu m13
Caption = "だーっ(&V)"
Index = 3
End
Begin VB.Menu m13
Caption = "ばーっ(&M)"
Index = 4
End
End
Begin VB.Menu m20
Caption = "下キーを押したとき(&D)"
Begin VB.Menu m21
Caption = "じわじわ落ちる(&S)"
Index = 0
End
Begin VB.Menu m21
Caption = "一気に落ちる(&F)"
Index = 1
End
End
Begin VB.Menu m27
Caption = "効果音(&E)"
Begin VB.Menu m28
Caption = "&ON"
Index = 0
End
Begin VB.Menu m28
Caption = "O&FF"
Index = 1
End
End
Begin VB.Menu m37
Caption = "&NEXTコッシーのプレフェッチ"
Begin VB.Menu m38
Caption = "しない(&N)"
Index = 0
End
Begin VB.Menu m38
Caption = "&1組だけ"
Index = 1
End
Begin VB.Menu m38
Caption = "&2組まで"
Index = 2
End
Begin VB.Menu m38
Caption = "&3組まで"
Index = 3
End
Begin VB.Menu m38
Caption = "&4"
Index = 4
Visible = 0 'False
End
Begin VB.Menu m38
Caption = "&5"
Index = 5
Visible = 0 'False
End
End
End
Begin VB.Menu m06
Caption = "ヘルプ(&H)"
Begin VB.Menu m07
Caption = "トピックの検索(&H)"
Visible = 0 'False
End
Begin VB.Menu m10
Caption = "操作方法(&K)..."
End
Begin VB.Menu m08
Caption = "-"
End
Begin VB.Menu m09
Caption = "バージョン情報(&A)..."
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'
' クルクルコッシー
'
'
' 作成:越川 康則
'
'
Option Explicit
Const Kabe = -2
Const Kara = -1
Const TenmetsuDelayTime = 0.3
Dim StageXSize
Dim StageYSize
Const StageXSizeMaxLimit = 15
Const StageYSizeMaxLimit = 20
Const ScoreDrawX = 500 '連鎖表示の始まるX
Const ScoreDrawY = 110 '連鎖表示の始まるY
Const DrawNextColorMax = 5 '配列のための最高値 実際は3まで
Dim ScoreHideX
Dim FieldSizeScoreXHosei 'フィールドサイズによるスコア表示Xの補正
' x y
' small 4 7
' middle 6 11
' large 8 15
'Z(x,y) -2 壁 , -1 空、小さいのは1000以上
Dim Z(0 To StageXSizeMaxLimit + 1, -1 To StageYSizeMaxLimit + 1)
Dim KesuZ(1 To StageXSizeMaxLimit, 0 To StageYSizeMaxLimit)
Dim Ochiteru
Dim px(0 To 1), py(0 To 1) ' コッシーのx、y
Dim NowColor(0 To 1)
Dim NextColor(0 To 1, 0 To 50) ' 次のコッシーの色 50はなんとなく
Dim PuyoMuki ' コッシーの向き 0 上 1 左 2 下 3 右
Dim ColorMax
Dim Narabe
Dim ChibiKuruRitu ' ちびコッシーが出る率
Dim Mageru ' 曲げるのを認める
Dim PuyoColor(255)
Dim Score
Dim NokoriTime ' タイムアタック時の残りタイム
Dim Monokuro ' モノクロディスプレイモード
Dim Koma ' 1回のタイマーで何コマ落ちるか
Dim QuickTurnFlag
Dim NextColorPrefetch ' Nextコッシーのプレフェッチをいくつするか
'
' コッシーを書きます。
'
Public Sub PutPuyo(x, y, c)
Select Case c
Case Kara
DrawKara x, y
Case Kabe
DrawKabe x, y
Case Is < 1000 '1000未満なら普通のコッシーを書く
DrawKara x, y
Form1.FillStyle = 0
Form1.FillColor = PuyoColor(c)
Circle (x * 30 + 15, y * 30 + 15), 14, PuyoColor(c), , , 0.95
Form1.FillColor = 0
Circle (x * 30 + 15 - 5, y * 30 + 15 - 5), 3, 0, , , 2
Circle (x * 30 + 15 + 5, y * 30 + 15 - 5), 3, 0, , , 2
If Monokuro Then ' モノクロモードならば
Select Case c Mod 4 ' 4種類ごとに口の形を変える
Case 0
Form1.FillStyle = 1
Circle (x * 30 + 15, y * 30 + 15 + 2), 8, 0, -3.14, -0.01
Case 1
Form1.FillStyle = 0
Circle (x * 30 + 15, y * 30 + 15 + 2), 8, 0, -3.14, -0.01
Case 2
Form1.FillStyle = 1
Circle (x * 30 + 15, y * 30 + 15 + 6), 8, 0, , , 0.6
Case 3
Form1.FillStyle = 0
Circle (x * 30 + 15, y * 30 + 15 + 6), 8, 0, , , 0.6
End Select
Else
Form1.FillStyle = 1
Circle (x * 30 + 15, y * 30 + 15 + 2), 8, 0, -3.14, -0.01
End If
Case Is >= 1000 ' ちびコッシーを書く
DrawKara x, y
Form1.FillStyle = 0
Form1.FillColor = PuyoColor(c - 1000)
Circle (x * 30 + 15, y * 30 + 15), 8, PuyoColor(c - 1000), , , 0.95
Form1.FillColor = 0
Circle (x * 30 + 15 - 3, y * 30 + 15 - 3), 2, 0, , , 2
Circle (x * 30 + 15 + 3, y * 30 + 15 - 3), 2, 0, , , 2
If Monokuro Then
Select Case c Mod 4 ' 4種類ごとに口の形を変える
Case 0
Form1.FillStyle = 1
Circle (x * 30 + 15, y * 30 + 15 + 2), 4, 0, -3.14, -0.01
Case 1
Form1.FillStyle = 0
Circle (x * 30 + 15, y * 30 + 15 + 2), 4, 0, -3.14, -0.01
Case 2
Form1.FillStyle = 1
Circle (x * 30 + 15, y * 30 + 15 + 4), 3, 0, , , 0.6
Case 3
Form1.FillStyle = 0
Circle (x * 30 + 15, y * 30 + 15 + 4), 3, 0, , , 0.6
End Select
Else
Form1.FillStyle = 1
Circle (x * 30 + 15, y * 30 + 15 + 2), 4, 0, -3.14, -0.01
End If
End Select
End Sub
'
' キーを押したときの処理
'
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim PlusX, PlusY
Dim ToPuyoMuki
Dim i
Dim OtosuKoma
Static QuickTurnKeyCode
'Debug.Print KeyCode, Shift, PuyoMuki
If Ochiteru And m16.Checked = False Then
Select Case KeyCode
Case vbKeyS, vbKeyD, vbKeyNumpad8
ImanoPuyoKesu
QuickTurn
ImanoPuyoKaku
Case vbKeyC, vbKeyZ, vbKeyX, vbKeyNumpad5
' 回転
Select Case KeyCode
Case vbKeyNumpad5, vbKeyX
ToPuyoMuki = (PuyoMuki - 1) And 3
Case vbKeyZ, vbKeyC
ToPuyoMuki = (PuyoMuki + 1) And 3
End Select
Select Case ToPuyoMuki
Case 0
PlusX = 0
PlusY = -1
Case 1
PlusX = -1
PlusY = 0
Case 2
PlusX = 0
PlusY = 1
Case 3
PlusX = 1
PlusY = 0
End Select
If Z(px(0) + PlusX, int2(py(0) + PlusY)) = Kara Then ' まわす
PuyoMuki = ToPuyoMuki
ImanoPuyoKesu
px(1) = px(0) + PlusX
py(1) = py(0) + PlusY
ImanoPuyoKaku
Else
If PlusX <> 0 And Z(px(0) + -PlusX, int2(py(0))) = Kara Then 'ずれてまわす
PuyoMuki = ToPuyoMuki
ImanoPuyoKesu
px(1) = px(0)
py(1) = py(0)
px(0) = px(0) + -PlusX
ImanoPuyoKaku
Else ' まわせないとき
' クイックターン候補
If Z(px(0) - 1, int2(py(0))) <> Kara And Z(px(1) - 1, int2(py(1))) <> Kara And Z(px(0) + 1, int2(py(0))) <> Kara And Z(px(1) + 1, int2(py(1))) <> Kara Then
'Beep 'for Debug
If QuickTurnFlag = True And KeyCode = QuickTurnKeyCode Then
' クイックターン
ImanoPuyoKesu
QuickTurn
ImanoPuyoKaku
QuickTurnFlag = False
Else
QuickTurnKeyCode = KeyCode
QuickTurnFlag = True
End If
Else
' 下に何かあるために回せない
End If
End If
End If
Case 39, 102 ' 右へ移動 → = 39 , テンキー6 = 102
If Z(px(0) + 1, int2(py(0))) = Kara And Z(px(1) + 1, int2(py(1))) = Kara Then
ImanoPuyoKesu
For i = 0 To 1
px(i) = px(i) + 1
Next
ImanoPuyoKaku
End If
Case 37, 100 ' 左へ移動 ← = 37 , テンキー4 = 100
If Z(px(0) - 1, int2(py(0))) = Kara And Z(px(1) - 1, int2(py(1))) = Kara Then
ImanoPuyoKesu
For i = 0 To 1
px(i) = px(i) - 1
Next
ImanoPuyoKaku
End If
Case 40, 98 ' 落とす ↓ = 40 , テンキー2 = 98
OtosuKoma = Koma ' 落とすコマの数を決める
OtosuKoma = 1 / 2 ' 無条件で1にする。Version 54.05から ' 無条件で1 / 2にする。Version 54.06から
ImanoPuyoKesu
If m21(0).Checked = True Then
If Z(px(0), int2(py(0) + OtosuKoma)) = Kara And Z(px(1), int2(py(1) + OtosuKoma)) = Kara Then
For i = 0 To 1
py(i) = py(i) + OtosuKoma
Next
Else
' このDOは最大一回しか回らない。
Do While (Z(px(0), int2(py(0) + OtosuKoma)) = Kara And Z(px(1), int2(py(1) + OtosuKoma)) = Kara)
For i = 0 To 1
py(i) = py(i) + OtosuKoma
Next
Loop
For i = 0 To 1
py(i) = int2(py(i))
Next
End If
Else
Do While (Z(px(0), int2(py(0) + OtosuKoma)) = Kara And Z(px(1), int2(py(1) + OtosuKoma)) = Kara)
For i = 0 To 1
py(i) = py(i) + OtosuKoma
Next
Loop
For i = 0 To 1
py(i) = int2(py(i))
Next
End If
ImanoPuyoKaku
End Select
End If
End Sub
'
' 一番最初に
'
Private Sub Form_Load()
Randomize
' レジストリから初期値読み込み
m25_Click Val(GetSetting("Kurukuru", "Config", "Color", 2))
m26_Click Val(GetSetting("Kurukuru", "Config", "Narabe", 1))
m24_Click Val(GetSetting("Kurukuru", "Config", "ChibiKuru", 1))
m13_Click Val(GetSetting("Kurukuru", "Config", "KuruDownSpeed", 0))
m21_Click Val(GetSetting("Kurukuru", "Config", "DownKey", 0))
m19_Click Val(GetSetting("Kurukuru", "Config", "GameMode", 0))
m28_Click Val(GetSetting("Kurukuru", "Config", "SoundEffect", 0))
m30_Click Val(GetSetting("Kurukuru", "Config", "Naname", 1))
m32_Click Val(GetSetting("Kurukuru", "Config", "Magaru", 0))
m36_Click Val(GetSetting("Kurukuru", "Config", "FieldSize", 0))
m38_Click Val(GetSetting("Kurukuru", "Config", "NextColorPrefetch", 1))
Mageru = True
Monokuro = (InStr(LCase(Command$), "/m") > 0)
GameJunbi
MakeField
' Formを画面中央に移動する。GameJunbiでFormの大きさを変えたあと。
Form1.Left = (Screen.Width - Form1.Width) / 2
Form1.Top = (Screen.Height - Form1.Height) / 2
DrawScore 0
MakePuyoColor
End Sub
'
' コッシーを消すために数えて、しるしをつける。
'
' 引き数 なし
' 返し値 消すためにしるしをつけたコッシーの数
' KesuZ は変更する
'
Public Function KesuTameni()
ReDim KariZ(0 To StageXSize + 1, -1 To StageYSize + 1)
Dim x, y
Dim xx, yy
Dim xxx, yyy
Dim CheckBangou
Dim TunagetaKazu
Dim STunagetaKazu
Dim ReturnValue
'***************** 消し判定
ReturnValue = 0
CheckBangou = 0
For x = 1 To StageXSize
For y = 0 To StageYSize
KesuZ(x, y) = 0
Next
Next
If m32(0).Checked = True Then ' 曲げるモードなら
For x = 1 To StageXSize
For y = 0 To StageYSize
If Z(x, y) <> Kara And KariZ(x, y) = 0 And Z(x, y) < 1000 Then
CheckBangou = CheckBangou + 1
KariZ(x, y) = CheckBangou
TunagetaKazu = 1
Do
STunagetaKazu = TunagetaKazu
For xxx = 1 To StageXSize
For yyy = 0 To StageYSize
If KariZ(xxx, yyy) = CheckBangou Then
For xx = -1 To 1
For yy = -1 To 1
If NanameTrueOrFalse(m30(0).Checked, xx, yy) Then '
If Z(xxx, yyy) = Z(xxx + xx, yyy + yy) And KariZ(xxx + xx, yyy + yy) <> CheckBangou Then
TunagetaKazu = TunagetaKazu + 1
KariZ(xxx + xx, yyy + yy) = CheckBangou
End If
End If
Next
Next
End If
Next
Next
Loop Until TunagetaKazu = STunagetaKazu
End If
If TunagetaKazu >= Narabe Then ' Val をつけたほうが良いのかな。
For xx = 1 To StageXSize
For yy = 0 To StageYSize
If KariZ(xx, yy) = CheckBangou Then
ReturnValue = ReturnValue + 1
KariZ(xx, yy) = -1
KesuZ(xx, yy) = True
End If
Next
Next
End If
Next
Next
Else ' 曲げないモードなら
For x = 1 To StageXSize
For y = 0 To StageYSize
KariZ(x, y) = 0
Next
Next
For x = 1 To StageXSize
For y = 0 To StageYSize
If Z(x, y) <> Kara And Z(x, y) < 1000 Then
For xx = -1 To 1
For yy = -1 To 1
If NanameTrueOrFalse(m30(0).Checked, xx, yy) Then
TunagetaKazu = 1
CheckBangou = CheckBangou + 1
Do While Z(x + xx * TunagetaKazu, y + yy * TunagetaKazu) = Z(x, y)
KariZ(x + xx * TunagetaKazu, y + yy * TunagetaKazu) = CheckBangou
TunagetaKazu = TunagetaKazu + 1
Loop
If TunagetaKazu >= Narabe Then ' Val をつけたほうが良いのかな。
For xxx = 1 To StageXSize
For yyy = 0 To StageYSize
If KariZ(xxx, yyy) = CheckBangou Then
KariZ(xxx, yyy) = -1
KesuZ(xxx, yyy) = True
End If
Next
Next
End If
End If
Next
Next
End If
Next
Next
For xxx = 1 To StageXSize
For yyy = 0 To StageYSize
If KesuZ(xxx, yyy) = True Then
ReturnValue = ReturnValue + 1
End If
Next
Next
End If
KesuTameni = ReturnValue
End Function
'
' クルクルコッシーの終了
'
Private Sub m02_Click()
End
End Sub
'
' ヘルプ
'
Private Sub m07_Click()
MsgBox "まだ出来ていないのです。"
End Sub
'
' バージョン情報
'
Private Sub m09_Click()
About.Timer1.Enabled = False
About.Show 1
End Sub
'
'おとすよん
'
Public Sub Otosu()
Dim i, y, x
For i = 0 To StageYSize
For y = StageYSize To 0 Step -1
For x = 1 To StageXSize
If Z(x, y) = Kara Then
Z(x, y) = Z(x, y - 1)
' PutPuyo x, y, Z(x, y)
Z(x, y - 1) = Kara
' PutPuyo x, y - 1, Kara
End If
Next
Next
Next
End Sub
'
' フィールドの状態をそのまま富豪的に表示します。
'
' 引き数 なし
' 返し値 なし
'
Public Sub FugouHyouji()
Dim y, x
For y = 0 To StageYSize
For x = 1 To StageXSize
PutPuyo x, y, Z(x, y)
Next
Next
End Sub
'
' コッシーの色を256色設定します。
'
Public Sub MakePuyoColor()
Dim i, j, Flag
PuyoColor(0) = RGB(0, 255, 0)
PuyoColor(1) = RGB(255, 255, 0)
PuyoColor(2) = RGB(255, 0, 0)
PuyoColor(3) = RGB(0, 160, 255)
PuyoColor(4) = RGB(255, 128, 255)
PuyoColor(5) = RGB(0, 255, 255)
PuyoColor(6) = RGB(256, 128, 64)
PuyoColor(7) = RGB(0, 160, 0)
PuyoColor(8) = RGB(192, 192, 0)
PuyoColor(9) = RGB(192, 64, 192)
For i = 10 To 255
Do
DoEvents ' 永久ループ防止用
Flag = True
Do
PuyoColor(i) = RGB(Int(Rnd * 9) * 32, Int(Rnd * 9) * 32, Int(Rnd * 9) * 32)
Loop Until ColorSa(RGB(0, 0, 0), PuyoColor(i)) > 200
For j = 0 To i - 1
'If ColorSa(PuyoColor(j), PuyoColor(i)) <= 10 Then
If PuyoColor(j) = PuyoColor(i) Then
Flag = False
Exit For
End If
Next
Loop Until Flag = True
Next
End Sub
'
' 消して落として表示する
'
' 引き数 なし
' 返し値 なし
'
Public Sub KeshiteOtoshiteHyouji()
Dim Rensame
Dim KeshitaPuyoKazu
Dim KeshitaPuyoKazuTotal
Dim ScoreUp
Dim ScoreUpTotal
Rensame = 0
KeshitaPuyoKazuTotal = 0
DrawRensa 0, 0, 0
Ochiteru = False
Do
Otosu ' 1回目のループは置いたのを落とす、のを修正した。
FugouHyouji
Form1.Refresh
Rensame = Rensame + 1
KeshitaPuyoKazu = KesuTameni ' 消すためにかぞえる。
If KeshitaPuyoKazu > 0 Then
If Rensame >= 2 Then
Delay TenmetsuDelayTime
Form1.Refresh
End If
If m28(0).Checked Then
SoundKurukuru
End If
Kesutenmetu
End If
Kesu ' 消す。
If KeshitaPuyoKazu > 0 Then
KeshitaPuyoKazuTotal = KeshitaPuyoKazuTotal + KeshitaPuyoKazu
ScoreUp = ((2 ^ (Rensame - 1)) * KeshitaPuyoKazu) * 100 ' * 100 はVersion 54.07から
DrawRensa Rensame, KeshitaPuyoKazu, ScoreUp
ScoreUpTotal = ScoreUpTotal + ScoreUp
End If
Loop Until KeshitaPuyoKazu = 0 '消したコッシーが0個になるまでループを続ける。
FugouHyouji
If Rensame > 1 Then
DrawRensaTotal Rensame, KeshitaPuyoKazuTotal, ScoreUpTotal
End If
Score = Score + ScoreUpTotal
DrawScore Score
End Sub
'
' 2つの変数をSWAPします。
'
' 引き数 2つの変数
' 返し値 なし
'
Public Sub Swap(a, b)
Dim c
c = a
a = b
b = c
End Sub
'
' 次のコッシーを表示します。
'
Public Sub PutNextPuyo()
Dim i
For i = 0 To DrawNextColorMax - 1
Line ((StageXSize + 2.5 + i * 1.5) * 30, 2 * 30)-Step(30, 60), Form1.BackColor, BF
Next