Created
November 22, 2018 15:39
-
-
Save xtpor/1fde4fb83f0f91f5f4afcd08d8c3b786 to your computer and use it in GitHub Desktop.
A excerpt of the code from my snake game dated back to 12/11/2018
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Class Form1 | |
Public Apath As Application | |
Public Filepath As String = Apath.StartupPath & "\GamePicture\" | |
Public XY() As Integer | |
Public FoodXY As Integer | |
Public Loca As String = "Left" | |
Public Marks As Integer | |
Public Time As Integer | |
Public Ball As Boolean = False | |
Public LastLoca As String | |
Dim a, b, c, d, g, f As Byte | |
Sub Movement(ByVal Location As String) | |
Dim speical As Boolean = False | |
Dim i As Integer = 1 | |
XY(30) = XY(29) | |
XY(29) = XY(28) | |
XY(28) = XY(27) | |
XY(27) = XY(26) | |
XY(26) = XY(25) | |
XY(25) = XY(24) | |
XY(24) = XY(23) | |
XY(23) = XY(22) | |
XY(22) = XY(21) | |
XY(21) = XY(20) | |
XY(20) = XY(19) | |
XY(19) = XY(18) | |
XY(18) = XY(17) | |
XY(17) = XY(16) | |
XY(16) = XY(15) | |
XY(15) = XY(14) | |
XY(14) = XY(13) | |
XY(13) = XY(12) | |
XY(12) = XY(11) | |
XY(11) = XY(10) | |
XY(10) = XY(9) | |
XY(9) = XY(8) | |
XY(8) = XY(7) | |
XY(7) = XY(6) | |
XY(6) = XY(5) | |
XY(5) = XY(4) | |
XY(4) = XY(3) | |
XY(3) = XY(2) | |
XY(2) = XY(1) | |
XY(1) = XY(0) | |
ClearImage() | |
'"up" | |
If XY(0) = 0 And Location = "up" Then | |
XY(0) = 132 | |
speical = True | |
End If | |
If XY(0) = 1 And Location = "up" Then | |
XY(0) = 133 | |
speical = True | |
End If | |
If XY(0) = 2 And Location = "up" Then | |
XY(0) = 134 | |
speical = True | |
End If | |
If XY(0) = 3 And Location = "up" Then | |
XY(0) = 135 | |
speical = True | |
End If | |
If XY(0) = 4 And Location = "up" Then | |
XY(0) = 136 | |
speical = True | |
End If | |
If XY(0) = 5 And Location = "up" Then | |
XY(0) = 137 | |
speical = True | |
End If | |
If XY(0) = 6 And Location = "up" Then | |
XY(0) = 138 | |
speical = True | |
End If | |
If XY(0) = 7 And Location = "up" Then | |
XY(0) = 139 | |
speical = True | |
End If | |
If XY(0) = 8 And Location = "up" Then | |
XY(0) = 140 | |
speical = True | |
End If | |
If XY(0) = 9 And Location = "up" Then | |
XY(0) = 141 | |
speical = True | |
End If | |
If XY(0) = 10 And Location = "up" Then | |
XY(0) = 142 | |
speical = True | |
End If | |
If XY(0) = 11 And Location = "up" Then | |
XY(0) = 143 | |
speical = True | |
End If | |
If XY(0) = 12 And Location = "up" Then | |
XY(0) = 144 | |
speical = True | |
End If | |
'"right" | |
If XY(0) = 12 And Location = "right" Then | |
XY(0) = 1 | |
speical = True | |
End If | |
If XY(0) = 24 And Location = "right" Then | |
XY(0) = 13 | |
speical = True | |
End If | |
If XY(0) = 36 And Location = "right" Then | |
XY(0) = 25 | |
speical = True | |
End If | |
If XY(0) = 48 And Location = "right" Then | |
XY(0) = 37 | |
speical = True | |
End If | |
If XY(0) = 60 And Location = "right" Then | |
XY(0) = 49 | |
speical = True | |
End If | |
If XY(0) = 72 And Location = "right" Then | |
XY(0) = 61 | |
speical = True | |
End If | |
If XY(0) = 84 And Location = "right" Then | |
XY(0) = 73 | |
speical = True | |
End If | |
If XY(0) = 96 And Location = "right" Then | |
XY(0) = 85 | |
speical = True | |
End If | |
If XY(0) = 108 And Location = "right" Then | |
XY(0) = 97 | |
speical = True | |
End If | |
If XY(0) = 120 And Location = "right" Then | |
XY(0) = 109 | |
speical = True | |
End If | |
If XY(0) = 132 And Location = "right" Then | |
XY(0) = 121 | |
speical = True | |
End If | |
If XY(0) = 144 And Location = "right" Then | |
XY(0) = 133 | |
speical = True | |
End If | |
'"down" | |
If XY(0) = 133 And Location = "down" Then | |
XY(0) = 1 | |
speical = True | |
End If | |
If XY(0) = 134 And Location = "down" Then | |
XY(0) = 2 | |
speical = True | |
End If | |
If XY(0) = 135 And Location = "down" Then | |
XY(0) = 3 | |
speical = True | |
End If | |
If XY(0) = 136 And Location = "down" Then | |
XY(0) = 4 | |
speical = True | |
End If | |
If XY(0) = 137 And Location = "down" Then | |
XY(0) = 5 | |
speical = True | |
End If | |
If XY(0) = 138 And Location = "down" Then | |
XY(0) = 6 | |
speical = True | |
End If | |
If XY(0) = 139 And Location = "down" Then | |
XY(0) = 7 | |
speical = True | |
End If | |
If XY(0) = 140 And Location = "down" Then | |
XY(0) = 8 | |
speical = True | |
End If | |
If XY(0) = 141 And Location = "down" Then | |
XY(0) = 9 | |
speical = True | |
End If | |
If XY(0) = 142 And Location = "down" Then | |
XY(0) = 10 | |
speical = True | |
End If | |
If XY(0) = 143 And Location = "down" Then | |
XY(0) = 11 | |
speical = True | |
End If | |
If XY(0) = 144 And Location = "down" Then | |
XY(0) = 12 | |
speical = True | |
End If | |
'"left" | |
If XY(0) = 1 And Location = "left" Then | |
XY(0) = 12 | |
speical = True | |
End If | |
If XY(0) = 13 And Location = "left" Then | |
XY(0) = 24 | |
speical = True | |
End If | |
If XY(0) = 25 And Location = "left" Then | |
XY(0) = 36 | |
speical = True | |
End If | |
If XY(0) = 37 And Location = "left" Then | |
XY(0) = 48 | |
speical = True | |
End If | |
If XY(0) = 49 And Location = "left" Then | |
XY(0) = 60 | |
speical = True | |
End If | |
If XY(0) = 61 And Location = "left" Then | |
XY(0) = 72 | |
speical = True | |
End If | |
If XY(0) = 73 And Location = "left" Then | |
XY(0) = 84 | |
speical = True | |
End If | |
If XY(0) = 85 And Location = "left" Then | |
XY(0) = 96 | |
speical = True | |
End If | |
If XY(0) = 97 And Location = "left" Then | |
XY(0) = 108 | |
speical = True | |
End If | |
If XY(0) = 109 And Location = "left" Then | |
XY(0) = 120 | |
speical = True | |
End If | |
If XY(0) = 121 And Location = "left" Then | |
XY(0) = 132 | |
speical = True | |
End If | |
If XY(0) = 133 And Location = "left" Then | |
XY(0) = 144 | |
speical = True | |
End If | |
If speical = False Then | |
Select Case Location | |
Case Is = "left" | |
XY(0) -= 1 | |
Case Is = "right" | |
XY(0) += 1 | |
Case Is = "up" | |
XY(0) -= 12 | |
Case Is = "down" | |
XY(0) += 12 | |
End Select | |
End If | |
ChImage(FoodXY, Filepath & "Food.png") | |
ChImage(XY(0), Filepath & Location & ".png") | |
Do While i <= Marks And i <> UBound(XY, 1) | |
ChImage(XY(i), Filepath & Ball & ".png") | |
i += 1 | |
Loop | |
If XY(0) = FoodXY Then | |
Marks += 1 | |
RandomToFood() | |
End If | |
For i = 1 To Marks | |
If i > UBound(XY, 1) Then | |
Exit Sub | |
End If | |
If XY(0) = XY(i) Then | |
Timer1.Enabled = False | |
Timer2.Enabled = False | |
Panel2.Visible = True | |
PicBoxEndMark1.Image = Image.FromFile(Filepath & Mid(Format(Marks, "00"), 1, 1) & ".Png") | |
PicBoxEndMark2.Image = Image.FromFile(Filepath & Mid(Format(Marks, "00"), 2, 1) & ".Png") | |
End If | |
Next | |
Ball = Not Ball | |
End Sub | |
Sub RandomToFood() | |
Randomize() | |
Dim i As Integer | |
Dim ok As Boolean = False | |
Do | |
ok = True | |
FoodXY = Int(Rnd() * 143) + 1 | |
For i = 0 To Marks | |
If i > UBound(XY, 1) Then | |
Exit Sub | |
End If | |
If FoodXY = XY(i) Then | |
ok = False | |
End If | |
Next | |
Loop Until ok = True | |
End Sub | |
Private Sub Form1_Load() Handles MyBase.Load | |
Panel1.Left = 0 | |
Panel1.Top = 0 | |
Panel2.Left = 0 | |
Panel2.Top = 0 | |
Panel3.Left = 0 | |
Panel3.Top = 0 | |
Panel4.Left = 0 | |
Panel4.Top = 0 | |
Panel5.Left = 0 | |
Panel5.Top = 0 | |
Panel2.Visible = False | |
Panel3.Visible = True | |
Panel4.Visible = False | |
Panel5.Visible = False | |
ReDim XY(144) | |
Panel1.Visible = False | |
Timer1.Interval = 300 | |
Timer2.Interval = 1000 | |
'Load Form | |
ClearImage() | |
'Loading Num Marks&Time Image | |
PicBoxmark.Image = Image.FromFile(Filepath & "Marks.png") | |
PicBoxTime.Image = Image.FromFile(Filepath & "Times.png") | |
PicBoxmrkNum1.Image = Image.FromFile(Filepath & Mid(Format(Marks, "00"), 1, 1) & ".Png") | |
PicBoxmrkNum2.Image = Image.FromFile(Filepath & Mid(Format(Marks, "00"), 2, 1) & ".Png") | |
PicBoxTimNum1.Image = Image.FromFile(Filepath & Mid(Format(Time, "000"), 1, 1) & ".Png") | |
PicBoxTimNum2.Image = Image.FromFile(Filepath & Mid(Format(Time, "000"), 2, 1) & ".Png") | |
PicBoxTimNum3.Image = Image.FromFile(Filepath & Mid(Format(Time, "000"), 3, 1) & ".Png") | |
'BlackColor | |
PictureBox145.Image = Image.FromFile(Filepath & "Black.png") | |
'End | |
'Load Panel3(StartPage) | |
PicBoxStartPage.Image = Image.FromFile(Filepath & "GameMenu.png") | |
PicBoxStartGame.Image = Image.FromFile(Filepath & "StartingGame0.png") | |
PicBoxSetting.Image = Image.FromFile(Filepath & "Setting0.png") | |
PicBoxDesign.Image = Image.FromFile(Filepath & "DesignPage0.png") | |
'End | |
'Load Panel4(SettingPage) | |
PicBoxSettingPage.Image = Image.FromFile(Filepath & "SettingPage.png") | |
PicBoxSec30.Image = Image.FromFile(Filepath & "30(0).png") | |
PicBoxSec60.Image = Image.FromFile(Filepath & "60(1).png") | |
PicBoxSec90.Image = Image.FromFile(Filepath & "90(0).png") | |
PicBoxSec120.Image = Image.FromFile(Filepath & "120(0).png") | |
PicBoxSlow.Image = Image.FromFile(Filepath & "Slow(0).png") | |
PicBoxMid.Image = Image.FromFile(Filepath & "Mid(1).png") | |
PicBoxFast.Image = Image.FromFile(Filepath & "Fast(0).png") | |
PicBoxBack1.Image = Image.FromFile(Filepath & "Back0.png") | |
'End | |
'Load Panel5(DesignPage) | |
PicBoxDesignPage.Image = Image.FromFile(Filepath & "Design.png") | |
PicBoxBack2.Image = Image.FromFile(Filepath & "Back0.png") | |
'End | |
'Load Panel1(PausePage) | |
PicBoxPausePage.Image = Image.FromFile(Filepath & "PausePage.png") | |
PicBoxcontinue.Image = Image.FromFile(Filepath & "continue(0).png") | |
PicBoxreset.Image = Image.FromFile(Filepath & "reset(0).png") | |
'End | |
'Load Panel2(EndGamePage) | |
PicBoxEndGamePage.Image = Image.FromFile(Filepath & "EndGamePage.png") | |
PicBoxreset2.Image = Image.FromFile(Filepath & "reset(0).png") | |
'End | |
Loca = "left" | |
RandomToFood() | |
Time = 60 | |
XY(0) = 15 | |
Marks = 0 | |
End Sub | |
Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown | |
Select Case e.KeyCode | |
Case Is = Keys.P | |
Panel1.Visible = True | |
Timer1.Enabled = False | |
Timer2.Enabled = False | |
Case Is = Keys.Left | |
If LastLoca <> "right" Then | |
Loca = "left" | |
End If | |
Case Is = Keys.Right | |
If LastLoca <> "left" Then | |
Loca = "right" | |
End If | |
Case Is = Keys.Up | |
If LastLoca <> "down" Then | |
Loca = "up" | |
End If | |
Case Is = Keys.Down | |
If LastLoca <> "up" Then | |
Loca = "down" | |
End If | |
End Select | |
End Sub | |
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick | |
Movement(Loca) | |
PicBoxmrkNum1.Image = Image.FromFile(Filepath & Mid(Format(Marks, "00"), 1, 1) & ".Png") | |
PicBoxmrkNum2.Image = Image.FromFile(Filepath & Mid(Format(Marks, "00"), 2, 1) & ".Png") | |
LastLoca = Loca | |
End Sub | |
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PicBoxcontinue.Click | |
Panel1.Visible = False | |
Timer1.Enabled = True | |
Timer2.Enabled = True | |
End Sub | |
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick | |
Time -= 1 | |
PicBoxTimNum1.Image = Image.FromFile(Filepath & Mid(Format(Time, "000"), 1, 1) & ".Png") | |
PicBoxTimNum2.Image = Image.FromFile(Filepath & Mid(Format(Time, "000"), 2, 1) & ".Png") | |
PicBoxTimNum3.Image = Image.FromFile(Filepath & Mid(Format(Time, "000"), 3, 1) & ".Png") | |
If Time = 0 Then | |
Timer1.Enabled = False | |
Timer2.Enabled = False | |
Panel2.Visible = True | |
PicBoxEndMark1.Image = Image.FromFile(Filepath & Mid(Format(Marks, "00"), 1, 1) & ".Png") | |
PicBoxEndMark2.Image = Image.FromFile(Filepath & Mid(Format(Marks, "00"), 2, 1) & ".Png") | |
End If | |
End Sub | |
Sub ChImage(ByVal a As Integer, ByVal Path As String) | |
Select Case a 'switch | |
Case Is = 1 | |
PictureBox1.Image = Image.FromFile(Path) | |
Case Is = 2 | |
PictureBox2.Image = Image.FromFile(Path) | |
Case Is = 3 | |
PictureBox3.Image = Image.FromFile(Path) | |
Case Is = 4 | |
PictureBox4.Image = Image.FromFile(Path) | |
Case Is = 5 | |
PictureBox5.Image = Image.FromFile(Path) | |
Case Is = 6 | |
PictureBox6.Image = Image.FromFile(Path) | |
Case Is = 7 | |
PictureBox7.Image = Image.FromFile(Path) | |
Case Is = 8 | |
PictureBox8.Image = Image.FromFile(Path) | |
Case Is = 9 | |
PictureBox9.Image = Image.FromFile(Path) | |
Case Is = 10 | |
PictureBox10.Image = Image.FromFile(Path) | |
Case Is = 11 | |
PictureBox11.Image = Image.FromFile(Path) | |
Case Is = 12 | |
PictureBox12.Image = Image.FromFile(Path) | |
Case Is = 13 | |
PictureBox13.Image = Image.FromFile(Path) | |
Case Is = 14 | |
PictureBox14.Image = Image.FromFile(Path) | |
Case Is = 15 | |
PictureBox15.Image = Image.FromFile(Path) | |
Case Is = 16 | |
PictureBox16.Image = Image.FromFile(Path) | |
Case Is = 17 | |
PictureBox17.Image = Image.FromFile(Path) | |
Case Is = 18 | |
PictureBox18.Image = Image.FromFile(Path) | |
Case Is = 19 | |
PictureBox19.Image = Image.FromFile(Path) | |
Case Is = 20 | |
PictureBox20.Image = Image.FromFile(Path) | |
Case Is = 21 | |
PictureBox21.Image = Image.FromFile(Path) | |
Case Is = 22 | |
PictureBox22.Image = Image.FromFile(Path) | |
Case Is = 23 | |
PictureBox23.Image = Image.FromFile(Path) | |
Case Is = 24 | |
PictureBox24.Image = Image.FromFile(Path) | |
Case Is = 25 | |
PictureBox25.Image = Image.FromFile(Path) | |
Case Is = 26 | |
PictureBox26.Image = Image.FromFile(Path) | |
Case Is = 27 | |
PictureBox27.Image = Image.FromFile(Path) | |
Case Is = 28 | |
PictureBox28.Image = Image.FromFile(Path) | |
Case Is = 29 | |
PictureBox29.Image = Image.FromFile(Path) | |
Case Is = 30 | |
PictureBox30.Image = Image.FromFile(Path) | |
Case Is = 31 | |
PictureBox31.Image = Image.FromFile(Path) | |
Case Is = 32 | |
PictureBox32.Image = Image.FromFile(Path) | |
Case Is = 33 | |
PictureBox33.Image = Image.FromFile(Path) | |
Case Is = 34 | |
PictureBox34.Image = Image.FromFile(Path) | |
Case Is = 35 | |
PictureBox35.Image = Image.FromFile(Path) | |
Case Is = 36 | |
PictureBox36.Image = Image.FromFile(Path) | |
Case Is = 37 | |
PictureBox37.Image = Image.FromFile(Path) | |
Case Is = 38 | |
PictureBox38.Image = Image.FromFile(Path) | |
Case Is = 39 | |
PictureBox39.Image = Image.FromFile(Path) | |
Case Is = 40 | |
PictureBox40.Image = Image.FromFile(Path) | |
Case Is = 41 | |
PictureBox41.Image = Image.FromFile(Path) | |
Case Is = 42 | |
PictureBox42.Image = Image.FromFile(Path) | |
Case Is = 43 | |
PictureBox43.Image = Image.FromFile(Path) | |
Case Is = 44 | |
PictureBox44.Image = Image.FromFile(Path) | |
Case Is = 45 | |
PictureBox45.Image = Image.FromFile(Path) | |
Case Is = 46 | |
PictureBox46.Image = Image.FromFile(Path) | |
Case Is = 47 | |
PictureBox47.Image = Image.FromFile(Path) | |
Case Is = 48 | |
PictureBox48.Image = Image.FromFile(Path) | |
Case Is = 49 | |
PictureBox49.Image = Image.FromFile(Path) | |
Case Is = 50 | |
PictureBox50.Image = Image.FromFile(Path) | |
Case Is = 51 | |
PictureBox51.Image = Image.FromFile(Path) | |
Case Is = 52 | |
PictureBox52.Image = Image.FromFile(Path) | |
Case Is = 53 | |
PictureBox53.Image = Image.FromFile(Path) | |
Case Is = 54 | |
PictureBox54.Image = Image.FromFile(Path) | |
Case Is = 55 | |
PictureBox55.Image = Image.FromFile(Path) | |
Case Is = 56 | |
PictureBox56.Image = Image.FromFile(Path) | |
Case Is = 57 | |
PictureBox57.Image = Image.FromFile(Path) | |
Case Is = 58 | |
PictureBox58.Image = Image.FromFile(Path) | |
Case Is = 59 | |
PictureBox59.Image = Image.FromFile(Path) | |
Case Is = 60 | |
PictureBox60.Image = Image.FromFile(Path) | |
Case Is = 61 | |
PictureBox61.Image = Image.FromFile(Path) | |
Case Is = 62 | |
PictureBox62.Image = Image.FromFile(Path) | |
Case Is = 63 | |
PictureBox63.Image = Image.FromFile(Path) | |
Case Is = 64 | |
PictureBox64.Image = Image.FromFile(Path) | |
Case Is = 65 | |
PictureBox65.Image = Image.FromFile(Path) | |
Case Is = 66 | |
PictureBox66.Image = Image.FromFile(Path) | |
Case Is = 67 | |
PictureBox67.Image = Image.FromFile(Path) | |
Case Is = 68 | |
PictureBox68.Image = Image.FromFile(Path) | |
Case Is = 69 | |
PictureBox69.Image = Image.FromFile(Path) | |
Case Is = 70 | |
PictureBox70.Image = Image.FromFile(Path) | |
Case Is = 71 | |
PictureBox71.Image = Image.FromFile(Path) | |
Case Is = 72 | |
PictureBox72.Image = Image.FromFile(Path) | |
Case Is = 73 | |
PictureBox73.Image = Image.FromFile(Path) | |
Case Is = 74 | |
PictureBox74.Image = Image.FromFile(Path) | |
Case Is = 75 | |
PictureBox75.Image = Image.FromFile(Path) | |
Case Is = 76 | |
PictureBox76.Image = Image.FromFile(Path) | |
Case Is = 77 | |
PictureBox77.Image = Image.FromFile(Path) | |
Case Is = 78 | |
PictureBox78.Image = Image.FromFile(Path) | |
Case Is = 79 | |
PictureBox79.Image = Image.FromFile(Path) | |
Case Is = 80 | |
PictureBox80.Image = Image.FromFile(Path) | |
Case Is = 81 | |
PictureBox81.Image = Image.FromFile(Path) | |
Case Is = 82 | |
PictureBox82.Image = Image.FromFile(Path) | |
Case Is = 83 | |
PictureBox83.Image = Image.FromFile(Path) | |
Case Is = 84 | |
PictureBox84.Image = Image.FromFile(Path) | |
Case Is = 85 | |
PictureBox85.Image = Image.FromFile(Path) | |
Case Is = 86 | |
PictureBox86.Image = Image.FromFile(Path) | |
Case Is = 87 | |
PictureBox87.Image = Image.FromFile(Path) | |
Case Is = 88 | |
PictureBox88.Image = Image.FromFile(Path) | |
Case Is = 89 | |
PictureBox89.Image = Image.FromFile(Path) | |
Case Is = 90 | |
PictureBox90.Image = Image.FromFile(Path) | |
Case Is = 91 | |
PictureBox91.Image = Image.FromFile(Path) | |
Case Is = 92 | |
PictureBox92.Image = Image.FromFile(Path) | |
Case Is = 93 | |
PictureBox93.Image = Image.FromFile(Path) | |
Case Is = 94 | |
PictureBox94.Image = Image.FromFile(Path) | |
Case Is = 95 | |
PictureBox95.Image = Image.FromFile(Path) | |
Case Is = 96 | |
PictureBox96.Image = Image.FromFile(Path) | |
Case Is = 97 | |
PictureBox97.Image = Image.FromFile(Path) | |
Case Is = 98 | |
PictureBox98.Image = Image.FromFile(Path) | |
Case Is = 99 | |
PictureBox99.Image = Image.FromFile(Path) | |
Case Is = 100 | |
PictureBox100.Image = Image.FromFile(Path) | |
Case Is = 101 | |
PictureBox101.Image = Image.FromFile(Path) | |
Case Is = 102 | |
PictureBox102.Image = Image.FromFile(Path) | |
Case Is = 103 | |
PictureBox103.Image = Image.FromFile(Path) | |
Case Is = 104 | |
PictureBox104.Image = Image.FromFile(Path) | |
Case Is = 105 | |
PictureBox105.Image = Image.FromFile(Path) | |
Case Is = 106 | |
PictureBox106.Image = Image.FromFile(Path) | |
Case Is = 107 | |
PictureBox107.Image = Image.FromFile(Path) | |
Case Is = 108 | |
PictureBox108.Image = Image.FromFile(Path) | |
Case Is = 109 | |
PictureBox109.Image = Image.FromFile(Path) | |
Case Is = 110 | |
PictureBox110.Image = Image.FromFile(Path) | |
Case Is = 111 | |
PictureBox111.Image = Image.FromFile(Path) | |
Case Is = 112 | |
PictureBox112.Image = Image.FromFile(Path) | |
Case Is = 113 | |
PictureBox113.Image = Image.FromFile(Path) | |
Case Is = 114 | |
PictureBox114.Image = Image.FromFile(Path) | |
Case Is = 115 | |
PictureBox115.Image = Image.FromFile(Path) | |
Case Is = 116 | |
PictureBox116.Image = Image.FromFile(Path) | |
Case Is = 117 | |
PictureBox117.Image = Image.FromFile(Path) | |
Case Is = 118 | |
PictureBox118.Image = Image.FromFile(Path) | |
Case Is = 119 | |
PictureBox119.Image = Image.FromFile(Path) | |
Case Is = 120 | |
PictureBox120.Image = Image.FromFile(Path) | |
Case Is = 121 | |
PictureBox121.Image = Image.FromFile(Path) | |
Case Is = 122 | |
PictureBox122.Image = Image.FromFile(Path) | |
Case Is = 123 | |
PictureBox123.Image = Image.FromFile(Path) | |
Case Is = 124 | |
PictureBox124.Image = Image.FromFile(Path) | |
Case Is = 125 | |
PictureBox125.Image = Image.FromFile(Path) | |
Case Is = 126 | |
PictureBox126.Image = Image.FromFile(Path) | |
Case Is = 127 | |
PictureBox127.Image = Image.FromFile(Path) | |
Case Is = 128 | |
PictureBox128.Image = Image.FromFile(Path) | |
Case Is = 129 | |
PictureBox129.Image = Image.FromFile(Path) | |
Case Is = 130 | |
PictureBox130.Image = Image.FromFile(Path) | |
Case Is = 131 | |
PictureBox131.Image = Image.FromFile(Path) | |
Case Is = 132 | |
PictureBox132.Image = Image.FromFile(Path) | |
Case Is = 133 | |
PictureBox133.Image = Image.FromFile(Path) | |
Case Is = 134 | |
PictureBox134.Image = Image.FromFile(Path) | |
Case Is = 135 | |
PictureBox135.Image = Image.FromFile(Path) | |
Case Is = 136 | |
PictureBox136.Image = Image.FromFile(Path) | |
Case Is = 137 | |
PictureBox137.Image = Image.FromFile(Path) | |
Case Is = 138 | |
PictureBox138.Image = Image.FromFile(Path) | |
Case Is = 139 | |
PictureBox139.Image = Image.FromFile(Path) | |
Case Is = 140 | |
PictureBox140.Image = Image.FromFile(Path) | |
Case Is = 141 | |
PictureBox141.Image = Image.FromFile(Path) | |
Case Is = 142 | |
PictureBox142.Image = Image.FromFile(Path) | |
Case Is = 143 | |
PictureBox143.Image = Image.FromFile(Path) | |
Case Is = 144 | |
PictureBox144.Image = Image.FromFile(Path) | |
End Select | |
End Sub | |
Sub ClearImage() | |
'1-10 | |
PictureBox1.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox2.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox3.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox4.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox5.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox6.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox7.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox8.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox9.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox10.Image = Image.FromFile(Filepath & "NULL.png") | |
'11-20 | |
PictureBox11.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox12.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox13.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox14.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox15.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox16.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox17.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox18.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox19.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox20.Image = Image.FromFile(Filepath & "NULL.png") | |
'21-30 | |
PictureBox21.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox22.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox23.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox24.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox25.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox26.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox27.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox28.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox29.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox30.Image = Image.FromFile(Filepath & "NULL.png") | |
'31-36 | |
PictureBox31.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox32.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox33.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox34.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox35.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox36.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox37.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox38.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox39.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox40.Image = Image.FromFile(Filepath & "NULL.png") | |
'41-50 | |
PictureBox41.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox42.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox43.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox44.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox45.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox46.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox47.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox48.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox49.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox50.Image = Image.FromFile(Filepath & "NULL.png") | |
'51-60 | |
PictureBox51.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox52.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox53.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox54.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox55.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox56.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox57.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox58.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox59.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox60.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox61.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox62.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox63.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox64.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox65.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox66.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox67.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox68.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox69.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox70.Image = Image.FromFile(Filepath & "NULL.png") | |
'61-70 | |
PictureBox71.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox72.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox73.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox74.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox75.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox76.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox77.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox78.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox79.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox80.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox81.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox82.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox83.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox84.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox85.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox86.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox87.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox88.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox89.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox90.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox91.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox92.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox93.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox94.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox95.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox96.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox97.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox98.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox99.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox100.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox101.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox102.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox103.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox104.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox105.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox106.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox107.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox108.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox109.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox110.Image = Image.FromFile(Filepath & "NULL.png") | |
' | |
PictureBox111.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox112.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox113.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox114.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox115.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox116.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox117.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox118.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox119.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox120.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox121.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox122.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox123.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox124.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox125.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox126.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox127.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox128.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox129.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox130.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox131.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox132.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox133.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox134.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox135.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox136.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox137.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox138.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox139.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox140.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox141.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox142.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox143.Image = Image.FromFile(Filepath & "NULL.png") | |
PictureBox144.Image = Image.FromFile(Filepath & "NULL.png") | |
End Sub | |
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PicBoxreset.Click, PicBoxreset2.Click | |
Form1_Load() | |
End Sub | |
Private Sub StartGame_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PicBoxStartGame.Click | |
Panel3.Visible = False | |
Timer1.Enabled = True | |
Timer2.Enabled = True | |
End Sub | |
Private Sub Setting_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PicBoxSetting.Click | |
Panel4.Visible = True | |
Panel3.Visible = False | |
End Sub | |
Private Sub Design_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PicBoxDesign.Click | |
Panel5.Visible = True | |
End Sub | |
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PicBoxBack1.Click, PicBoxBack2.Click | |
Panel2.Visible = False | |
Panel3.Visible = True | |
Panel4.Visible = False | |
Panel5.Visible = False | |
End Sub | |
Private Sub PicBoxStartGame_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PicBoxStartGame.MouseEnter, PicBoxStartGame.MouseLeave | |
a = (a + 1) Mod 2 | |
PicBoxStartGame.Image = Image.FromFile(Filepath & "StartingGame" & a & ".png") | |
End Sub | |
Private Sub PicBoxSetting_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PicBoxSetting.MouseEnter, PicBoxSetting.MouseLeave | |
b = (b + 1) Mod 2 | |
PicBoxSetting.Image = Image.FromFile(Filepath & "Setting" & b & ".png") | |
End Sub | |
Private Sub PicBoxDesign_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PicBoxDesign.MouseEnter, PicBoxDesign.MouseLeave | |
c = (c + 1) Mod 2 | |
PicBoxDesign.Image = Image.FromFile(Filepath & "DesignPage" & c & ".png") | |
End Sub | |
Private Sub PicBoxBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PicBoxBack1.MouseEnter, PicBoxBack1.MouseLeave, PicBoxBack2.MouseEnter, PicBoxBack2.MouseLeave | |
d = (d + 1) Mod 2 | |
PicBoxBack1.Image = Image.FromFile(Filepath & "Back" & d & ".png") | |
PicBoxBack2.Image = Image.FromFile(Filepath & "Back" & d & ".png") | |
End Sub | |
Private Sub PicBoxSec30_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PicBoxSec30.Click | |
Time = 30 | |
PicBoxSec30.Image = Image.FromFile(Filepath & "30(1).png") | |
PicBoxSec60.Image = Image.FromFile(Filepath & "60(0).png") | |
PicBoxSec90.Image = Image.FromFile(Filepath & "90(0).png") | |
PicBoxSec120.Image = Image.FromFile(Filepath & "120(0).png") | |
End Sub | |
Private Sub PicBoxSec60_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PicBoxSec60.Click | |
Time = 60 | |
PicBoxSec30.Image = Image.FromFile(Filepath & "30(0).png") | |
PicBoxSec60.Image = Image.FromFile(Filepath & "60(1).png") | |
PicBoxSec90.Image = Image.FromFile(Filepath & "90(0).png") | |
PicBoxSec120.Image = Image.FromFile(Filepath & "120(0).png") | |
End Sub | |
Private Sub PicBoxSec90_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PicBoxSec90.Click | |
Time = 90 | |
PicBoxSec30.Image = Image.FromFile(Filepath & "30(0).png") | |
PicBoxSec60.Image = Image.FromFile(Filepath & "60(0).png") | |
PicBoxSec90.Image = Image.FromFile(Filepath & "90(1).png") | |
PicBoxSec120.Image = Image.FromFile(Filepath & "120(0).png") | |
End Sub | |
Private Sub PicBoxSec120_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PicBoxSec120.Click | |
Time = 120 | |
PicBoxSec30.Image = Image.FromFile(Filepath & "30(0).png") | |
PicBoxSec60.Image = Image.FromFile(Filepath & "60(0).png") | |
PicBoxSec90.Image = Image.FromFile(Filepath & "90(0).png") | |
PicBoxSec120.Image = Image.FromFile(Filepath & "120(1).png") | |
End Sub | |
Private Sub PicBoxSlow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PicBoxSlow.Click | |
Timer1.Interval = 400 | |
PicBoxSlow.Image = Image.FromFile(Filepath & "Slow(1).png") | |
PicBoxMid.Image = Image.FromFile(Filepath & "Mid(0).png") | |
PicBoxFast.Image = Image.FromFile(Filepath & "Fast(0).png") | |
End Sub | |
Private Sub PicBoxMid_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PicBoxMid.Click | |
Timer1.Interval = 200 | |
PicBoxSlow.Image = Image.FromFile(Filepath & "Slow(0).png") | |
PicBoxMid.Image = Image.FromFile(Filepath & "Mid(1).png") | |
PicBoxFast.Image = Image.FromFile(Filepath & "Fast(0).png") | |
End Sub | |
Private Sub PicBoxFast_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PicBoxFast.Click | |
Timer1.Interval = 100 | |
PicBoxSlow.Image = Image.FromFile(Filepath & "Slow(0).png") | |
PicBoxMid.Image = Image.FromFile(Filepath & "Mid(0).png") | |
PicBoxFast.Image = Image.FromFile(Filepath & "Fast(1).png") | |
End Sub | |
Private Sub PicBoxcontinue_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PicBoxcontinue.MouseEnter, PicBoxcontinue.MouseLeave | |
g = (g + 1) Mod 2 | |
PicBoxcontinue.Image = Image.FromFile(Filepath & "continue(" & g & ").png") | |
End Sub | |
Private Sub PicBoxreset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PicBoxreset.MouseEnter, PicBoxreset.MouseLeave, PicBoxreset2.MouseEnter, PicBoxreset2.MouseLeave | |
f = (f + 1) Mod 2 | |
PicBoxreset.Image = Image.FromFile(Filepath & "reset(" & f & ").png") | |
PicBoxreset2.Image = Image.FromFile(Filepath & "reset(" & f & ").png") | |
End Sub | |
End Class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment