Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Remove Enemy [Game Issue]
#2
Well, just like the player's bullets, for the enemy you need to setup an array and scroll through the array to check for collisions.

However, if you don't want to do that, and you have only one enemy, you can simply say..

Code:
'TODO: Check for collisions with enemies here
If bullet.Bounds.IntersectsWith(Me.enemy.Bounds) AndAlso Me.Controls.Contains(enemy) Then
    bulletsToRemove.Add(bullet)
    Controls.Remove(enemy)
    Score += 5
End If

So this makes it so before we check for collisions, we make sure that the enemy actually exists inside of the form.
My Blog | My Setup | My Videos | Have a wonderful day.


Messages In This Thread
Remove Enemy [Game Issue] - by Vinwarez - 07-14-2012, 11:12 AM
Re: Remove Enemy [Game Issue] - by brandonio21_phpbb3_import2 - 07-14-2012, 11:22 AM
Re: Remove Enemy [Game Issue] - by Vinwarez - 07-14-2012, 01:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Full screen game overlay? Ecnarf 1 8,610 01-29-2013, 09:14 AM
Last Post: xolara
  Dual Menu Strip Issue Moldraxian 3 16,862 08-15-2012, 12:36 PM
Last Post: brandonio21
  MySQL Database Issue Moldraxian 7 29,075 08-13-2012, 08:58 PM
Last Post: brandonio21
  Module Issue Vinwarez 18 59,450 07-24-2012, 11:47 PM
Last Post: Vinwarez
  Launching Projectile [Game Issue] Vinwarez 11 33,526 07-13-2012, 03:29 PM
Last Post: brandonio21
  How to remove these errors? Vinwarez 6 21,686 03-12-2012, 10:01 PM
Last Post: Vinwarez

Forum Jump:


Users browsing this thread: 1 Guest(s)