Quick Search for:  in language:    
space,shooter,game,people,cant,read,address
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Visual Basic Stats

 Code: 3,011,557. lines
 Jobs: 115. postings

 How to support the site

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for Visual Basic.
AniViewer
By Jerrame Hertz on 6/30


Click here to see a screenshot of this code!Raw Packet Sniffer
By Coding Genius on 6/30

(Screen Shot)

Check the support of a record set
By Freebug on 6/30


B++ Builder - VB without runtimes
By Anthonius on 6/30


Mr Blonde - Chat Program
By Mr Blonde on 6/30


MSN Messenger Status Detector
By Ryan Cain on 6/30


MSN advanced
By alias1990 on 6/30


MSN Messenger advanced
By alias1990 on 6/30


Locate Database
By Erica Ziegler-Roberts on 6/30


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Space Shooter Game

Print
Email
 

Submitted on: 5/3/1999
By: Theo Kandiliotis  
Level: Not Given
User Rating: By 100 Users
Compatibility:VB 4.0 (32-bit), VB 5.0, VB 6.0

Users have accessed this code 8720 times.
 
 
     Its a space shooter game, ok for all you people who can't read the address is www.geocities.com/baja/cliffs/8036/space.html
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

'**************************************
' Name: Space Shooter Game
' Description:Its a space shooter game, 
'     ok for all you people who can't read the
'     address is
www.geocities.com/baja/cliffs/8036/space.html
' By: Theo Kandiliotis
'
' Assumes:LOOKS LIKE A LOT BUT MOST IS J
'     UST STEP BY STEP INSTRUCTIONS:)
There are files that are needed. Go To www.geocities.com/baja/cliffs/8036/ space.html to Get them
Its eaisier To download it but heres the code.
There are a lot of objects(mostly pictures and sprites)
'
' Side Effects:a few bugs that are still
'     being worked on. Nothing serious:)
'
'This code is copyrighted and has' limited warranties.Please see http://w
'     ww.Planet-Source-Code.com/vb/scripts/Sho
'     wCode.asp?txtCodeId=1724&lngWId;=1'for details.'**************************************

'The procedure that runs after Form_Load
'     .It
'It is used to give starting values to a
'     ll
'the variables that must be reset every
'time a new level begins

Private Sub Form_Activate()

