home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmspel
- AutoRedraw = -1 'True
- BackColor = &H0042FF42&
- Caption = "PRESS F5 TO START NEW GAME"
- ClientHeight = 6525
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 8970
- Icon = "Spel.frx":0000
- LinkTopic = "Form1"
- ScaleHeight = 6525
- ScaleWidth = 8970
- StartUpPosition = 3 'Windows Default
- WindowState = 2 'Maximized
- Begin VB.TextBox txtInfo
- BackColor = &H0000FF00&
- Enabled = 0 'False
- Height = 285
- Left = 4200
- TabIndex = 4
- Top = 5760
- Width = 2175
- End
- Begin VB.Timer TimerT
- Interval = 1000
- Left = 5760
- Top = 3720
- End
- Begin VB.TextBox txtTime
- BackColor = &H0000FF00&
- Enabled = 0 'False
- Height = 285
- Left = 4320
- TabIndex = 3
- Text = "Time past:"
- Top = 6240
- Width = 2175
- End
- Begin VB.Timer Timer4
- Enabled = 0 'False
- Interval = 100
- Left = 5160
- Top = 3720
- End
- Begin VB.TextBox txtkills
- BackColor = &H0000FF00&
- Enabled = 0 'False
- Height = 285
- Left = 2160
- TabIndex = 1
- Text = "Kills : 0"
- Top = 6240
- Width = 2175
- End
- Begin VB.Timer Timer3
- Interval = 1
- Left = 4560
- Top = 3720
- End
- Begin VB.Timer Timer2
- Interval = 50
- Left = 4560
- Top = 4200
- End
- Begin VB.TextBox txtbullets
- BackColor = &H0000FF00&
- Enabled = 0 'False
- Height = 285
- Left = 0
- TabIndex = 0
- Text = "Bullets Left :"
- Top = 6240
- Width = 2175
- End
- Begin VB.Timer Timer1
- Interval = 100
- Left = 5160
- Top = 4200
- End
- Begin VB.Label lblVictory
- BackColor = &H0042FF42&
- Caption = "VICTORY !!!"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 24
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H000000FF&
- Height = 495
- Left = 1440
- TabIndex = 6
- Top = 1560
- Width = 2895
- End
- Begin VB.Label lblreloading
- BackColor = &H0042FF42&
- Caption = "RELOADING..."
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 13.5
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 0
- TabIndex = 5
- Top = 0
- Width = 1935
- End
- Begin VB.Label lblGameOver
- BackColor = &H0042FF42&
- Caption = "GAME OVER"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 24
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H000000FF&
- Height = 495
- Left = 4200
- TabIndex = 2
- Top = 2760
- Width = 2895
- End
- Begin VB.Image gif
- Height = 210
- Index = 21
- Left = 480
- Picture = "Spel.frx":030A
- Top = 3360
- Width = 270
- End
- Begin VB.Image gif
- Height = 210
- Index = 20
- Left = 240
- Picture = "Spel.frx":069F
- Top = 3360
- Width = 270
- End
- Begin VB.Image gif
- Height = 210
- Index = 19
- Left = 960
- Picture = "Spel.frx":0A34
- Top = 3120
- Width = 270
- End
- Begin VB.Image gif
- Height = 210
- Index = 18
- Left = 720
- Picture = "Spel.frx":0DC9
- Top = 3120
- Width = 270
- End
- Begin VB.Image gif
- Height = 210
- Index = 17
- Left = 480
- Picture = "Spel.frx":115E
- Top = 3120
- Width = 270
- End
- Begin VB.Image gif
- Height = 210
- Index = 16
- Left = 240
- Picture = "Spel.frx":14F3
- Top = 3120
- Width = 270
- End
- Begin VB.Image gif
- Height = 210
- Index = 15
- Left = 960
- Picture = "Spel.frx":1888
- Top = 2880
- Width = 270
- End
- Begin VB.Image gif
- Height = 210
- Index = 14
- Left = 720
- Picture = "Spel.frx":1C1D
- Top = 2880
- Width = 270
- End
- Begin VB.Image gif
- Height = 210
- Index = 13
- Left = 480
- Picture = "Spel.frx":1FB2
- Top = 2880
- Width = 270
- End
- Begin VB.Image gif
- Height = 210
- Index = 12
- Left = 240
- Picture = "Spel.frx":2347
- Top = 2880
- Width = 270
- End
- Begin VB.Image gif
- Height = 210
- Index = 11
- Left = 960
- Picture = "Spel.frx":26DC
- Top = 2640
- Width = 270
- End
- Begin VB.Image ShootRight
- Height = 255
- Left = 2520
- Top = 4320
- Width = 255
- End
- Begin VB.Image ShootLeft
- Height = 255
- Left = 2040
- Top = 4320
- Width = 255
- End
- Begin VB.Image gif
- Height = 210
- Index = 10
- Left = 720
- Picture = "Spel.frx":2A71
- Top = 2640
- Width = 270
- End
- Begin VB.Image gif
- Height = 210
- Index = 9
- Left = 480
- Picture = "Spel.frx":2E06
- Top = 2640
- Width = 270
- End
- Begin VB.Image gif
- Height = 210
- Index = 8
- Left = 240
- Picture = "Spel.frx":319B
- Top = 2640
- Width = 270
- End
- Begin VB.Image gif
- Height = 210
- Index = 7
- Left = 960
- Picture = "Spel.frx":3530
- Top = 2400
- Width = 270
- End
- Begin VB.Image gif
- Height = 210
- Index = 6
- Left = 720
- Picture = "Spel.frx":38C5
- Top = 2400
- Width = 270
- End
- Begin VB.Image gif
- Height = 210
- Index = 5
- Left = 480
- Picture = "Spel.frx":3C5A
- Top = 2400
- Width = 270
- End
- Begin VB.Image gif
- Height = 210
- Index = 4
- Left = 240
- Picture = "Spel.frx":3FEF
- Top = 2400
- Width = 270
- End
- Begin VB.Image gif
- Height = 210
- Index = 3
- Left = 960
- Picture = "Spel.frx":4384
- Top = 2160
- Width = 270
- End
- Begin VB.Image gif
- Height = 210
- Index = 2
- Left = 720
- Picture = "Spel.frx":4719
- Top = 2160
- Width = 270
- End
- Begin VB.Image gif
- Height = 210
- Index = 1
- Left = 480
- Picture = "Spel.frx":4AAE
- Top = 2160
- Width = 270
- End
- Begin VB.Image kogel
- Height = 345
- Index = 10
- Left = 3960
- Picture = "Spel.frx":4E43
- Top = 4920
- Width = 15
- End
- Begin VB.Image kogel
- Height = 345
- Index = 9
- Left = 4200
- Picture = "Spel.frx":517A
- Top = 4920
- Width = 15
- End
- Begin VB.Image kogel
- Height = 345
- Index = 8
- Left = 4680
- Picture = "Spel.frx":54B1
- Top = 4920
- Width = 15
- End
- Begin VB.Image kogel
- Height = 345
- Index = 7
- Left = 4920
- Picture = "Spel.frx":57E8
- Top = 4920
- Width = 15
- End
- Begin VB.Image kogel
- Height = 345
- Index = 6
- Left = 5160
- Picture = "Spel.frx":5B1F
- Top = 4920
- Width = 15
- End
- Begin VB.Image kogel
- Height = 345
- Index = 5
- Left = 5400
- Picture = "Spel.frx":5E56
- Top = 4920
- Width = 15
- End
- Begin VB.Image kogel
- Height = 345
- Index = 4
- Left = 5640
- Picture = "Spel.frx":618D
- Top = 4920
- Width = 15
- End
- Begin VB.Image kogel
- Height = 345
- Index = 3
- Left = 5880
- Picture = "Spel.frx":64C4
- Top = 4920
- Width = 15
- End
- Begin VB.Image kogel
- Height = 345
- Index = 2
- Left = 6120
- Picture = "Spel.frx":67FB
- Top = 4920
- Width = 15
- End
- Begin VB.Image kogel
- Height = 345
- Index = 1
- Left = 3720
- Picture = "Spel.frx":6B32
- Top = 4920
- Width = 15
- End
- Begin VB.Image vermoord
- Height = 555
- Left = 5400
- Picture = "Spel.frx":6E69
- Stretch = -1 'True
- Top = 480
- Width = 1050
- End
- Begin VB.Image dood
- Height = 1200
- Left = 240
- Picture = "Spel.frx":834F
- Top = 4320
- Width = 1230
- End
- Begin VB.Image kogel
- Height = 345
- Index = 0
- Left = 4440
- Picture = "Spel.frx":8C04
- Top = 4920
- Width = 15
- End
- Begin VB.Image gif
- Height = 210
- Index = 0
- Left = 240
- Picture = "Spel.frx":8F3B
- Top = 2160
- Width = 270
- End
- Begin VB.Image monster
- Height = 570
- Left = 4680
- Picture = "Spel.frx":92D0
- Stretch = -1 'True
- Top = 480
- Visible = 0 'False
- Width = 540
- End
- Begin VB.Image Peet
- Height = 795
- Left = 2040
- Picture = "Spel.frx":985B
- Top = 5160
- Width = 1290
- End
- Attribute VB_Name = "frmspel"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 'Exit the game always by pressing F12 !!!!!
- '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- '************************************************************
- ' My original language is dutch, so for your understanding:
- ' Kogel means bullet
- ' Gif means posion
- ' GifSpuit is the spitting of posion
- ' This is just for you to better understand the codes
- ' Enjoy the game
- ' If you know new features, add them and put them online
- ' My email address is agrisman@hotmail.com
- '************************************************************
- Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
- Dim s
- Dim text As String
- 'if F1 is been pressed
- If KeyCode = vbKeyF1 Then
- text = "Move left and right with the left and right keys on your keyboard and shoot with the Control key (ctrl)." + Chr(10) + Chr(13)
- text = text + "This game was made by Agrisman and is totaly free. Mail me at agrisamn@hotmail.com ."
- MsgBox text
- End If
- 'if F5 is been pressed
- If KeyCode = vbKeyF5 Then
- StartGame
- s = mciSendString("play " & App.Path & "\snd\" & Music, 0&, 0, 0)
- End If
- If KeyCode = vbKeyF12 Then
- Unload Me
- End If
- 'if left is been pressed
- If KeyCode = vbKeyLeft Then
- GoLeft
- 'if right is been pressed
- ElseIf KeyCode = vbKeyRight Then
- GoRight
- End If
- 'if there is a victory or a gameover the ctrl key is useless
- If Victory = 0 And GameOver = 0 Then
- If KeyCode = vbKeyControl Then
- nrKogel = nrKogel + 1
- Shoot (nrKogel)
- End If
- End If
- End Sub
- Private Sub Form_Load()
- Dim i As Integer
- Print "PRESS F5"
- frmspel.Tag = ""
- Peet.Visible = False
- monster.Visible = False
- dood.Visible = False
- vermoord.Visible = False
- txtbullets.Visible = False
- txtkills.Visible = False
- txtTime.Visible = False
- txtInfo.Visible = False
- gifM = gif(1).Width / 2
- nrGif = -1
- TimeM = 0
- TimeS = 0
- lblGameOver.Visible = False
- lblVictory.Visible = False
- Victory = 1
- GameOver = 1
- For i = 0 To 10
- kogel(i).Visible = False
- kogel(i).Top = ScaleHeight - 1000
-
- For i = 0 To 21
- gif(i).Visible = False
- gif(i).Top = monster.Top + monster.Height
- For i = 0 To 21
- If nrGif < i Then
- gif(i).Left = monster.Left + (monster.Width / 2) - gifM
- End If
- GifSpuitAction = 0
- track = 0
- Timer1.Enabled = True
- Timer2.Enabled = False
- Timer3.Enabled = True
- Timer4.Enabled = True
- TimerT.Enabled = True
- Bullet1 = 0
- Bullet2 = 0
- Bullet3 = 0
- Bullet4 = 0
- Bullet5 = 0
- Bullet6 = 0
- Bullet7 = 0
- Bullet8 = 0
- Bullet9 = 0
- Bullet10 = 0
- Gif0 = 0
- Gif1 = 0
- Gif2 = 0
- Gif3 = 0
- Gif4 = 0
- Gif5 = 0
- Gif6 = 0
- Gif7 = 0
- Gif8 = 0
- Gif9 = 0
- Gif10 = 0
- Gif11 = 0
- Gif12 = 0
- Gif13 = 0
- Gif14 = 0
- Gif15 = 0
- Gif16 = 0
- Gif17 = 0
- Gif18 = 0
- Gif19 = 0
- Gif20 = 0
- Gif21 = 0
- Ran = 1950
- Tel = 0
- Kill = 0
- txtkills.text = "Kills : " + Str(Kill)
- End Sub
- Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- 'Makes mouse not moveable/must be declared in the module
- Dim NewRect As RECT
- Dim erg As Long
- NewRect.Left = -10
- NewRect.Top = -10
- erg& = ClipCursor(NewRect)
- End Sub
- Private Sub Form_Terminate()
- Dim erg As Long
- Dim NewRect As RECT
- Dim s
- 'Makes the mouse movable again
- With NewRect
- .Left = 0&
- .Top = 0&
- .Right = Screen.Width / Screen.TwipsPerPixelX
- .Bottom = Screen.Height / Screen.TwipsPerPixelY
- End With
- erg& = ClipCursor(NewRect)
- 'stops playing sound
- s = mciSendString("close " & App.Path & "\snd\" & Music, 0&, 0, 0)
- End
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- Dim erg As Long
- Dim NewRect As RECT
- Dim s
- 'same as terminate
- With NewRect
- .Left = 0&
- .Top = 0&
- .Right = Screen.Width / Screen.TwipsPerPixelX
- .Bottom = Screen.Height / Screen.TwipsPerPixelY
- End With
- erg& = ClipCursor(NewRect)
- s = mciSendString("close " & App.Path & "\snd\" & Music, 0&, 0, 0)
- End
- End Sub
- Public Function Shoot(TimeS As Integer)
- 'Makes sure that when a bullet is fired it is
- 'fired from your gun and the first when from
- 'your left gun , next from your right gun
- Select Case nrKogel
- Case 0
- Bullet0 = 1
- kogel(nrKogel).Left = ShootLeft.Left
- kogel(nrKogel).Top = ShootLeft.Top - kogel(nrKogel).Height
- kogel(nrKogel).Visible = True
- PlaySound "snd\shot.wav", 1, 1
- Case 1
- Bullet1 = 1
- kogel(nrKogel).Left = ShootRight.Left
- kogel(nrKogel).Top = ShootRight.Top - kogel(nrKogel).Height
- kogel(nrKogel).Visible = True
- PlaySound "snd\shot.wav", 1, 1
- Case 2
- Bullet2 = 1
- kogel(nrKogel).Left = ShootLeft.Left
- kogel(nrKogel).Top = ShootLeft.Top - kogel(nrKogel).Height
- kogel(nrKogel).Visible = True
- PlaySound "snd\shot.wav", 1, 1
- Case 3
- Bullet3 = 1
- kogel(nrKogel).Left = ShootRight.Left
- kogel(nrKogel).Top = ShootRight.Top - kogel(nrKogel).Height
- kogel(nrKogel).Visible = True
- PlaySound "snd\shot.wav", 1, 1
- Case 4
- Bullet4 = 1
- kogel(nrKogel).Left = ShootLeft.Left
- kogel(nrKogel).Top = ShootLeft.Top - kogel(nrKogel).Height
- kogel(nrKogel).Visible = True
- PlaySound "snd\shot.wav", 1, 1
- Case 5
- Bullet5 = 1
- kogel(nrKogel).Left = ShootRight.Left
- kogel(nrKogel).Top = ShootRight.Top - kogel(nrKogel).Height
- kogel(nrKogel).Visible = True
- PlaySound "snd\shot.wav", 1, 1
- Case 6
- Bullet6 = 1
- kogel(nrKogel).Left = ShootLeft.Left
- kogel(nrKogel).Top = ShootLeft.Top - kogel(nrKogel).Height
- kogel(nrKogel).Visible = True
- PlaySound "snd\shot.wav", 1, 1
- Case 7
- Bullet7 = 1
- kogel(nrKogel).Left = ShootRight.Left
- kogel(nrKogel).Top = ShootRight.Top - kogel(nrKogel).Height
- kogel(nrKogel).Visible = True
- PlaySound "snd\shot.wav", 1, 1
- Case 8
- Bullet8 = 1
- kogel(nrKogel).Left = ShootLeft.Left
- kogel(nrKogel).Top = ShootLeft.Top - kogel(nrKogel).Height
- kogel(nrKogel).Visible = True
- PlaySound "snd\shot.wav", 1, 1
- Case 9
- Bullet9 = 1
- kogel(nrKogel).Left = ShootRight.Left
- kogel(nrKogel).Top = ShootRight.Top - kogel(nrKogel).Height
- kogel(nrKogel).Visible = True
- PlaySound "snd\shot.wav", 1, 1
- Case 10
- Bullet10 = 1
- kogel(nrKogel).Left = ShootLeft.Left
- kogel(nrKogel).Top = ShootLeft.Top - kogel(nrKogel).Height
- kogel(nrKogel).Visible = True
- PlaySound "snd\shot.wav", 1, 1
- End Select
- Timer1_Timer
- End Function
- Public Function GoLeft()
- If Peet.Left <= 500 Then
- Peet.Left = 0 + 500
- End If
- Peet.Left = Peet.Left - 500
- ShootLeft.Top = Peet.Top + 20
- ShootLeft.Left = Peet.Left + 60
- ShootRight.Top = Peet.Top + 20
- ShootRight.Left = Peet.Left + Peet.Width - 320
- End Function
- Public Sub GoRight()
- If Peet.Left + Peet.Width > ScaleWidth - 500 Then
- Peet.Left = ScaleWidth - Peet.Width - 500
- End If
- Peet.Left = Peet.Left + 500
- ShootLeft.Top = Peet.Top + 20
- ShootLeft.Left = Peet.Left + 60
- ShootRight.Top = Peet.Top + 20
- ShootRight.Left = Peet.Left + Peet.Width - 320
- End Sub
- Private Sub Timer1_Timer()
- 'if your 10 bullets are fired and still on screen, then
- 'wait untill a bullet is out of vision
- If nrKogel > 10 Then
- txtbullets = "Bullets Reloading..."
- lblreloading.Visible = True
- lblreloading.Visible = False
- txtbullets = "Bullets left :" & Str(10 - nrKogel)
- End If
- 'every bullet (from bullet(0) to (10)) moves with this
- 'code, there has to be a simpler way, but I wouldn't know it
- 'so if you do, give me a simple solution
- If Bullet0 = 1 Then
- If kogel(0).Top + kogel(0).Height < 0 Then
- kogel(0).Visible = False
- kogel(0).Top = ScaleHeight - 1000
- Bullet0 = 0
- nrKogel = -1
- End If
- kogel(0).Top = kogel(0).Top - 200
- DoEvents
- End If
- If Bullet1 = 1 Then
- If kogel(1).Top + kogel(1).Height < 0 Then
- kogel(1).Visible = False
- kogel(1).Top = ScaleHeight - 1000
- Bullet1 = 0
- End If
- kogel(1).Top = kogel(1).Top - 200
- DoEvents
- End If
- If Bullet2 = 1 Then
- If kogel(2).Top + kogel(2).Height < 0 Then
- kogel(2).Visible = False
- kogel(2).Top = ScaleHeight - 1000
- Bullet2 = 0
- End If
- kogel(2).Top = kogel(2).Top - 200
- DoEvents
- End If
- If Bullet3 = 1 Then
- If kogel(3).Top + kogel(3).Height < 0 Then
- kogel(3).Visible = False
- kogel(3).Top = ScaleHeight - 1000
- Bullet3 = 0
- End If
- kogel(3).Top = kogel(3).Top - 200
- DoEvents
- End If
- If Bullet4 = 1 Then
- If kogel(4).Top + kogel(4).Height < 0 Then
- kogel(4).Visible = False
- kogel(4).Top = ScaleHeight - 1000
- Bullet4 = 0
- End If
- kogel(4).Top = kogel(4).Top - 200
- DoEvents
- End If
- If Bullet5 = 1 Then
- If kogel(5).Top + kogel(5).Height < 0 Then
- kogel(5).Visible = False
- kogel(5).Top = ScaleHeight - 1000
- Bullet5 = 0
- End If
- kogel(5).Top = kogel(5).Top - 200
- DoEvents
- End If
- If Bullet6 = 1 Then
- If kogel(6).Top + kogel(6).Height < 0 Then
- kogel(6).Visible = False
- kogel(6).Top = ScaleHeight - 1000
- Bullet6 = 0
- End If
- kogel(6).Top = kogel(6).Top - 200
- DoEvents
- End If
- If Bullet7 = 1 Then
- If kogel(7).Top + kogel(7).Height < 0 Then
- kogel(7).Visible = False
- kogel(7).Top = ScaleHeight - 1000
- Bullet7 = 0
- End If
- kogel(7).Top = kogel(7).Top - 200
- DoEvents
- End If
- If Bullet8 = 1 Then
- If kogel(8).Top + kogel(8).Height < 0 Then
- kogel(8).Visible = False
- kogel(8).Top = ScaleHeight - 1000
- Bullet8 = 0
- End If
- kogel(8).Top = kogel(8).Top - 200
- DoEvents
- End If
- If Bullet9 = 1 Then
- If kogel(9).Top + kogel(9).Height < 0 Then
- kogel(9).Visible = False
- kogel(9).Top = ScaleHeight - 1000
- Bullet9 = 0
- End If
- kogel(9).Top = kogel(9).Top - 200
- DoEvents
- End If
- If Bullet10 = 1 Then
- If kogel(10).Top + kogel(10).Height < 0 Then
- kogel(10).Visible = False
- kogel(10).Top = ScaleHeight - 1000
- Bullet10 = 0
- End If
- kogel(10).Top = kogel(10).Top - 200
- DoEvents
- End If
- End Sub
- Private Sub Timer3_Timer()
- Dim i, t As Integer
- 'Checks if a bullet hits the alien (monster=alien)
- For i = 0 To 10
- If kogel(i).Top < monster.Top + monster.Height And kogel(i).Top > 300 Then
- If kogel(i).Left > monster.Left And kogel(i).Left < monster.Left + monster.Width Then
- monster.Visible = False
- vermoord.Left = monster.Left
- vermoord.Top = monster.Top
- vermoord.Visible = True
- PlaySound "snd\kill.wav", 1, 1
- monster.Top = -1000
- monster.Left = -1000
- If Kill = 19 Then
- Victory = 1
- PlaySound "snd\victory.wav", 1, 1
- lblVictory.Top = (ScaleHeight / 2) - (lblVictory.Height / 2)
- lblVictory.Left = (ScaleWidth / 2) - (lblVictory.Width / 2)
- lblVictory.Visible = True
- Timer1.Enabled = False
- Timer2.Enabled = False
- Timer3.Enabled = False
- Timer4.Enabled = False
- TimerT.Enabled = False
- End If
- Kill = Kill + 1
- txtkills.text = "Kills : " + Str(Kill)
- Timer3.Enabled = False
- Again
- Exit For
- End If
- End If
- DoEvents
- 'Checks if the alien hits you (you are Peet)
- For i = 0 To 21
- If gif(i).Top + gif(i).Height > Peet.Top And gif(i).Top < ScaleHeight - 100 Then
- If gif(i).Left > Peet.Left And gif(i).Left < Peet.Left + Peet.Width Then
- GameOver = 1
- Peet.Visible = False
- dood.Left = Peet.Left
- dood.Top = Peet.Top
- dood.Visible = True
- lblGameOver.Left = (ScaleWidth / 2) - (lblGameOver.Width / 2)
- lblGameOver.Top = (ScaleHeight / 2) - (lblGameOver.Height)
- lblGameOver.Visible = True
- frmspel.Tag = Kill
- PlaySound "snd\gameover.wav", 1, 1
- Timer1.Enabled = False
- Timer2.Enabled = False
- Timer3.Enabled = False
- Timer4.Enabled = False
- TimerT.Enabled = False
- Exit For
- End If
- End If
- DoEvents
- End Sub
- Public Sub Again()
- 'Makes the next alien alive
- monster.Left = ((ScaleWidth - monster.Width) * Rnd) + 1
- monster.Top = 500
- 'monster.Visible = True
- Timer4.Enabled = True
- End Sub
- Private Sub Timer4_Timer()
- 'when the alien is killed you get a extra kill and the
- 'picture of the killed good guy (=vermoord picture)
- 'is not visible
- Tel = Tel + 1
- If Tel = 2 Then
- vermoord.Top = -1000
- vermoord.Left = -1000
- monster.Visible = True
- vermoord.Visible = False
- Timer3.Enabled = True
- Tel = 0
- Timer4.Enabled = False
- DoEvents
- End If
- End Sub
- Public Sub Gifspuit()
- Dim i As Integer
- 'If GifSpuitAction = 1 Then
- 'gifspuit = posion of the alien
- 'if the picture of the posion is no longer visible
- 'on the screen then it returns to the height of the
- 'alien to refire the posion. If not, the posion(=gif)
- 'moves down
- If Gif0 = 1 Then
- If gif(0).Top + gif(0).Height > ScaleHeight Then
- gif(0).Visible = False
- gif(0).Top = monster.Top
- Gif0 = 0
- End If
- gif(0).Top = gif(0).Top + 200
- DoEvents
- End If
- If Gif1 = 1 Then
- If gif(1).Top + gif(1).Height > ScaleHeight Then
- gif(1).Visible = False
- gif(1).Top = monster.Top
- Gif1 = 0
- End If
- gif(1).Top = gif(1).Top + 200
- DoEvents
- End If
- If Gif2 = 1 Then
- If gif(2).Top + gif(2).Height > ScaleHeight Then
- gif(2).Visible = False
- gif(2).Top = monster.Top
- Gif2 = 0
- End If
- gif(2).Top = gif(2).Top + 200
- DoEvents
- End If
- If Gif3 = 1 Then
- If gif(3).Top + gif(3).Height > ScaleHeight Then
- gif(3).Visible = False
- gif(3).Top = monster.Top
- Gif3 = 0
- End If
- gif(3).Top = gif(3).Top + 200
- DoEvents
- End If
- If Gif4 = 1 Then
- If gif(4).Top + gif(4).Height > ScaleHeight Then
- gif(4).Visible = False
- gif(4).Top = monster.Top
- Gif4 = 0
- End If
- gif(4).Top = gif(4).Top + 200
- DoEvents
- End If
- If Gif5 = 1 Then
- If gif(5).Top + gif(5).Height > ScaleHeight Then
- gif(5).Visible = False
- gif(5).Top = monster.Top
- Gif5 = 0
- End If
- gif(5).Top = gif(5).Top + 200
- DoEvents
- End If
- If Gif6 = 1 Then
- If gif(6).Top + gif(6).Height > ScaleHeight Then
- gif(6).Visible = False
- gif(6).Top = monster.Top
- Gif6 = 0
- End If
- gif(6).Top = gif(6).Top + 200
- DoEvents
- End If
- If Gif7 = 1 Then
- If gif(7).Top + gif(7).Height > ScaleHeight Then
- gif(7).Visible = False
- gif(7).Top = monster.Top
- Gif7 = 0
- End If
- gif(7).Top = gif(7).Top + 200
- DoEvents
- End If
- If Gif8 = 1 Then
- If gif(8).Top + gif(8).Height > ScaleHeight Then
- gif(8).Visible = False
- gif(8).Top = monster.Top
- Gif8 = 0
- End If
- gif(8).Top = gif(8).Top + 200
- DoEvents
- End If
- If Gif9 = 1 Then
- If gif(9).Top + gif(9).Height > ScaleHeight Then
- gif(9).Visible = False
- gif(9).Top = monster.Top
- Gif9 = 0
- End If
- gif(9).Top = gif(9).Top + 200
- DoEvents
- End If
- If Gif10 = 1 Then
- If gif(10).Top + gif(10).Height > ScaleHeight Then
- gif(10).Visible = False
- gif(10).Top = monster.Top
- Gif10 = 0
- End If
- gif(10).Top = gif(10).Top + 200
- DoEvents
- End If
- If Gif11 = 1 Then
- If gif(11).Top + gif(11).Height > ScaleHeight Then
- gif(11).Visible = False
- gif(11).Top = monster.Top
- Gif11 = 0
- End If
- gif(11).Top = gif(11).Top + 200
- DoEvents
- End If
- If Gif12 = 1 Then
- If gif(12).Top + gif(12).Height > ScaleHeight Then
- gif(12).Visible = False
- gif(12).Top = monster.Top
- Gif12 = 0
- End If
- gif(12).Top = gif(12).Top + 200
- DoEvents
- End If
- If Gif13 = 1 Then
- If gif(13).Top + gif(13).Height > ScaleHeight Then
- gif(13).Visible = False
- gif(13).Top = monster.Top
- Gif13 = 0
- End If
- gif(13).Top = gif(13).Top + 200
- DoEvents
- End If
- If Gif14 = 1 Then
- If gif(14).Top + gif(14).Height > ScaleHeight Then
- gif(14).Visible = False
- gif(14).Top = monster.Top
- Gif14 = 0
- End If
- gif(14).Top = gif(14).Top + 200
- DoEvents
- End If
- If Gif15 = 1 Then
- If gif(15).Top + gif(15).Height > ScaleHeight Then
- gif(15).Visible = False
- gif(15).Top = monster.Top
- Gif15 = 0
- End If
- gif(15).Top = gif(15).Top + 200
- DoEvents
- End If
- If Gif16 = 1 Then
- If gif(16).Top + gif(16).Height > ScaleHeight Then
- gif(16).Visible = False
- gif(16).Top = monster.Top
- Gif16 = 0
- End If
- gif(16).Top = gif(16).Top + 200
- DoEvents
- End If
- If Gif17 = 1 Then
- If gif(17).Top + gif(17).Height > ScaleHeight Then
- gif(17).Visible = False
- gif(17).Top = monster.Top
- Gif17 = 0
- End If
- gif(17).Top = gif(17).Top + 200
- DoEvents
- End If
- If Gif18 = 1 Then
- If gif(18).Top + gif(18).Height > ScaleHeight Then
- gif(18).Visible = False
- gif(18).Top = monster.Top
- Gif18 = 0
- End If
- gif(18).Top = gif(18).Top + 200
- DoEvents
- End If
- If Gif19 = 1 Then
- If gif(19).Top + gif(19).Height > ScaleHeight Then
- gif(19).Visible = False
- gif(19).Top = monster.Top
- Gif19 = 0
- End If
- gif(19).Top = gif(19).Top + 200
- DoEvents
- End If
- If Gif20 = 1 Then
- If gif(20).Top + gif(20).Height > ScaleHeight Then
- gif(20).Visible = False
- gif(20).Top = monster.Top
- Gif20 = 0
- End If
- gif(20).Top = gif(20).Top + 200
- DoEvents
- End If
- If Gif21 = 1 Then
- If gif(21).Top + gif(21).Height > ScaleHeight Then
- gif(21).Visible = False
- gif(21).Top = monster.Top
- Gif21 = 0
- End If
- gif(21).Top = gif(21).Top + 200
- DoEvents
- End If
- 'End If
- End Sub
- Private Sub Timer2_Timer()
- 'movements of the alien
- Ran = (160 * Rnd) + 1
- If nrGif <= 21 Then
- nrGif = nrGif + 1
- ElseIf nrGif = 22 And (gif(0).Top + gif(0).Height) > ScaleHeight Then
- nrGif = 0
- End If
- If monster.Left < 300 Then
- Ran = 40
- End If
- If monster.Left > ScaleWidth - monster.Width - 500 Then
- Ran = 10
- End If
- Ran = Ran / 10
- Select Case Ran
- Case 1
- monster.Left = monster.Left - 400
- Case 2
- monster.Left = monster.Left - 400
- Case 3
- monster.Left = monster.Left - 400
- Case 4
- monster.Left = monster.Left + 400
- Case 5
- monster.Left = monster.Left - 400
- Case 6
- monster.Left = monster.Left - 400
- Case 7
- monster.Left = monster.Left - 400
- Case 8
- monster.Left = monster.Left - 400
- Case 9
- monster.Left = monster.Left + 400
- Case 10
- monster.Left = monster.Left + 400
- Case 11
- monster.Left = monster.Left + 400
- Case 12
- monster.Left = monster.Left - 400
- Case 13
- monster.Left = monster.Left + 400
- Case 14
- monster.Left = monster.Left + 400
- Case 15
- monster.Left = monster.Left - 400
- Case 16
- monster.Left = monster.Left + 300
- End Select
- 'checks if posion can be fired
- Select Case nrGif
- Case 0
- Gif0 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 1
- Gif1 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 2
- Gif2 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 3
- Gif3 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 4
- Gif4 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 5
- Gif5 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 6
- Gif6 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 7
- Gif7 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 8
- Gif8 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 9
- Gif9 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 10
- Gif10 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 11
- Gif11 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 12
- Gif12 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 13
- Gif13 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 14
- Gif14 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 15
- Gif15 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 16
- Gif16 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 17
- Gif17 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 18
- Gif18 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 19
- Gif19 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 20
- Gif20 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- Case 21
- Gif21 = 1
- gif(nrGif).Left = monster.Left + monster.Width / 2
- gif(nrGif).Top = monster.Top + monster.Height
- gif(nrGif).Visible = True
- End Select
- Gifspuit
- End Sub
- Private Sub TimerT_Timer()
- 'makes sure the timer is correct
- TimeS = TimeS + 1
- If TimeS = 60 Then
- TimeM = 1
- TimeS = 0
- End If
- If TimeS < 10 Then
- txtTime.text = "Time past : " & Str(TimeM) & " : 0" & Str(TimeS)
- txtTime.text = "Time past : " & Str(TimeM) & " :" & Str(TimeS)
- End If
- End Sub
- Public Sub StartGame()
- 'everything is set on right place at the begining of
- 'the game
- Form_Load
- Victory = 0
- GameOver = 0
- lblreloading.Visible = False
- txtbullets.Left = 0
- txtbullets.Top = ScaleHeight - txtbullets.Height
- txtbullets.Visible = True
- txtkills.Left = txtbullets.Width + 10
- txtkills.Top = ScaleHeight - txtkills.Height
- txtkills.Visible = True
- txtTime.Left = txtkills.Left + txtkills.Width + 10
- txtTime.Top = ScaleHeight - txtTime.Height
- txtTime.Visible = True
- txtInfo.Visible = True
- txtInfo.Top = ScaleHeight - txtInfo.Height
- txtInfo.Left = txtTime.Left + txtkills.Width
- txtInfo.Width = ScaleWidth - txtInfo.Left
- txtInfo.text = "PRESS F1 for help. F5 to start F12 to quit"
- Peet.Left = ScaleWidth / 2 - Peet.Width / 2
- Peet.Top = ScaleHeight - 1000
- ShootLeft.Top = Peet.Top + 20
- ShootLeft.Left = Peet.Left + 60
- ShootRight.Top = Peet.Top + 20
- ShootRight.Left = Peet.Left + Peet.Width - 320
- Peet.Visible = True
- nrKogel = -1
- monster.Left = ((ScaleWidth - monster.Width) * Rnd) + 1
- monster.Top = 500
- monster.Visible = True
- Timer2.Enabled = True
- End Sub
-