Login
Аркада Win16 27.02.2025
369 просмотров
Перейти к просмотру всей ветки
in Antwort uscheswoi_82 01.03.25 07:51
Полный код frmgame.frm:
VERSION 4.00 Begin VB.Form frmGame BorderStyle = 1 'Fixed Single Caption = "Tarakany 1.0" ClientHeight = 3600 ClientLeft = 1590 ClientTop = 2955 ClientWidth = 4800 Height = 4335 Icon = "FRMGAME.frx":0000 Left = 1530 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 240 ScaleMode = 3 'Pixel ScaleWidth = 320 Top = 2280 Width = 4920 Begin VB.Timer tmTimer Enabled = 0 'False Left = 3720 Top = 2640 End Begin VB.Label lbFinish BackStyle = 0 'Transparent Height = 1935 Left = 4320 TabIndex = 8 Top = 120 Width = 135 End Begin Threed.SSCommand cmdStop Height = 495 Left = 1680 TabIndex = 7 Top = 2280 Width = 1455 _version = 65536 _extentx = 2566 _extenty = 873 _stockprops = 78 caption = "S&top" End Begin Threed.SSCommand cmdStart Height = 495 Left = 120 TabIndex = 6 Top = 2280 Width = 1455 _version = 65536 _extentx = 2566 _extenty = 873 _stockprops = 78 caption = "&Start" End Begin VB.Label lbTarakan Appearance = 0 'Flat AutoSize = -1 'True BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "x" BeginProperty Font name = "MS Sans Serif" charset = 1 weight = 700 size = 12 underline = 0 'False italic = 0 'False strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 300 Index = 5 Left = 120 TabIndex = 5 Top = 1800 Width = 135 End Begin VB.Label lbTarakan Appearance = 0 'Flat AutoSize = -1 'True BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "x" BeginProperty Font name = "MS Sans Serif" charset = 1 weight = 700 size = 12 underline = 0 'False italic = 0 'False strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 300 Index = 4 Left = 120 TabIndex = 4 Top = 1380 Width = 135 End Begin VB.Label lbTarakan Appearance = 0 'Flat AutoSize = -1 'True BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "x" BeginProperty Font name = "MS Sans Serif" charset = 1 weight = 700 size = 12 underline = 0 'False italic = 0 'False strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 300 Index = 3 Left = 120 TabIndex = 3 Top = 1020 Width = 135 End Begin VB.Label lbTarakan Appearance = 0 'Flat AutoSize = -1 'True BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "x" BeginProperty Font name = "MS Sans Serif" charset = 1 weight = 700 size = 12 underline = 0 'False italic = 0 'False strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 300 Index = 2 Left = 120 TabIndex = 2 Top = 690 Width = 135 End Begin VB.Label lbTarakan Appearance = 0 'Flat AutoSize = -1 'True BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "x" BeginProperty Font name = "MS Sans Serif" charset = 1 weight = 700 size = 12 underline = 0 'False italic = 0 'False strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 300 Index = 1 Left = 120 TabIndex = 1 Top = 390 Width = 135 End Begin VB.Label lbTarakan Appearance = 0 'Flat AutoSize = -1 'True BackColor = &H80000005& BackStyle = 0 'Transparent Caption = "x" BeginProperty Font name = "MS Sans Serif" charset = 1 weight = 700 size = 12 underline = 0 'False italic = 0 'False strikethrough = 0 'False EndProperty ForeColor = &H80000008& Height = 300 Index = 0 Left = 120 TabIndex = 0 Top = 105 Width = 135 End Begin VB.Shape Shape1 BackColor = &H00004080& BackStyle = 1 'Opaque BorderStyle = 0 'Transparent Height = 1935 Left = 120 Top = 120 Width = 4455 End Begin VB.Menu mnuGame Caption = "&Game" Begin VB.Menu popupNewGame Caption = "&New game" End Begin VB.Menu n1 Caption = "-" End Begin VB.Menu popupQuit Caption = "&Quit" End End Begin VB.Menu mnuHelp Caption = "&Help" Begin VB.Menu popupRules Caption = "&Rules" Shortcut = {F1} End Begin VB.Menu N2 Caption = "-" End Begin VB.Menu popupAbout Caption = "&About..." End End End Attribute VB_Name = "frmGame" Attribute VB_Creatable = False Attribute VB_Exposed = False Dim stavka_tarakan As Integer Const cnt_tarakany As Integer = 5 Private Sub cmdStart_Click() On Error Resume Next Do While Not (stavka_tarakan >= 1 And stavka_tarakan <= 6) stavka_tarakan = CInt(InputBox("Which tarakan (1-6)?")) Loop lbTarakan(stavka_tarakan).ForeColor = vbRed cmdStart.Enabled = False cmdStop.Enabled = True tmTimer.Enabled = True tmTimer.Interval = 100 End Sub Private Sub cmdStop_Click() Dim i As Integer tmTimer.Enabled = False tmTimer.Interval = 0 For i = 0 To cnt_tarakany lbTarakan(i).Left = 8 lbTarakan(i).ForeColor = vbBlack Next i stavka_tarakan = 0 End Sub Private Sub Form_Load() Randomize Timer cmdStart.Enabled = False cmdStop.Enabled = False End Sub Private Sub popupAbout_Click() MsgBox "Author uscheswoi_82", vbOKOnly + vbInformation End Sub Private Sub popupNewGame_Click() tmTimer.Enabled = False cmdStart.Enabled = True cmdStop.Enabled = True tarakan_stavka = 0 End Sub Private Sub popupQuit_Click() Unload Me End Sub Private Sub tmTimer_Timer() Dim i As Integer For i = 0 To cnt_tarakany Move_Tarakan lbTarakan(i), Int((10 * Rnd()) + 1) If get_position_tarakan(lbTarakan(i)) >= lbFinish.Left Then If stavka_tarakan = i Then tmTimer.Interval = 0 tmTimer.Enabled = False MsgBox "You Won!" Exit Sub Else tmTimer.Interval = 0 tmTimer.Enabled = False MsgBox "You Lose!" Exit Sub End If End If Next i End Sub
Если я кому-то отвечаю, это не значит что я ему симпатизирую, каждый остаётся при своём мнение