home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD98749132000.psc / Enemy1.bas < prev    next >
Encoding:
BASIC Source File  |  1996-03-14  |  3.2 KB  |  73 lines

  1. Attribute VB_Name = "Enemy1"
  2. Public Sub badguy1()
  3.  
  4. Form1.Pic_radar.Cls
  5. Form1.Pic_radarv.Cls
  6.  
  7. For x = 0 To CurLevel.NumOfBadGuys
  8. If BadGuys(x).Activated = 0 Then GoTo 10
  9.     Set BadGuys(x).PicT = Form2.PicD
  10.     Set BadGuys(x).mask = Form2.PicDm
  11.     BadGuys(x).bulletlxpos = 11
  12.     BadGuys(x).bulletlypos = 18
  13.     BadGuys(x).bulletrxpos = 32
  14.     BadGuys(x).bulletrypos = 18
  15.     BadGuys(x).xsize = 48
  16.     BadGuys(x).ysize = 61
  17.  
  18.     BadGuys(x).oldX = BadGuys(x).x
  19.     BadGuys(x).oldY = BadGuys(x).y
  20.     If BadGuys(x).Activated = 1 And BadGuys(x).Exploding = 0 Then
  21.     BadGuys(x).y = BadGuys(x).y + BadGuys(x).Velocity
  22.     
  23.     BitBlt Form1.PicScreenBuffer.hdc, BadGuys(x).x, BadGuys(x).y, BadGuys(x).xsize, BadGuys(x).ysize, BadGuys(x).mask.hdc, 0, 0, vbMergePaint
  24.     BitBlt Form1.PicScreenBuffer.hdc, BadGuys(x).x, BadGuys(x).y, BadGuys(x).xsize, BadGuys(x).ysize, BadGuys(x).PicT.hdc, 0, 0, vbSrcAnd
  25.     BitBlt Form1.Pic_radar.hdc, BadGuys(x).x / (diffwidth - 0.7), (BadGuys(x).y + 100) / diffheight, 6, 6, Form1.rad.hdc, 0, 0, vbSrcCopy
  26.     If roll = True Then BitBlt Form1.Pic_radarv.hdc, BadGuys(x).x / (diffwidth - 0.7), (BadGuys(x).y + 100) / diffheight, 6, 6, Form1.rad2.hdc, 0, 0, vbSrcCopy
  27.     
  28.     End If
  29.     If BadGuys(x).Damage > CurLevel.Damagelimit Then BadGuys(x).Exploding = 1
  30.  
  31. If CollisionDetect(ShipX, ShipY, Form2.Pictm, BadGuys(x).x, BadGuys(x).y, BadGuys(x).mask, Form2.PicTemp) Then
  32.    Exploding = 1
  33.    BadGuys(x).Exploding = 1
  34. End If
  35. 10 Next x
  36.  
  37. For x = 0 To CurLevel.NumOfBadGuys
  38.     If BadGuys(x).Activated = 1 And BadGuys(x).y > Form1.PicMain.ScaleHeight Then
  39.        Tempclac = Tempclac + 1
  40.        BadGuys(x).Activated = 0
  41.     End If
  42.     If BadGuys(x).Exploding = 1 Then
  43.        BadGuys(x).Activated = 0
  44.        If fboom = 1 Then
  45.           BitBlt Form1.PicScreenBuffer.hdc, BadGuys(x).x, BadGuys(x).y, 75, 64, Form2.PicExplodeM.hdc, 77 * BadGuys(x).ExplodingFrame, 0, vbPatInvert
  46.           BitBlt Form1.PicScreenBuffer.hdc, BadGuys(x).x, BadGuys(x).y, 75, 64, Form2.PicExplode.hdc, 77 * BadGuys(x).ExplodingFrame, 0, vbSrcPaint
  47.        ElseIf fboom = 2 Then
  48.           BitBlt Form1.PicScreenBuffer.hdc, BadGuys(x).x, BadGuys(x).y, 60, 60, Form2.PicExplode1m.hdc, 60 * BadGuys(x).ExplodingFrame, 0, vbPatInvert
  49.           BitBlt Form1.PicScreenBuffer.hdc, BadGuys(x).x, BadGuys(x).y, 60, 60, Form2.PicExplode1.hdc, 60 * BadGuys(x).ExplodingFrame, 0, vbSrcPaint
  50.        Else
  51.           BitBlt Form1.PicScreenBuffer.hdc, BadGuys(x).x, BadGuys(x).y, 80, 70, Form2.PicExplode2m.hdc, 80 * BadGuys(x).ExplodingFrame, 0, vbPatInvert
  52.           BitBlt Form1.PicScreenBuffer.hdc, BadGuys(x).x, BadGuys(x).y, 80, 70, Form2.PicExplode2.hdc, 80 * BadGuys(x).ExplodingFrame, 0, vbSrcPaint
  53.        End If
  54.        BadGuys(x).ExplodingFrame = BadGuys(x).ExplodingFrame + 1
  55.        If BadGuys(x).ExplodingFrame = 13 Then
  56.           BadGuys(x).Exploding = 0
  57.           score = score + 50
  58.           TempCalc = TempCalc + 1
  59.           fboom = fboom + 1
  60.           If fboom > 3 Then fboom = 1
  61.        End If
  62.     End If
  63. Next x
  64.    
  65. If Tempclac + TempCalc >= CurLevel.NumOfBadGuys + 1 And bullets = False Then
  66.    flgm = 0
  67.    Form1.Tmr_flgm.Interval = 1
  68.    Form1.Tmr_flgm.Enabled = False
  69.    stage = 0
  70. End If
  71. End Sub
  72.  
  73.