BrU32

VB6 Master Blaster 2 Player Shooter Game SRC

Mar 10th, 2017
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.45 KB | None | 0 0
  1. VERSION 5.00
  2. Begin VB.Form Form1
  3. BackColor = &H00000000&
  4. BorderStyle = 1 'Fixed Single
  5. Caption = "Master Blaster [Version 1.0]"
  6. ClientHeight = 3090
  7. ClientLeft = 45
  8. ClientTop = 735
  9. ClientWidth = 4335
  10. Icon = "Form1.frx":0000
  11. KeyPreview = -1 'True
  12. LinkTopic = "Form1"
  13. MaxButton = 0 'False
  14. ScaleHeight = 3090
  15. ScaleWidth = 4335
  16. StartUpPosition = 2 'CenterScreen
  17. Begin VB.Timer Timer3
  18. Interval = 10
  19. Left = 2160
  20. Top = 1920
  21. End
  22. Begin VB.CommandButton Command2
  23. Caption = "Fire"
  24. Height = 375
  25. Left = 120
  26. TabIndex = 5
  27. Top = 2280
  28. Visible = 0 'False
  29. Width = 1215
  30. End
  31. Begin VB.Timer Timer2
  32. Enabled = 0 'False
  33. Interval = 100
  34. Left = 2640
  35. Top = 1920
  36. End
  37. Begin VB.CommandButton Command1
  38. Caption = "Fire"
  39. Height = 375
  40. Left = 3000
  41. TabIndex = 4
  42. Top = 2280
  43. Visible = 0 'False
  44. Width = 1215
  45. End
  46. Begin VB.PictureBox Picture3
  47. Appearance = 0 'Flat
  48. BackColor = &H00000000&
  49. BorderStyle = 0 'None
  50. ForeColor = &H80000008&
  51. Height = 615
  52. Left = 3600
  53. Picture = "Form1.frx":014A
  54. ScaleHeight = 615
  55. ScaleWidth = 495
  56. TabIndex = 2
  57. Top = 960
  58. Width = 495
  59. End
  60. Begin VB.PictureBox Picture1
  61. Appearance = 0 'Flat
  62. BackColor = &H00000000&
  63. BorderStyle = 0 'None
  64. ForeColor = &H80000008&
  65. Height = 615
  66. Left = 240
  67. Picture = "Form1.frx":0F90
  68. ScaleHeight = 615
  69. ScaleWidth = 495
  70. TabIndex = 0
  71. Top = 960
  72. Width = 495
  73. End
  74. Begin VB.Timer Timer1
  75. Enabled = 0 'False
  76. Interval = 100
  77. Left = 1680
  78. Top = 1920
  79. End
  80. Begin VB.PictureBox Picture2
  81. Appearance = 0 'Flat
  82. BackColor = &H00000000&
  83. BorderStyle = 0 'None
  84. ForeColor = &H80000008&
  85. Height = 135
  86. Left = 3720
  87. Picture = "Form1.frx":1C32
  88. ScaleHeight = 135
  89. ScaleWidth = 255
  90. TabIndex = 1
  91. Top = 1200
  92. Width = 255
  93. End
  94. Begin VB.PictureBox Picture4
  95. Appearance = 0 'Flat
  96. BackColor = &H80000005&
  97. BorderStyle = 0 'None
  98. ForeColor = &H80000008&
  99. Height = 135
  100. Left = 360
  101. Picture = "Form1.frx":1F08
  102. ScaleHeight = 135
  103. ScaleWidth = 255
  104. TabIndex = 3
  105. Top = 1200
  106. Width = 255
  107. End
  108. Begin VB.Menu File
  109. Caption = "File"
  110. Begin VB.Menu Restart
  111. Caption = "Restart"
  112. End
  113. Begin VB.Menu About
  114. Caption = "Controls"
  115. End
  116. Begin VB.Menu Website
  117. Caption = "-"
  118. End
  119. Begin VB.Menu Minimize
  120. Caption = "Web Site"
  121. End
  122. Begin VB.Menu fidgasg
  123. Caption = "Contact Me"
  124. End
  125. Begin VB.Menu stat
  126. Caption = "-"
  127. End
  128. Begin VB.Menu Inf3
  129. Caption = "Minimize"
  130. End
  131. Begin VB.Menu BoutThat
  132. Caption = "About"
  133. End
  134. Begin VB.Menu Exit
  135. Caption = "Exit"
  136. End
  137. End
  138. Begin VB.Menu bsdg
  139. Caption = "About"
  140. End
  141. Begin VB.Menu Ex
  142. Caption = "Exit"
  143. End
  144. End
  145. Attribute VB_Name = "Form1"
  146. Attribute VB_GlobalNameSpace = False
  147. Attribute VB_Creatable = False
  148. Attribute VB_PredeclaredId = True
  149. Attribute VB_Exposed = False
  150. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
  151. Public GunCocked As Boolean
  152. Public GunCocked1 As Boolean
  153.  
  154. Private Sub About_Click()
  155. MsgBox "Controls Player 1: Move Up: W, Move Down: S, Shoot: Space.", vbInformation, "Master Blaster [Version 1.0]"
  156. MsgBox "Controls Player 2: Move Up: U, Move Down: J, Shoot: Enter.", vbInformation, "Master Blaster [Version 1.0]"
  157. End Sub
  158.  
  159. Private Sub BoutThat_Click()
  160. MsgBox "This is a two player shooter game. I made it because I love 2D games.", vbInformation, "Master Blaster [Version 1.0]"
  161. End Sub
  162.  
  163. Private Sub bsdg_Click()
  164. MsgBox "This is a two player shooter game. I made it because I love 2D games.", vbInformation, "Master Blaster [Version 1.0]"
  165. End Sub
  166.  
  167. Private Sub Command1_Click()
  168. GunCocked = False
  169.  
  170. Timer1.Enabled = True
  171.  
  172. Exit Sub
  173. End Sub
  174.  
  175. Private Sub Command2_Click()
  176. GunCocked1 = False
  177.  
  178.  
  179. Timer2.Enabled = True
  180. End Sub
  181.  
  182. Private Sub Ex_Click()
  183. End
  184. End Sub
  185.  
  186. Private Sub Exit_Click()
  187. End
  188. End Sub
  189.  
  190. Private Sub fidgasg_Click()
  191. On Error Resume Next
  192. Dim OpenSite As Long
  193. OpenSite = ShellExecute(0, "open", "mailto:[email protected]", 0, 0, 1)
  194. End Sub
  195.  
  196. Private Sub Form_KeyPress(KeyAscii As Integer)
  197. If KeyAscii = 13 Then
  198. GunCocked = False
  199.  
  200. Timer1.Enabled = True
  201. End If
  202. If KeyAscii = 117 And GunCocked = True Then
  203. Picture3.Top = Picture3.Top - 100
  204. Picture2.Top = Picture2.Top - 100
  205. End If
  206. If KeyAscii = 106 And GunCocked = True Then
  207. Picture3.Top = Picture3.Top + 100
  208. Picture2.Top = Picture2.Top + 100
  209. End If
  210. If KeyAscii = 85 And GunCocked = True Then
  211. Picture3.Top = Picture3.Top - 100
  212. Picture2.Top = Picture2.Top - 100
  213. End If
  214. If KeyAscii = 74 And GunCocked = True Then
  215. Picture3.Top = Picture3.Top + 100
  216. Picture2.Top = Picture2.Top + 100
  217. End If
  218. If KeyAscii = 32 Then
  219. GunCocked1 = False
  220.  
  221.  
  222. Timer2.Enabled = True
  223. End If
  224. If KeyAscii = 115 And GunCocked1 = True Then
  225. Picture1.Top = Picture1.Top + 100
  226. Picture4.Top = Picture4.Top + 100
  227. End If
  228. If KeyAscii = 119 And GunCocked1 = True Then
  229. Picture1.Top = Picture1.Top - 100
  230. Picture4.Top = Picture4.Top - 100
  231. End If
  232. If KeyAscii = 83 And GunCocked1 = True Then
  233. Picture1.Top = Picture1.Top + 100
  234. Picture4.Top = Picture4.Top + 100
  235. End If
  236. If KeyAscii = 87 And GunCocked1 = True Then
  237. Picture1.Top = Picture1.Top - 100
  238. Picture4.Top = Picture4.Top - 100
  239. End If
  240. End Sub
  241.  
  242. Private Sub Form_Load()
  243. GunCocked = True
  244. GunCocked1 = True
  245. End Sub
  246.  
  247. Private Sub gbds_Click()
  248.  
  249. End Sub
  250.  
  251. Private Sub Inf3_Click()
  252. Form1.WindowState = 1
  253. End Sub
  254.  
  255. Private Sub Minimize_Click()
  256. On Error Resume Next
  257. Dim OpenSite As Long
  258. OpenSite = ShellExecute(0, "open", "http://CompulsiveCoding.com", 0, 0, 1)
  259. End Sub
  260.  
  261. Private Sub Restart_Click()
  262. On Error Resume Next
  263. Dim Str As String
  264. Str = MsgBox("Are you sure you want to restart now?", vbYesNo + vbQuestion, "Master Blaster [Version 1.0]")
  265. If Str = vbYes Then
  266. Shell App.Path & "\Master Blaster.exe", vbNormalFocus
  267. Else
  268. Exit Sub
  269. End If
  270. End
  271. End Sub
  272.  
  273. Private Sub Timer1_Timer()
  274.  
  275. If Picture2.Left <= 0 Then
  276. Picture2.Left = Picture3.Left + 120
  277. Picture2.Top = Picture3.Top + 240
  278. GunCocked = True
  279. Timer1.Enabled = False
  280. End If
  281. If Picture4.Left >= 4420 Then
  282. Picture4.Left = Picture1.Left + 120
  283. Picture4.Top = Picture1.Top + 240
  284. GunCocked1 = True
  285. Timer2.Enabled = False
  286. End If
  287. Picture2.Left = Picture2.Left - 100
  288. If Collided(Picture2, Picture1) Then
  289. Picture2.Left = 3720
  290. Picture2.Top = Picture3.Top + 240
  291. GunCocked = True
  292. Picture4.Left = 360
  293. Picture4.Top = Picture1.Top + 240
  294. GunCocked1 = True
  295. Timer1.Enabled = False
  296. Timer2.Enabled = False
  297. MsgBox "Game Over!!", vbCritical, "Master Blaster [Ver 1.0]"
  298. MsgBox "Player 2 Wins!!", vbExclamation, "Master Blaster [Ver 1.0]"
  299. End
  300. Exit Sub
  301. Else
  302. Exit Sub
  303. End If
  304. End Sub
  305.  
  306. Private Sub Timer2_Timer()
  307.  
  308. If Picture4.Left >= 4420 Then
  309. Picture4.Left = Picture1.Left + 120
  310. Picture4.Top = Picture1.Top + 240
  311. GunCocked1 = True
  312. Timer2.Enabled = False
  313. End If
  314. If Picture2.Left <= 0 Then
  315. Picture2.Left = Picture3.Left + 120
  316. Picture2.Top = Picture3.Top + 240
  317. GunCocked = True
  318. Timer1.Enabled = False
  319. End If
  320. Picture4.Left = Picture4.Left + 100
  321. If Collided(Picture4, Picture3) Then
  322. Picture2.Left = 3720
  323. Picture2.Top = Picture3.Top + 240
  324. GunCocked = True
  325. Picture4.Left = 360
  326. Picture4.Top = Picture1.Top + 240
  327. GunCocked1 = True
  328. Timer2.Enabled = False
  329. Timer1.Enabled = False
  330. MsgBox "Game Over!!", vbCritical, "Master Blaster [Ver 1.0]"
  331. MsgBox "Player 1 Wins!!", vbExclamation, "Master Blaster [Ver 1.0]"
  332. End
  333. Exit Sub
  334. Else
  335. Exit Sub
  336. End If
  337. End Sub
  338.  
  339. Private Sub Timer3_Timer()
  340. If Picture1.Top >= 3096 Then
  341. Picture1.Top = 960
  342. Picture1.Left = 240
  343. Picture4.Top = 1200
  344. Picture4.Left = 360
  345. End If
  346.  
  347. If Picture3.Top >= 3096 Then
  348. Picture3.Top = 960
  349. Picture3.Left = 3600
  350. Picture2.Top = 1200
  351. Picture2.Left = 3720
  352. End If
  353.  
  354. If Picture1.Top <= 0 Then
  355. Picture1.Top = 960
  356. Picture1.Left = 240
  357. Picture4.Top = 1200
  358. Picture4.Left = 360
  359. End If
  360.  
  361. If Picture3.Top <= 0 Then
  362. Picture3.Top = 960
  363. Picture3.Left = 3600
  364. Picture2.Top = 1200
  365. Picture2.Left = 3720
  366. End If
  367.  
  368. End Sub
Advertisement
Add Comment
Please, Sign In to add comment