home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / gamesa / frmtoss.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-08-01  |  3.3 KB  |  114 lines

  1. VERSION 5.00
  2. Begin VB.Form frmToss 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Toss"
  5.    ClientHeight    =   3990
  6.    ClientLeft      =   1785
  7.    ClientTop       =   330
  8.    ClientWidth     =   4335
  9.    FillStyle       =   0  'Solid
  10.    BeginProperty Font 
  11.       Name            =   "MS Sans Serif"
  12.       Size            =   12
  13.       Charset         =   0
  14.       Weight          =   700
  15.       Underline       =   0   'False
  16.       Italic          =   -1  'True
  17.       Strikethrough   =   0   'False
  18.    EndProperty
  19.    Icon            =   "frmToss.frx":0000
  20.    LinkTopic       =   "Form1"
  21.    MaxButton       =   0   'False
  22.    MinButton       =   0   'False
  23.    Moveable        =   0   'False
  24.    ScaleHeight     =   266
  25.    ScaleMode       =   3  'Pixel
  26.    ScaleWidth      =   289
  27.    ShowInTaskbar   =   0   'False
  28.    StartUpPosition =   2  'CenterScreen
  29.    Begin VB.CommandButton cmdContinue 
  30.       Caption         =   "&Continue....."
  31.       BeginProperty Font 
  32.          Name            =   "MS Sans Serif"
  33.          Size            =   8.25
  34.          Charset         =   0
  35.          Weight          =   400
  36.          Underline       =   0   'False
  37.          Italic          =   0   'False
  38.          Strikethrough   =   0   'False
  39.       EndProperty
  40.       Height          =   495
  41.       Left            =   1545
  42.       TabIndex        =   0
  43.       Top             =   1755
  44.       Width           =   1215
  45.    End
  46. Attribute VB_Name = "frmToss"
  47. Attribute VB_GlobalNameSpace = False
  48. Attribute VB_Creatable = False
  49. Attribute VB_PredeclaredId = True
  50. Attribute VB_Exposed = False
  51. Option Explicit
  52. Private Sub cmdContinue_Click()
  53. Unload frmToss
  54. frmGame.Show 1
  55. End Sub
  56. Private Sub Form_Resize()
  57. Dim CX, CY, Radius, Random
  58. cmdContinue.Visible = False
  59. FillStyle = 0
  60. ScaleMode = 3
  61. Radius = 30
  62. CX = ScaleWidth / 2
  63. For CY = ScaleHeight - 50 To 50 Step -10
  64. FillColor = RGB(250, 239, 39)
  65. Circle (CX, CY), Radius, RGB(213, 99, 23)
  66. DelayTime = 0.004
  67. Start = Timer
  68. Do While Timer < Start + DelayTime
  69. FillColor = BackColor
  70. Circle (CX, CY), Radius, BackColor
  71. Start = Timer
  72. Do While Timer < Start + DelayTime
  73. FillColor = RGB(250, 239, 39)
  74. Line (CX - 30, CY - 5)-(CX + 30, CY + 5), RGB(213, 99, 23), BF
  75. FillColor = BackColor
  76. Line (CX - 30, CY - 5)-(CX + 30, CY + 5), BackColor, BF
  77. Next CY
  78. For CY = 50 To ScaleHeight - 50 Step 10
  79. FillColor = RGB(250, 239, 39)
  80. Circle (CX, CY), Radius, RGB(213, 99, 23)
  81. Start = Timer
  82. Do While Timer < Start + DelayTime
  83. FillColor = BackColor
  84. Circle (CX, CY), Radius, BackColor
  85. Start = Timer
  86. Do While Timer < Start + DelayTime
  87. FillColor = RGB(250, 239, 39)
  88. Line (CX - 30, CY - 5)-(CX + 30, CY + 5), RGB(213, 99, 23), BF
  89. FillColor = BackColor
  90. Line (CX - 30, CY - 5)-(CX + 30, CY + 5), BackColor, BF
  91. Next CY
  92. FillColor = RGB(250, 239, 39)
  93. Circle (CX, CY), Radius, RGB(213, 99, 23)
  94. Randomize
  95. Random = Int((10 * Rnd) + 1)
  96. If Random = 1 Or Random = 3 Or Random = 5 Or Random = 7 Or Random = 9 Then
  97. PSet (CX - 23, CY - 10), RGB(255, 255, 255)
  98. Print "Head"
  99. Toss = 0
  100. PSet (CX - 20, CY - 10), RGB(255, 255, 255)
  101. Print "Tail"
  102. Toss = 1
  103. End If
  104. If (HeadTail = 0 And Toss = 0) Or (HeadTail = 1 And Toss = 1) Then
  105. PSet (82, 80), BackColor
  106. Print "User Wins !!!!!"
  107. Turn = 0
  108. PSet (60, 80), BackColor
  109. Print "Computer Wins !!!!!"
  110. Turn = 1
  111. End If
  112. cmdContinue.Visible = True
  113. End Sub
  114.