[COLOR=blue][FONT=Consolas]Dim[/FONT][/COLOR][FONT=Consolas] SRight [COLOR=blue]AsBoolean
Dim[/COLOR] SLeft [COLOR=blue]AsBoolean
Dim[/COLOR] ShooterSpeed [COLOR=blue]AsInteger
Dim[/COLOR] shotspeed [COLOR=blue]AsInteger
PrivateSub[/COLOR] TimerMain_Tick([COLOR=blue]ByVal[/COLOR] sender [COLOR=blue]As[/COLOR] System.[COLOR=#2B91AF]Object[/COLOR], [COLOR=blue]ByVal[/COLOR] e [COLOR=blue]As[/COLOR] System.[COLOR=#2B91AF]EventArgs[/COLOR]) [COLOR=blue]Handles[/COLOR] TimerMain.Tick
MoveShooter()
FireShot()
CheckHit()
[COLOR=blue]EndSub
PrivateSub[/COLOR] Form1_KeyDown([COLOR=blue]ByVal[/COLOR] sender [COLOR=blue]As[/COLOR] System.[COLOR=#2B91AF]Object[/COLOR], [COLOR=blue]ByVal[/COLOR] e [COLOR=blue]As[/COLOR] System.Windows.Forms.[COLOR=#2B91AF]KeyEventArgs[/COLOR]) [COLOR=blue]HandlesMyBase[/COLOR].KeyDown
[COLOR=blue]If[/COLOR] e.KeyValue = [COLOR=#2B91AF]Keys[/COLOR].Right [COLOR=blue]Then
[/COLOR]SRight = [COLOR=blue]True
[/COLOR]SLeft = [COLOR=blue]False
EndIf
If[/COLOR] e.KeyValue = [COLOR=#2B91AF]Keys[/COLOR].Left [COLOR=blue]Then
[/COLOR]SLeft = [COLOR=blue]True
[/COLOR]SRight = [COLOR=blue]False
EndIf
If[/COLOR] e.KeyValue = [COLOR=#2B91AF]Keys[/COLOR].Space [COLOR=blue]And[/COLOR] Shot.Visible = [COLOR=blue]FalseThen
[/COLOR]Shot.Top = Shooter.Top
Shot.Left = Shooter.Left + (Shooter.Width / 2) - (Shot.Width / 2)
Shot.Visible = [COLOR=blue]True
EndIf
EndSub
PrivateSub[/COLOR] MoveShooter()
[COLOR=blue]If[/COLOR] SRight = [COLOR=blue]TrueAnd[/COLOR] Shooter.Left + Shooter.Width < [COLOR=blue]Me[/COLOR].ClientRectangle.Width [COLOR=blue]Then
[/COLOR]Shooter.Left += ShooterSpeed
[COLOR=blue]EndIf
If[/COLOR] SLeft = [COLOR=blue]TrueAnd[/COLOR] Shooter.Left > [COLOR=blue]Me[/COLOR].ClientRectangle.Left [COLOR=blue]Then
[/COLOR]Shooter.Left -= ShooterSpeed
[COLOR=blue]EndIf
EndSub
PrivateSub[/COLOR] Form1_KeyUp([COLOR=blue]ByVal[/COLOR] sender [COLOR=blue]As[/COLOR] System.[COLOR=#2B91AF]Object[/COLOR], [COLOR=blue]ByVal[/COLOR] e [COLOR=blue]As[/COLOR] System.Windows.Forms.[COLOR=#2B91AF]KeyEventArgs[/COLOR]) [COLOR=blue]HandlesMyBase[/COLOR].KeyUp
[COLOR=blue]If[/COLOR] e.KeyValue = [COLOR=#2B91AF]Keys[/COLOR].Right [COLOR=blue]Then
[/COLOR]SRight = [COLOR=blue]False
EndIf
If[/COLOR] e.KeyValue = [COLOR=#2B91AF]Keys[/COLOR].Left [COLOR=blue]Then
[/COLOR]SLeft = [COLOR=blue]False
EndIf
EndSub
PrivateSub[/COLOR] Form1_Load([COLOR=blue]ByVal[/COLOR] sender [COLOR=blue]As[/COLOR] System.[COLOR=#2B91AF]Object[/COLOR], [COLOR=blue]ByVal[/COLOR] e [COLOR=blue]As[/COLOR] System.[COLOR=#2B91AF]EventArgs[/COLOR]) [COLOR=blue]HandlesMyBase[/COLOR].Load
loadsettings()
[COLOR=blue]EndSub
PrivateSub[/COLOR] loadsettings()
shotspeed = 6
ShooterSpeed = 3
Shot.Visible = [COLOR=blue]False
EndSub
PrivateSub[/COLOR] FireShot()
[COLOR=blue]If[/COLOR] Shot.Visible = [COLOR=blue]TrueThen
[/COLOR]Shot.Top -= shotspeed
[COLOR=blue]EndIf
If[/COLOR] Shot.Top + Shot.Height < [COLOR=blue]Me[/COLOR].ClientRectangle.Top [COLOR=blue]Then
[/COLOR]Shot.Visible = [COLOR=blue]False
EndIf
EndSub
PrivateSub[/COLOR] Timer1_Tick([COLOR=blue]ByVal[/COLOR] sender [COLOR=blue]As[/COLOR] System.[COLOR=#2B91AF]Object[/COLOR], [COLOR=blue]ByVal[/COLOR] e [COLOR=blue]As[/COLOR] System.[COLOR=#2B91AF]EventArgs[/COLOR]) [COLOR=blue]Handles[/COLOR] Timer1.Tick
[COLOR=blue]If[/COLOR] Timer1.Enabled = [COLOR=blue]TrueThen
[/COLOR]Enemy.Left = Enemy.Left + 15
[COLOR=blue]EndIf
If[/COLOR] Enemy.Left >= [COLOR=blue]Me[/COLOR].ClientRectangle.Width [COLOR=blue]Then
[/COLOR]Enemy.Left = -50
[COLOR=blue]EndIf
EndSub
PrivateSub[/COLOR] Timer2_Tick([COLOR=blue]ByVal[/COLOR] sender [COLOR=blue]As[/COLOR] System.[COLOR=#2B91AF]Object[/COLOR], [COLOR=blue]ByVal[/COLOR] e [COLOR=blue]As[/COLOR] System.[COLOR=#2B91AF]EventArgs[/COLOR]) [COLOR=blue]Handles[/COLOR] Timer2.Tick
[COLOR=blue]If[/COLOR] Timer1.Enabled = [COLOR=blue]TrueThen
[/COLOR]Enemy1.Left = Enemy1.Left + 20
[COLOR=blue]EndIf
If[/COLOR] Enemy1.Left >= [COLOR=blue]Me[/COLOR].ClientRectangle.Width [COLOR=blue]Then
[/COLOR]Enemy1.Left = -50
[COLOR=blue]EndIf
EndSub
PrivateSub[/COLOR] Timer3_Tick([COLOR=blue]ByVal[/COLOR] sender [COLOR=blue]As[/COLOR] System.[COLOR=#2B91AF]Object[/COLOR], [COLOR=blue]ByVal[/COLOR] e [COLOR=blue]As[/COLOR] System.[COLOR=#2B91AF]EventArgs[/COLOR]) [COLOR=blue]Handles[/COLOR] Timer3.Tick
[COLOR=blue]If[/COLOR] Timer1.Enabled = [COLOR=blue]TrueThen
[/COLOR]Enemy2.Left = Enemy2.Left + 20
[COLOR=blue]EndIf
If[/COLOR] Enemy2.Left >= [COLOR=blue]Me[/COLOR].ClientRectangle.Width [COLOR=blue]Then
[/COLOR]Enemy2.Left = -50
[COLOR=blue]EndIf
EndSub
PrivateSub[/COLOR] Timer4_Tick([COLOR=blue]ByVal[/COLOR] sender [COLOR=blue]As[/COLOR] System.[COLOR=#2B91AF]Object[/COLOR], [COLOR=blue]ByVal[/COLOR] e [COLOR=blue]As[/COLOR] System.[COLOR=#2B91AF]EventArgs[/COLOR]) [COLOR=blue]Handles[/COLOR] Timer4.Tick
[COLOR=blue]If[/COLOR] Timer1.Enabled = [COLOR=blue]TrueThen
[/COLOR]Enemy3.Left = Enemy3.Left + 15
[COLOR=blue]EndIf
If[/COLOR] Enemy3.Left >= [COLOR=blue]Me[/COLOR].ClientRectangle.Width [COLOR=blue]Then
[/COLOR]Enemy3.Left = -50
[COLOR=blue]EndIf
EndSub
PrivateSub[/COLOR] Timer5_Tick([COLOR=blue]ByVal[/COLOR] sender [COLOR=blue]As[/COLOR] System.[COLOR=#2B91AF]Object[/COLOR], [COLOR=blue]ByVal[/COLOR] e [COLOR=blue]As[/COLOR] System.[COLOR=#2B91AF]EventArgs[/COLOR]) [COLOR=blue]Handles[/COLOR] Timer5.Tick
[COLOR=blue]If[/COLOR] Timer1.Enabled = [COLOR=blue]TrueThen
[/COLOR]Enemy4.Left = Enemy4.Left + 20
[COLOR=blue]EndIf
If[/COLOR] Enemy4.Left >= [COLOR=blue]Me[/COLOR].ClientRectangle.Width [COLOR=blue]Then
[/COLOR]Enemy4.Left = -50
[COLOR=blue]EndIf
EndSub
PrivateSub[/COLOR] CheckHit()
[COLOR=green]'Collision Code enemy
[/COLOR][COLOR=blue]If[/COLOR] Shot.Top < Enemy.Top + Enemy.Height [COLOR=blue]And[/COLOR] Shot.Left > Enemy.Left [COLOR=blue]And[/COLOR] Shot.Left < Enemy.Left + Enemy.Width [COLOR=blue]Then
[/COLOR]Enemy.Visible = [COLOR=blue]False
[/COLOR]Enemy.Left = -100
Enemy.Visible = [COLOR=blue]True
EndIf
[/COLOR][COLOR=green]'Collision Code enemy1
[/COLOR][COLOR=blue]If[/COLOR] Shot.Top < Enemy1.Top + Enemy1.Height [COLOR=blue]And[/COLOR] Shot.Left > Enemy1.Left [COLOR=blue]And[/COLOR] Shot.Left < Enemy1.Left + Enemy1.Width [COLOR=blue]Then
[/COLOR]Enemy1.Visible = [COLOR=blue]False
[/COLOR]Enemy1.Left = -100
Enemy1.Visible = [COLOR=blue]True
EndIf
[/COLOR][COLOR=green]'Collision Code enemy2
[/COLOR][COLOR=blue]If[/COLOR] Shot.Top < Enemy2.Top + Enemy2.Height [COLOR=blue]And[/COLOR] Shot.Left > Enemy2.Left [COLOR=blue]And[/COLOR] Shot.Left < Enemy2.Left + Enemy2.Width [COLOR=blue]Then
[/COLOR]Enemy2.Visible = [COLOR=blue]False
[/COLOR]Enemy2.Left = -100
Enemy2.Visible = [COLOR=blue]True
EndIf
[/COLOR][COLOR=green]'Collision Code enemy3
[/COLOR][COLOR=blue]If[/COLOR] Shot.Top < Enemy3.Top + Enemy3.Height [COLOR=blue]And[/COLOR] Shot.Left > Enemy3.Left [COLOR=blue]And[/COLOR] Shot.Left < Enemy3.Left + Enemy3.Width [COLOR=blue]Then
[/COLOR]Enemy3.Visible = [COLOR=blue]False
[/COLOR]Enemy3.Left = -100
Enemy3.Visible = [COLOR=blue]True
EndIf
[/COLOR][COLOR=green]'Collision Code enemy
[/COLOR][COLOR=blue]If[/COLOR] Shot.Top < Enemy4.Top + Enemy4.Height [COLOR=blue]And[/COLOR] Shot.Left > Enemy4.Left [COLOR=blue]And[/COLOR] Shot.Left < Enemy4.Left + Enemy4.Width [COLOR=blue]Then
[/COLOR]Enemy4.Visible = [COLOR=blue]False
[/COLOR]Enemy4.Left = -100
Enemy4.Visible = [COLOR=blue]True
EndIf
EndSub
EndClass[/COLOR][/FONT]