'Set starting values for the movement of ' each row 'of aliens.All the aliens in one row mov ' e towards 'the same direction and change direction ' when the 'far right or far left alien hits the ed ' ge of the 'form.This is why killing the aliens on ' the far 'right and far left slows down their ver ' tical movement 'start the background midi. Mi1 = "LEFT" Mi2 = "RIGHT" Mi3 = "LEFT" Mi4 = "RIGHT" Mi5 = "LEFT" Timer1.Enabled = True Cls dead = 0 Form1.KeyPreview = True Randomize 'This code sets the coordinates,velocity ' 'and size of the 30 small circles that 'contantly move on the background. For i = 1 To 30 x(i) = Int(Form1.Width * Rnd) Y(i) = Int(Form1.Height * Rnd) pace(i) = Int(500 - (Int(Rnd * 499))) size(i) = 14 - (13 * Rnd) Next
'Set starting values for the coordinates ' 'of the spaceship sprite x2 = 3760 y2 = 5600 'Set starting values for the coordinates ' of 'the 15 aliens.The syntax ' For I=1 to N ' X=(Container.Width * (N-I)/N)-(Control ' .Width/2) ' Next 'can be used to horizontaly center N ide ' ntical 'controls in a container (Form,picture b ' ox etc) xi1 = (Form1.Width / 2) - (sprINVADER5.Width / 2) yi1 = 1000 For i = 1 To 2 yi2(i) = yi1 + sprINVADER5.Height + 50 Next
xi2(1) = (Form1.Width / 2) - (Form1.Width / 8) - (sprINVADER5.Width / 2) xi2(2) = (Form1.Width / 2) + (Form1.Width / 8) - (sprINVADER5.Width / 2) For i = 1 To 3 yi3(i) = yi2(1) + sprINVADER5.Height + 50 xi3(i) = ((Form1.Width * (4 - i) / 4) - (sprINVADER5.Width / 2)) Next
For i = 1 To 4 yi4(i) = yi3(1) + sprINVADER5.Height + 200 xi4(i) = ((Form1.Width * (5 - i) / 5) - (sprINVADER5.Width) / 2) Next
For i = 1 To 5 yi5(i) = yi4(1) + sprINVADER5.Height + 300 xi5(i) = ((Form1.Width * (6 - i) / 6) - (sprINVADER5.Width) / 2) Next
End Sub
'The procedure that would normally run w ' hen 'the user hits the cursor keys or the sp ' ace bar Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode Case vbKeySpace Call fire Case vbKeyLeft movement = "Left" Case vbKeyRight movement = "Right" Case Else movement = "" End Select
End Sub
'This procedure is here in case you clic ' k the X 'button on the upper right of the form i ' nstead 'of the exit button.It makes sure that t ' he text 'file closes before the application ends ' Private Sub Form_Unload(Cancel As Integer)
cmdExit_Click End Sub
'The procedure that executes every 0,001 ' sec and 'controls just about everything goes on ' in the 'game.The general idea is that event pro ' cedures all 'all around the project alter the values ' of FLAG 'variables like BOOM,SHOT,X2 etc and thi ' s procedure 'uses those values to do whatever the ev ' ent is about. Private Sub Timer1_Timer()
'--------------------------------------- ' 'Check if the top alien has crushed on t ' he ship If (y2 - (yi1 + sprINVADER5.Height)) < -100 And Abs((xi1 + (sprINVADER5.Width / 2)) - (x2 + sprSHIP.Width / 2)) < (sprINVADER5.Width / 2) Then 'and if so Timer1.Enabled = False For q = 1 To 6 PaintPicture imgKABOOM(q).Picture, x2 + 600, y2 For l = 1 To 100000: Next Next
Form_Activate 'halt everything (Timer1.Enabled=false), ' 'paint the 6 frames of the explosion on ' the good 'guy ( that is now a dead good guy) and ' start over 'a new level (Form_Activate) End If
'Check if an alien from the second row h ' as crushed 'on the ship For i = 1 To 2 If (y2 - (yi2(i) + sprINVADER5.Height)) < -100 And Abs((xi2(i) + (sprINVADER5.Width / 2)) - (x2 + sprSHIP.Width / 2)) < (sprINVADER5.Width / 2) Then Timer1.Enabled = False For q = 1 To 6 PaintPicture imgKABOOM(q).Picture, x2 + 600, y2 For l = 1 To 100000: Next Next
Form_Activate End If
Next
'Check if an alien from the 3rd row has ' crushed 'on the ship For i = 1 To 3 If (y2 - (yi3(i) + sprINVADER5.Height)) < -100 And Abs((xi3(i) + (sprINVADER5.Width / 2)) - (x2 + sprSHIP.Width / 2)) < (sprINVADER5.Width / 2) Then Timer1.Enabled = False For q = 1 To 6 PaintPicture imgKABOOM(q).Picture, x2 + 600, y2 For l = 1 To 100000: Next Next
Form_Activate End If
Next
'Check if an alien from the 4th row has ' crushed 'on the ship For i = 1 To 4 If (y2 - (yi4(i) + sprINVADER5.Height)) < -100 And Abs((xi4(i) + (sprINVADER5.Width / 2)) - (x2 + sprSHIP.Width / 2)) < (sprINVADER5.Width / 2) Then Timer1.Enabled = False For q = 1 To 6 PaintPicture imgKABOOM(q).Picture, x2 + 600, y2 For l = 1 To 100000: Next Next
Form_Activate End If
Next
'Check if an alien from the lower row ha ' s crushed 'on the ship For i = 1 To 5 If (y2 - (yi5(i) + sprINVADER5.Height)) < -100 And Abs((xi5(i) + (sprINVADER5.Width / 2)) - (x2 + sprSHIP.Width / 2)) < (sprINVADER5.Width / 2) Then Timer1.Enabled = False For q = 1 To 6 PaintPicture imgKABOOM(q).Picture, x2 + 600, y2 For l = 1 To 100000: Next Next
Form_Activate End If
Next
'If alien #1 is not dead... Select Case kill(1) Case False Select Case xi1 Case Is > -230 'and he's on the visible part of the For ' m '** (when an alien is shot,his X coordin ' ate is given ' a very low value (-5000) so that if by ' any ' chance his sprite is painted on the fo ' rm,you wont ' see him) Select Case Mi1 'Then move him towards the direction tha ' t the 'Mi1 variable points out Case "LEFT" xi1 = xi1 - 200 If xi1 < 0 Then Mi1 = "RIGHT": yi1 = yi1 + 155 Case "RIGHT" xi1 = xi1 + 200 If xi1 > Form1.Width - sprINVADER5.Width Then Mi1 = "LEFT": yi1 = yi1 + 155 End Select
End Select
End Select
'Move the 2nd row aliens Select Case Mi2 Case "LEFT" If kill(2) = False And xi2(1) > 100 Then xi2(1) = xi2(1) - 200 If kill(3) = False And xi2(2) > 100 Then xi2(2) = xi2(2) - 200 '** (only if they're alive...) If xi2(1) < 200 And kill(2) = False And xi2(1) > -100 Then Mi2 = "RIGHT" For q = 1 To 2 If boom = True And xinv = xi2(q) Then Exit For yi2(q) = yi2(q) + 155 Next
End If
If xi2(2) < 200 And kill(3) = False And xi2(2) > -100 Then Mi2 = "RIGHT" For q = 1 To 2 If boom = True And xinv = xi2(q) Then Exit For yi2(q) = yi2(q) + 155 Next
End If
Goto 2 Case "RIGHT" If kill(2) = False And xi2(1) > -100 And xi2(1) < (Form1.Width - sprINVADER5.Width) Then xi2(1) = xi2(1) + 200 If kill(3) = False And xi2(2) > -100 And xi2(2) < (Form1.Width - sprINVADER5.Width) Then xi2(2) = xi2(2) + 200 If xi2(1) > (Form1.Width - sprINVADER5.Width) And kill(2) = False Then Mi2 = "LEFT" For q = 1 To 2 If boom = True And xinv = xi2(q) Then Exit For yi2(q) = yi2(q) + 155 Next
End If
If xi2(2) > (Form1.Width - sprINVADER5.Width) And kill(3) = False Then Mi2 = "LEFT" For q = 1 To 2 If boom = True And xinv = xi2(q) Then Exit For yi2(q) = yi2(q) + 155 Next
End If
2 End Select 'Move the third row aliens Select Case Mi3 Case "LEFT" For i = 1 To 3 If kill(i + 3) = False And xi3(i) > 100 Then xi3(i) = xi3(i) - 200 If xi3(i) < 200 And kill(3 + i) = False And xi3(i) > -100 Then Mi3 = "RIGHT" For q = 1 To 3 If boom = True And xinv = xi3(q) Then Exit For yi3(q) = yi3(q) + 155 Next
End If
Next
Goto 3 Case "RIGHT" For i = 1 To 3 If kill(3 + i) = False And xi3(i) > -100 And xi3(i) < (Form1.Width - sprINVADER5.Width) Then xi3(i) = xi3(i) + 200 If xi3(i) > (Form1.Width - sprINVADER5.Width) And kill(3 + i) = False Then Mi3 = "LEFT" For q = 1 To 3 If boom = True And xinv = xi3(q) Then Exit For yi3(q) = yi3(q) + 155 Next
End If
Next
3 End Select 'Move the fourth row aliens Select Case Mi4 Case "LEFT" For i = 1 To 4 If kill(6 + i) = False And xi4(i) > 100 Then xi4(i) = xi4(i) - 200 If xi4(i) < 200 And kill(6 + i) = False And xi4(i) > -100 Then Mi4 = "RIGHT" For q = 1 To 4 If boom = True And xinv = xi4(q) Then Exit For yi4(q) = yi4(q) + 155 Next
End If
Next
Goto 4 Case "RIGHT" For i = 1 To 4 If kill(6 + i) = False And xi4(i) > -100 And xi4(i) < (Form1.Width - sprINVADER5.Width) Then xi4(i) = xi4(i) + 200 If xi4(i) > (Form1.Width - sprINVADER5.Width) And kill(6 + i) = False Then Mi4 = "LEFT" For q = 1 To 4 If boom = True And xinv = xi4(q) Then Exit For yi4(q) = yi4(q) + 155 Next
End If
Next
4 End Select 'Move the 5th row aliens Select Case Mi5 Case "LEFT" For i = 1 To 5 If kill(10 + i) = False And xi5(i) > 100 Then xi5(i) = xi5(i) - 200 If xi5(i) < 200 And kill(10 + i) = False And xi5(i) > -100 Then Mi5 = "RIGHT" For q = 1 To 5 If boom = True And xinv = xi5(q) Then Exit For yi5(q) = yi5(q) + 155 Next
End If
Next
Goto 5 Case "RIGHT" For i = 1 To 5 If kill(10 + i) = False And xi5(i) > -100 And xi5(i) < (Form1.Width - sprINVADER5.Width) Then xi5(i) = xi5(i) + 200 If xi5(i) > (Form1.Width - sprINVADER5.Width) And kill(10 + i) = False Then Mi5 = "LEFT" For q = 1 To 5 If boom = True And xinv = xi5(q) Then Exit For yi5(q) = yi5(q) + 155 Next
End If
Next
5 End Select 'If the good guy killed 15 aliens,start 'a new level by calling the Form_Activat ' e procedure Select Case dead Case 15 dead = 0: Cls Call Form_Activate End Select
'If there is an explosion going on somew ' here on the 'form (Boom=true) then paint the correct ' frame of 'it (the variable Explosion represents t ' he number 'of the frame that must be currently pai ' nted) Select Case boom Case True Select Case explosion Case 1 'If the explosion has just started (expl ' osion=1) 'then don't paint any frame of it,just e ' rase the 'alien that has been shot by painting th ' e label 'lblBlank on him. 'lnlBlank is a black label used every no ' w and then 'to erase something from the form.It's L ' eft and 'Top properties have been assigned the X ' and Y 'coordinates of the alien that's being k ' illed 'as you read these lines.This was done f ' rom the 'Kaboom procedure,where the Boom variabl ' e was 'assigned the value True and the whole e ' xplosion 'buisness began lblBlank.Visible = True lblBlank.Visible = False Case Is <> 1 'If the explosion has already started be ' fore the 'current timer event then paint the curr ' ent frame 'of the explosion on the alien that was ' just killed. 'Xinv and Yinv are the coordinates of th ' e alien 'that get's his butt kicked every time t ' he good 'guy hits bullseye. Select Case xinv Case xi1 PaintPicture imgKABOOM(explosion).Picture, xi1, yi1 - 100 Case xi2(1) PaintPicture imgKABOOM(explosion).Picture, xi2(1) + 200, yi2(1) - 100 Case xi2(2) PaintPicture imgKABOOM(explosion).Picture, xi2(2) + 200, yi2(2) - 100 Case xi3(1) PaintPicture imgKABOOM(explosion).Picture, xi3(1) + 150, yi3(1) - 100 Case xi3(2) PaintPicture imgKABOOM(explosion).Picture, xi3(2) + 150, yi3(2) - 100 Case xi3(3) PaintPicture imgKABOOM(explosion).Picture, xi3(3) + 150, yi3(3) - 100 Case xi4(1) PaintPicture imgKABOOM(explosion).Picture, xi4(1) - 30, yi4(1) - 100 Case xi4(2) PaintPicture imgKABOOM(explosion).Picture, xi4(2) - 30, yi4(2) - 100 Case xi4(3) PaintPicture imgKABOOM(explosion).Picture, xi4(3) - 30, yi4(3) - 100 Case xi4(4) PaintPicture imgKABOOM(explosion).Picture, xi4(4) - 30, yi4(4) - 100 Case xi5(1) PaintPicture imgKABOOM(explosion).Picture, xi5(1) - 30, yi5(1) - 100 Case xi5(2) PaintPicture imgKABOOM(explosion).Picture, xi5(2) - 30, yi5(2) - 100 Case xi5(3) PaintPicture imgKABOOM(explosion).Picture, xi5(3) - 30, yi5(3) - 100 Case xi5(4) PaintPicture imgKABOOM(explosion).Picture, xi5(4) - 30, yi5(4) - 100 Case xi5(5) PaintPicture imgKABOOM(explosion).Picture, xi5(5) - 30, yi5(5) - 100 End Select
End Select
'Add 1 to the value of Explosion so that ' a new frame 'of it will be painted in the next timer ' event explosion = explosion + 1 Select Case explosion Case 7 'if all the frames of the explosion have ' been painted 'then the alien whose coordinates are th ' e same 'with the values of Xinv and Yinv is off ' icialy dead 'and the fun ends (Boom=false) explosion = 0 boom = False If YouDied = True Then Form_Activate 'Let's see that score increase... score = score + 1000 'Onother one bites the dust.(15-dead) to ' go dead = dead + 1 'paint the blank label on the exact spot ' where 'the explosion frames were painted incas ' e there 'is some smoke left floating there. '**(There is still a little bug and some ' times ' (the smoke remains there.Oh well...) lblBlank.Left = xinv lblBlank.Top = yinv - 100 lblBlank.Visible = True lblBlank.Visible = False 'If an alien was just killed,then give h ' is X coordinate 'a very low value (-5000) so that he won ' t be visible 'on the form If kill(1) = True Then xi1 = -5000: kill(1) = False For i = 1 To 2 If kill(i + 1) = True Then xi2(i) = -5000: kill(i + 1) = False: Exit For Next
For i = 1 To 3 If kill(3 + i) = True Then xi3(i) = -5000: kill(3 + i) = False: Exit For Next
If kill(7) = True Then xi4(1) = -5000: kill(7) = False If kill(8) = True Then xi4(2) = -5000:: kill(8) = False If kill(9) = True Then xi4(3) = -5000: kill(9) = False If kill(10) = True Then xi4(4) = -5000: kill(10) = False For i = 1 To 5 If kill(10 + i) = True Then xi5(i) = -5000: kill(10 + i) = False Next
End Select
Case False End Select
'If the good guy has just fired his blas ' ter,draw 'a line .The upper bound is determined b ' y how 'high the alien that will be killed is.( ' if this 'shot wont kill an alien then it will go ' all the 'way up to the upper edge of the form).I ' n fact 'each time the good guy shoots ,3 lines ' are drawn 'one after the other on the exact same s ' pot and 'with the exact same length.The first is ' either 'blue or white,the second is either whit ' e or 'blue and the third is black so that 'the "shot ring" will be erased.This is ' how the 'cool "laser blaster" effect is done Select Case shot Case 1 Line (xshot, y2)-(xshot, upper), COL2 shot = 2 Case 2 Line (xshot, y2)-(xshot, upper), BackColor shot = 0 End Select
'Move the spaceship according to the val ' ue of the 'variable Movement.As in most shoot'em u ' p games,the 'ship continues moving towards the direc ' tion it has 'been last guided to until it meets the ' edge of the 'form or onother direction is given.Norm ' ally this 'would be done by the user hitting a cur ' sor key 'but in this demo it's done by inputing ' a new 'keyword command from the file DEMO.DAT Select Case movement Case "Left" x2 = x2 - 210 If x2 < -320 Then x2 = -320 PaintPicture sprSHIP.Picture, x2, y2 Case "Right" x2 = x2 + 210 If x2 > Form1.Width - 1700 Then x2 = Form1.Width - 1700 PaintPicture sprSHIP.Picture, x2, y2 End Select
'Move the star field that's on the backg ' round. For i = 1 To 30 Circle (x(i), Y(i)), size(i), BackColor Y(i) = Y(i) + pace(i) 'If a star reaches the bottom of the for ' m then 'it is assigned a new X coordinate and i ' n the next 'timer event it will start falling again ' ( Y(i)=0) If Y(i) >= Form1.Height Then Y(i) = 0: x(i) = Int(Form1.Width * Rnd) Select Case pace(i) 'There are 30 circles of various sizes.E ' ach one 'moves with a different speed and accord ' ing to his 'speed it is painted with a different sh ' ade of grey. 'Stars that move slow are painted almost ' black 'cause 'they are located deep in space.The ones ' that move 'quick are almost white because they zip ' by near 'the camera,they're also bigger than the ' n slow ones. Case Is <= 200 clr = &H404040; Case Is <= 300 clr = &H808080; Case Is <= 400 clr = &HC0C0C0; Case Else clr = &HFFFFFF; End Select
Circle (x(i), Y(i)), size(i), clr Next
'Paint the good guy PaintPicture sprSHIP.Picture, x2, y2 'Paint the aliens that are not dead,in o ' ther 'words the ones for whom Kill(#of alien) ' =false 'Remember 1<= #of alien <=15 If kill(1) = False Then PaintPicture sprINVADER5.Picture, xi1, yi1 For i = 1 To 2 If kill(1 + i) = False Then PaintPicture sprINVADER5.Picture, xi2(i), yi2(i) Next
For i = 1 To 3 If kill(3 + i) = False Then PaintPicture sprINVADER5.Picture, xi3(i), yi3(i) Next
For i = 1 To 4 If kill(6 + i) = False Then PaintPicture sprINVADER5.Picture, xi4(i), yi4(i) Next
For i = 1 To 5 If kill(10 + i) = False Then PaintPicture sprINVADER5.Picture, xi5(i), yi5(i) Next
End Sub
'Pull that trigger... Private Sub fire()
Select Case boom Case True Exit Sub '...but if an explosion is going on,don' ' t fire, 'there's no need to waste ammo End Select
upper = 1000 Select Case shot Case Is <> 0 'Also if the previous shot hasn't yet be ' en painted 'in all of it's 3 colors,don't fire onot ' her one Exit Sub End Select
shot = 1 'Play the sound fx using API's xshot = x2 + 1062 'Xshot is the X coordinate of the laser ' beem.The 'weapon of the ship is in the middle,so ' it's 'Xshot = x2 + 1062 (x2 is the X coordina ' te of the ship) 'Keep in mind that the sprite has a lot ' of space 'in each side of the actual ship otherwi ' se it would 'leave trails on the form when it moves ' 'Check if the Xshot is anywhere near an ' alien 'and "kill" him if so ( kill(#of alien)= ' True).He 'may not yet be officialy dead since the ' 'explosion hasn't been painted on him,bu ' t that's 'a matter of milliseconds if his KILL ar ' ray element 'is set to True. If Abs(xi1 + (sprINVADER5.Width / 2) - xshot) < (sprINVADER5.Width / 4) Then kill(1) = True Else kill(1) = False If Abs(xi2(1) + (sprINVADER5.Width / 2) - xshot) < (sprINVADER5.Width / 3) Then kill(2) = True Else kill(2) = False If Abs(xi2(2) + (sprINVADER5.Width / 2) - xshot) < (sprINVADER5.Width / 3) Then kill(3) = True Else kill(3) = False For i = 1 To 3 If Abs(xi3(i) + (sprINVADER5.Width / 2) - xshot) < (sprINVADER5.Width / 2) Then kill(3 + i) = True: Exit For Else kill(3 + i) = False Next
For i = 1 To 4 If Abs(xi4(i) + (sprINVADER5.Width / 2) - xshot) < (sprINVADER5.Width / 2) Then kill(6 + i) = True: Exit For Else kill(6 + i) = False Next
For i = 1 To 5 If Abs(xi5(i) + (sprINVADER5.Width / 2) - xshot) < (sprINVADER5.Width / 3) Then kill(10 + i) = True: Exit For Else kill(10 + i) = False Next
If kill(1) = True Then xinv = xi1: yinv = yi1: upper = yi1: Call kaboom If kill(2) = True Then xinv = xi2(1): yinv = yi2(1): upper = yi2(1): Call kaboom: If kill(3) = True Then xinv = xi2(2): yinv = yi2(2): upper = yi2(2): Call kaboom: For i = 1 To 3 If kill(i + 3) = True Then xinv = xi3(i): yinv = yi3(i): upper = yi3(i): Call kaboom: Next
For i = 1 To 4 If kill(6 + i) = True Then xinv = xi4(i): yinv = yi4(i): upper = yi4(i): Call kaboom: Next
For i = 1 To 5 If kill(10 + i) = True Then xinv = xi5(i): yinv = yi5(i): upper = yi5(i): Call kaboom: Next
aa = 0 'Check if the shot "killed" some more al ' iens 'that were above the unlucky one and "re ' ssurect" 'them since laser blasters don't go thro ' ugh 'metal.Only railguns in Quake2... For i = 15 To 1 Step -1 If kill(i) = True Then aa = i: Exit For Next
For i = 1 To 15 If i <> aa Then kill(i) = False Next
11 Line (x2 + 1062, y2)-(xshot, upper), BackColor 'Randomly choose a color for the first o ' f three 'laser beems ... D = Int(2 * Rnd) Select Case D Case 0 COL1 = &HFFFFFF; COL2 = &HFF0000; Case Else COL1 = &HFF0000; COL2 = &HFFFFFF; End Select
'and paint it...If this one was blue,the ' second will 'be white and vise versa.The third is al ' ways the 'black one that "erases" the trail of th ' e shot Line (x2 + 1062, y2)-(x2 + 1062, upper), COL1 End Sub
'The procedure that runs everytime you s ' hoot an alien. 'He still has no idea what's in store fo ' r him but 'these lines of code will fix him up goo ' d Private Sub kaboom()
'Place the blank label on the unlucky al ' ien so that 'he's erased on the next timer event,bef ' ore the 'frames of the explosion start showing lblBlank.Top = yinv lblBlank.Left = xinv boom = True '...and start the fun by setting the Exp ' losion variable 'to 1.In the next timer event a beautifu ' l explosion 'will go off on an ugly alien's face explosion = 1 End Sub


Other 3 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Not Given category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
5/5/1999 6:57:00 AM:Daniel
Could you please send me a copy so I 
can see how it is supposed to work 
properly?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/1999 3:29:00 PM:Kyle
Hello I put all the code in like it 
said but it still dont werk. Could 
someone send me one that is all put 
together? E-Mail me at RXDeeler@aol.com
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/7/1999 5:39:00 PM:Jeff
I tried the codes and put them in it 
doesn't work what should I do can you 
send me the zip cause that one persons 
page is down and under construction so 
I cant download the zip file please 
mail me back thanks.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/6/1999 11:33:00 PM:Spoon
I need a copy also
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/7/1999 6:17:00 AM:Marcus
Can I just add the home page 
is:
http://www.geocities.com/Baja/Cliff
s/8036/jmain.html
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/7/1999 9:26:00 PM:Black Ice
i have a project in school to write in 
vb4 this gamewould be perfect to use as 
an example. it would be grat if you 
cold suplay the whole game her so i can 
take a look at it. or if it was 
converted to vb4 from vb5 cuz ther is a 
lot of stuff that does not work .   any 
help would be greatly apperciated
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/8/1999 10:04:00 AM:Phil Vachon
Could you E-MAIL me this code so I can 
use it? I can't get it to work. 
Thanks.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/9/1999 7:15:00 AM:Will
This works brilliantly except for on 
thing. When I actually shoot the Alien 
I get an error (runtime error 424 objec 
t required) on this 
line:
lblBlank.Top = yinv
please 
help
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/10/1999 6:10:00 AM:Nick
Having real difficulty getting this 
working.  Spmeone please send me the 
zip so I can compare them.
Thanks
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/10/1999 5:50:00 PM:Me
Just to let evryone one know that you 
have to go to 
www.geocities.com/baja/cliffs/8036/space
.html to get files that are needed to 
use the code
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/11/1999 8:35:00 AM:Jesse
I just want to say, that if you use a 
project such as this as a school 
project, what are you going to do when 
your teacher tells you to make 
modifications or explain a line? It's 
best to just do it by yourself.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/11/1999 8:12:00 PM:im too cool
we all know who the programming go is 
(me) and i go it to work without the 
files so i am great, because i know how 
to make my own sprites
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/12/1999 5:03:00 PM:sam
can i please have the working project 
in a zip file
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/13/1999 11:12:00 AM:DB
sam, can i get your e-mail address so i 
can send the file to you
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/15/1999 8:13:00 AM:Mattias
Eeeh... where is that zip-file 
mentioned on the front page?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/24/1999 6:27:00 PM:Eric
Could you send me that also. I would 
really appreciate it. Thanks.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/25/1999 3:07:00 PM:boodabelly
This is a somewhat decent expample.  
Has alot of things that can be smoothed 
out to make it into a fun game.  But it 
is just provided as an example and for 
and example its great.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/29/1999 1:26:00 PM:Yoni
Can you please send me this game 
zipped? I can't find it anywhere (Like 
everyone around here)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/24/1999 1:29:00 AM:Lazarus
I put it all in, but it still doesn't 
work, please mail me the Source to 
BigLazarus@gmx.net
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/25/1999 4:33:00 AM:Jeroen Elias
This code is incomplete!
It's missing 
variable declarations and the
'Option 
Explicit'
Author: please check your 
code before you submit them!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/25/1999 6:23:00 PM:Capt_A
If anyone gets it to work please email 
me a copy.
Author: your source is so 
large, why not make a 
.zip?
aaronchaffee@hotmail.com
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/26/1999 12:30:00 PM:C. Ruiz
Can you send a copy it to see how it 
works. Thanks
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/1/1999 1:43:00 PM:DirtyBird
man you must have really screwed up if 
NOONE can get it to work!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/3/1999 10:20:00 PM:Boba Fett
could "i am too cool" use proper 
english ...or am i asking too much...if 
any one is having a prob with the code 
go to 
http://www.geocities.com/Baja/Cliffs/803
6/jmain.html 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/4/1999 1:37:00 AM:Theo Kandiliotis
Ok, here's the deal . I have made this 
little game a long time ago 
and it 
was sitting on my site for over 2 years 
.
http://www.geocities.com/SiliconVal
ley/Network/5045/shooterdemo.zip
Then
 some guy decided to win a prize from 
PSC with my code and posted it 
under 
his name ,with minor or no changes in 
the code. I email the PSC 
webmaster 
(which happens to be a good net friend 
of mine) and he was polite 
enough to 
change the Author field to my ID, 
although I would prefer he just 
deleted the entry altogether. The guy 
(the lamer) did a louzy job copying 
the code too, and the code doesn't 
work for most people. So please 
download 
the initial zip archive from 
my site (which works, de facto) and 
stop 
complaining about his post, I 
didn't make it :) Btw, this is a 
not-so-good 
example of a vb shoot'em 
up game. Try Nordic from my site (no 
source though).
Cheers and happy 
ripping to the lamer.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/5/1999 5:13:00 AM:TechnoVBM?an
Wheres the Zip?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/2/2003 12:38:27 PM:
Very Nice
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Visual Basic Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.