home *** CD-ROM | disk | FTP | other *** search
/ Apollo 18: The Moon Missions / 990125_1647.ISO / Landing / LM4 / AB002319 next >
Text File  |  1996-06-05  |  21KB  |  567 lines

  1. VERSION 4.00
  2. Begin VB.Form docking 
  3.    Caption         =   "Docking with the Lunar Module"
  4.    ClientHeight    =   6030
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1515
  7.    ClientWidth     =   6720
  8.    Height          =   6435
  9.    Left            =   1035
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   6030
  12.    ScaleWidth      =   6720
  13.    Top             =   1170
  14.    Width           =   6840
  15.    Begin VB.PictureBox picWorkBG 
  16.       Appearance      =   0  'Flat
  17.       AutoRedraw      =   -1  'True
  18.       BackColor       =   &H00400000&
  19.       DragIcon        =   "DOCKING.frx":0000
  20.       ForeColor       =   &H80000008&
  21.       Height          =   4860
  22.       Left            =   2895
  23.       ScaleHeight     =   322
  24.       ScaleMode       =   3  'Pixel
  25.       ScaleWidth      =   635
  26.       TabIndex        =   6
  27.       Top             =   7365
  28.       Width           =   9555
  29.    End
  30.    Begin VB.PictureBox picBGoriginal 
  31.       Appearance      =   0  'Flat
  32.       AutoRedraw      =   -1  'True
  33.       BackColor       =   &H80000005&
  34.       ForeColor       =   &H80000008&
  35.       Height          =   9015
  36.       Left            =   -7320
  37.       Picture         =   "DOCKING.frx":030A
  38.       ScaleHeight     =   599
  39.       ScaleMode       =   3  'Pixel
  40.       ScaleWidth      =   799
  41.       TabIndex        =   4
  42.       Top             =   7215
  43.       Width           =   12015
  44.    End
  45.    Begin VB.PictureBox picPitMask 
  46.       Appearance      =   0  'Flat
  47.       AutoRedraw      =   -1  'True
  48.       AutoSize        =   -1  'True
  49.       BackColor       =   &H80000005&
  50.       BorderStyle     =   0  'None
  51.       ForeColor       =   &H80000008&
  52.       Height          =   5205
  53.       Left            =   9795
  54.       Picture         =   "DOCKING.frx":75A4E
  55.       ScaleHeight     =   5205
  56.       ScaleWidth      =   9600
  57.       TabIndex        =   3
  58.       Top             =   5730
  59.       Width           =   9600
  60.    End
  61.    Begin VB.PictureBox picPitSprite 
  62.       Appearance      =   0  'Flat
  63.       AutoRedraw      =   -1  'True
  64.       AutoSize        =   -1  'True
  65.       BackColor       =   &H80000005&
  66.       BorderStyle     =   0  'None
  67.       ForeColor       =   &H80000008&
  68.       Height          =   5205
  69.       Left            =   9765
  70.       Picture         =   "DOCKING.frx":ABE1A
  71.       ScaleHeight     =   5205
  72.       ScaleWidth      =   9600
  73.       TabIndex        =   2
  74.       Top             =   270
  75.       Width           =   9600
  76.    End
  77.    Begin VB.Timer Timer1 
  78.       Enabled         =   0   'False
  79.       Interval        =   2
  80.       Left            =   10425
  81.       Top             =   120
  82.    End
  83.    Begin VB.PictureBox Picture4 
  84.       AutoSize        =   -1  'True
  85.       BorderStyle     =   0  'None
  86.       Height          =   7200
  87.       Left            =   -60
  88.       Picture         =   "DOCKING.frx":E2276
  89.       ScaleHeight     =   7200
  90.       ScaleWidth      =   9600
  91.       TabIndex        =   0
  92.       Top             =   -30
  93.       Width           =   9600
  94.       Begin VB.PictureBox btnStart 
  95.          BeginProperty Font 
  96.             name            =   "Small Fonts"
  97.             charset         =   1
  98.             weight          =   400
  99.             size            =   6
  100.             underline       =   0   'False
  101.             italic          =   0   'False
  102.             strikethrough   =   0   'False
  103.          EndProperty
  104.          Height          =   255
  105.          Left            =   6420
  106.          ScaleHeight     =   225
  107.          ScaleWidth      =   2445
  108.          TabIndex        =   5
  109.          Top             =   6255
  110.          Width           =   2475
  111.       End
  112.       Begin VB.PictureBox picBackground 
  113.          Appearance      =   0  'Flat
  114.          BackColor       =   &H00000000&
  115.          BorderStyle     =   0  'None
  116.          DragIcon        =   "DOCKING.frx":12D6BA
  117.          ForeColor       =   &H80000008&
  118.          Height          =   4980
  119.          Left            =   30
  120.          ScaleHeight     =   332
  121.          ScaleMode       =   3  'Pixel
  122.          ScaleWidth      =   646
  123.          TabIndex        =   1
  124.          Top             =   135
  125.          Width           =   9690
  126.       End
  127.    End
  128. End
  129. Attribute VB_Name = "docking"
  130. Attribute VB_Creatable = False
  131. Attribute VB_Exposed = False
  132.  
  133. Option Explicit
  134. '------------------------------------------------------------
  135. ' SPACEHNT.FRM
  136. '
  137. ' The main form for the Space Hunt game.
  138. '------------------------------------------------------------
  139.  
  140. ' The number of enemy ships.  Increasing this may slow
  141. ' performance.
  142. Const NUM_ENEMY_SHIPS = 3
  143.  
  144. Dim ScrollSpeed As Integer     ' The ship's current turning speed
  145. Dim LaserFired As Integer      ' Has the player fired the laser?
  146. Dim ShipsDestroyed As Integer  ' Total enemy ships destroyed.
  147.  
  148. ' Mouse position relative to large background bitmap
  149. Dim MouseX As Long, MouseY As Long
  150.  
  151. ' WaveMix sound handles used for creating the game's
  152. ' layered sound effects.
  153. Dim WAV_Turn As Integer
  154. Dim WAV_LaserHit As Integer
  155. Dim WAV_LaserMiss As Integer
  156. Dim WAV_Music As Integer
  157. Dim WAV_ShieldHit As Integer
  158. Dim WAV_Alert As Integer
  159.  
  160. ' The normal enemy ships.
  161. Dim Ship(1 To 4) As tShip
  162. ' The enemy ships when firing.
  163. Dim ShipFiringSprite As tSprite
  164. ' The enemy ships when exploding (one sprite per frame).
  165. Dim ExplosionSprite(0 To 2) As tSprite
  166.  
  167. ' Used by the picSpeed speed indicator.
  168. Dim TotalBlocks As Integer
  169.  
  170. ' RGB color constants used for laser fire.
  171. Const RED = &HFF
  172. Const GREEN = &HFF00&
  173.  
  174. ' Windows API calls
  175. Private Declare Function GetPixel Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  176. Private Declare Function setpixel Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal crColor As Long) As Long
  177. Private Declare Function ellipse Lib "GDI" (ByVal hDC As Integer, ByVal nLeft As Integer, ByVal nTop As Integer, ByVal nRight As Integer, ByVal nBottom As Integer) As Long
  178. Private Declare Function LineTo Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Integer
  179. Private Declare Function Polyline Lib "GDI" (ByVal hDC As Integer, lpPoints As POINTAPI, ByVal nCount As Integer) As Integer
  180. Private Declare Function MoveTo Lib "GDI" (ByVal hDC As Integer, ByVal X As Integer, ByVal Y As Integer) As Long
  181. Private Sub btnStart_Click()
  182. '------------------------------------------------------------
  183. ' Pressing the Start button will either start, pause, or
  184. ' resume the game.
  185. '------------------------------------------------------------
  186. Static Paused As Integer
  187. Dim rc As Long
  188.  
  189.     ' If the game is cuurently paused, then resume it.
  190.     If Paused Then
  191.         Paused = False
  192.        'btnStart.Caption = "&PAUSE"
  193.         rc = WaveMixActivate(hWaveMix, True)
  194.         Timer1.Enabled = True
  195.     ' If the game is in progress then pause it.
  196.     ElseIf Timer1.Enabled Then
  197.         Paused = True
  198.        ' btnStart.Caption = "&RESUME"
  199.         rc = WaveMixActivate(hWaveMix, False)
  200.         Timer1.Enabled = False
  201.     ' Otherwise, no game is in progress, so start one.
  202.     Else
  203.         'btnStart.Caption = "&PAUSE"
  204.         StartGame
  205.     End If
  206. End Sub
  207.  
  208.  
  209. Private Sub Form_Load()
  210.   '------------------------------------------------------------
  211. ' Set up the form when its first loaded.
  212. '------------------------------------------------------------
  213.  
  214.     ' Hide the scope and background PictureBoxes.
  215.     picBackground.Visible = False
  216.     'picScope.Visible = False
  217.  
  218.     ' Copy the cockpit "sprite" image into the background PictureBox.
  219.     picBackground.Picture = picPitSprite.Picture
  220.  
  221.     ' Center the form on the screen.
  222.     Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
  223. End Sub
  224.  
  225. Private Sub Form_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
  226. '------------------------------------------------------------
  227. ' Turn off the custom mouse "gunsite" cursor if user drags
  228. ' mouse over the form (off the picBackground control).
  229. '------------------------------------------------------------
  230.  
  231.     If Source.Tag = "Mouse" Then
  232.         Source.Drag 0
  233.         Source.Tag = ""
  234.     End If
  235. End Su