⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 space1.frm

📁 太空船游戏例子源程序
💻 FRM
📖 第 1 页 / 共 3 页
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{0BA686C6-F7D3-101A-993E-0000C0EF6F5E}#2.0#0"; "THREED20.OCX"
Begin VB.Form frmMain 
   Appearance      =   0  'Flat
   BackColor       =   &H00000000&
   Caption         =   "Phone Attack"
   ClientHeight    =   5775
   ClientLeft      =   1755
   ClientTop       =   2190
   ClientWidth     =   5400
   DrawMode        =   15  'Merge Pen Not
   BeginProperty Font 
      Name            =   "MS Sans Serif"
      Size            =   8.25
      Charset         =   0
      Weight          =   700
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   ForeColor       =   &H80000008&
   Icon            =   "SPACE1.frx":0000
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   5775
   ScaleWidth      =   5400
   Begin Threed.SSPanel panInfo 
      Align           =   2  'Align Bottom
      Height          =   330
      Left            =   0
      TabIndex        =   15
      Top             =   5445
      Width           =   5400
      _ExtentX        =   9525
      _ExtentY        =   582
      _Version        =   131074
      ForeColor       =   16777215
      BackColor       =   0
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      AutoSize        =   3
      Alignment       =   0
      Begin VB.Label Label1 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         Caption         =   "Lives:"
         ForeColor       =   &H0000FF00&
         Height          =   252
         Left            =   72
         TabIndex        =   11
         Top             =   24
         Width           =   636
      End
      Begin VB.Label lblLives 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         Caption         =   "3"
         ForeColor       =   &H0000FF00&
         Height          =   252
         Left            =   768
         TabIndex        =   12
         Top             =   48
         Width           =   300
      End
      Begin VB.Label Label2 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         Caption         =   "Destroyed Phones:"
         ForeColor       =   &H000000FF&
         Height          =   252
         Left            =   1392
         TabIndex        =   13
         Top             =   24
         Width           =   2004
      End
      Begin VB.Label lblEnemies 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         Caption         =   "0"
         ForeColor       =   &H000000FF&
         Height          =   252
         Left            =   3432
         TabIndex        =   14
         Top             =   24
         Width           =   396
      End
   End
   Begin MSComDlg.CommonDialog CMDialog1 
      Left            =   192
      Top             =   2616
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      FontSize        =   0
      MaxFileSize     =   256
   End
   Begin VB.PictureBox Picture4 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H00000000&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   480
      Index           =   2
      Left            =   1620
      Picture         =   "SPACE1.frx":030A
      ScaleHeight     =   480
      ScaleWidth      =   480
      TabIndex        =   10
      Top             =   720
      Visible         =   0   'False
      Width           =   480
   End
   Begin VB.PictureBox Picture4 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H00000000&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   480
      Index           =   1
      Left            =   1968
      Picture         =   "SPACE1.frx":0614
      ScaleHeight     =   480
      ScaleWidth      =   480
      TabIndex        =   9
      Top             =   3744
      Visible         =   0   'False
      Width           =   480
   End
   Begin VB.PictureBox Picture3 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H00000000&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   480
      Index           =   2
      Left            =   3720
      Picture         =   "SPACE1.frx":091E
      ScaleHeight     =   480
      ScaleWidth      =   480
      TabIndex        =   8
      Top             =   456
      Width           =   480
   End
   Begin VB.PictureBox Picture3 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H00000000&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   480
      Index           =   1
      Left            =   672
      Picture         =   "SPACE1.frx":0C28
      ScaleHeight     =   480
      ScaleWidth      =   480
      TabIndex        =   7
      Top             =   480
      Width           =   480
   End
   Begin VB.PictureBox Picture3 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H00000000&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   480
      Index           =   0
      Left            =   2424
      Picture         =   "SPACE1.frx":0F32
      ScaleHeight     =   480
      ScaleWidth      =   480
      TabIndex        =   6
      Top             =   1176
      Width           =   480
   End
   Begin VB.PictureBox Picture7 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H00000000&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   480
      Left            =   3192
      Picture         =   "SPACE1.frx":123C
      ScaleHeight     =   480
      ScaleWidth      =   480
      TabIndex        =   5
      Top             =   2208
      Visible         =   0   'False
      Width           =   480
   End
   Begin VB.PictureBox Picture6 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H00000000&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   480
      Left            =   2580
      Picture         =   "SPACE1.frx":1546
      ScaleHeight     =   480
      ScaleWidth      =   480
      TabIndex        =   4
      Top             =   2220
      Visible         =   0   'False
      Width           =   480
   End
   Begin VB.PictureBox Picture5 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H00000000&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   480
      Left            =   2040
      Picture         =   "SPACE1.frx":1850
      ScaleHeight     =   480
      ScaleWidth      =   480
      TabIndex        =   3
      Top             =   2220
      Visible         =   0   'False
      Width           =   480
   End
   Begin VB.Timer Timer1 
      Interval        =   100
      Left            =   1056
      Top             =   3120
   End
   Begin VB.PictureBox Picture4 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H00000000&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   480
      Index           =   0
      Left            =   480
      Picture         =   "SPACE1.frx":1B5A
      ScaleHeight     =   480
      ScaleWidth      =   480
      TabIndex        =   2
      Top             =   720
      Visible         =   0   'False
      Width           =   480
   End
   Begin VB.PictureBox Picture2 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H00000000&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   480
      Left            =   1320
      Picture         =   "SPACE1.frx":1E64
      ScaleHeight     =   480
      ScaleWidth      =   480
      TabIndex        =   1
      Top             =   336
      Visible         =   0   'False
      Width           =   480
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      AutoSize        =   -1  'True
      BackColor       =   &H00000000&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   480
      Left            =   2250
      Picture         =   "SPACE1.frx":216E
      ScaleHeight     =   480
      ScaleWidth      =   480
      TabIndex        =   0
      Top             =   4860
      Width           =   480
   End
   Begin VB.Image imgBoss 
      Appearance      =   0  'Flat
      Height          =   7350
      Left            =   360
      Picture         =   "SPACE1.frx":2478
      Top             =   -210
      Width           =   9750
   End
   Begin VB.Menu FileMenu 
      Caption         =   "&File"
      Begin VB.Menu mnuOpen 
         Caption         =   "&Load Game Options"
      End
      Begin VB.Menu mnuSave 
         Caption         =   "&Save Game Options"
      End
      Begin VB.Menu mnuNewGame 
         Caption         =   "&New Game"
         Shortcut        =   ^N
      End
      Begin VB.Menu mnuPause 
         Caption         =   "&Pause"
         Shortcut        =   ^P
      End
      Begin VB.Menu mnuHighScores 
         Caption         =   "&High Scores"
      End
      Begin VB.Menu Spe2 
         Caption         =   "-"
      End
      Begin VB.Menu mnuBoss 
         Caption         =   "&Boss Switch"
         Shortcut        =   ^B
      End
      Begin VB.Menu mnuBossGone 
         Caption         =   "&Boss Gone"
         Shortcut        =   ^G
      End
      Begin VB.Menu Sep5 
         Caption         =   "-"
      End
      Begin VB.Menu ExitItem 
         Caption         =   "E&xit"
         Shortcut        =   ^X
      End
   End
   Begin VB.Menu mnuHelp 
      Caption         =   "&Help"
      Begin VB.Menu mnuHowTo 
         Caption         =   "&How To Play"
      End
      Begin VB.Menu Sep3 
         Caption         =   "-"
      End
      Begin VB.Menu AboutItem 
         Caption         =   "&About"
      End
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub AboutItem_Click()
'About Message
 MsgBox "This Game was developed by the Ford Motor Corp. BAC Systems group for the VB Class. We learned a lot about Visual Basic while developing it, and thought others might find it fun too. Please send comments or sugestions to Richard Hoxie @CompuServe - 76432,3063. Play at own risk :-)!!!", MB_ICONINFORMATION, "Phone Attack"

End Sub

Private Sub BlowUpEnemy()
'As the title says it blows up the current enemy who was hit
Dim flip, loop_index As Integer

    flip = True

    'Make enemy hit invisble
    Picture3(EnemyHitNum).Visible = False
    'Move Explosion to last enemy coordinates
    Picture5.Move Enemys(EnemyHitNum).EXcord, Enemys(EnemyHitNum).EYcord
    Picture5.Visible = True
    'Do the shake
    For loop_index = 1 To Delay
        If flip = True Then
           Enemys(EnemyHitNum).EYcord = Enemys(EnemyHitNum).EYcord + 10
           flip = False
        Else
           Enemys(EnemyHitNum).EYcord = Enemys(EnemyHitNum).EYcord - 10
           flip = True
        End If
    Next loop_index

    Picture6.Move Enemys(EnemyHitNum).EXcord, Enemys(EnemyHitNum).EYcord
    Picture5.Visible = False
    Picture6.Visible = True
    For loop_index = 1 To Delay
        If flip = True Then
           Enemys(EnemyHitNum).EYcord = Enemys(EnemyHitNum).EYcord + 10
           flip = False

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -