Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7724403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:40:46+00:00 2026-06-01T04:40:46+00:00

I am creating a clone of Space Invaders in XNA as an exercise. I’ve

  • 0

I am creating a clone of Space Invaders in XNA as an exercise. I’ve hit various snags over the past 5 days, especially with the collisions which I have worked around. I’ve finally got it working only to hit another issue.

The bullet from the player collides and destroys the invaders, however, the rectangle I create as a hitbox for the collisions remains. (I think)

Whole solution can be located here so you can recreate the issue just press F5, and spacebar to kill the green invaders, the blank space that is left behind I believe is the rectangle.: https://www.dropbox.com/sh/pzy7fx3tuprzza2/GIjhZ6V5ll

My question is: When that bullet hits the invader, how can I remove the rectangle too, or stop them intersecting.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:40:48+00:00Added an answer on June 1, 2026 at 4:40 am

    The issue seems to be that your aren’t recognizing that your invader has been blown up on line 524 of Game1.cs You have a FOR statement that spins through your invaders, figures out where the invader should be, and then checks if the hit boxs intersect. You do not check to see if that invader whose hitbox is intersect is infact already dead.

    In your Invaders object (Invader1, Invader2, etc) you need to keep track of a variable to determine if the Invarder is alive. It appears you might be able to use the variable invaderVis if you like since that seems to determine if you should show that invader.

    So line 524 should be change to something like

    if (Type1Invaders[Count].invaderVis && rectMissile.Intersects(rectInvader))
    {
        //Do logic for hit
    }
    

    Also change your UFO hit checker on lne 539 to do the same as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

//dom <div id='toBeCloned'><span>Some name</span></div> <div id='targetElm'></div> //js $(function () { //creating a clone var
I am creating an Asteroids clone, but with a few more bells and whistles.
Creating a simple RPG game, first time using XNA. Trying to get my character
I've done this before by creating a clone and doing the rebase in the
Is it possible to clone a repository without git creating a .git folder inside
I am creating a minecraft clone, and whenever I move the camera even a
I am creating a Pong clone, and I am trying to use KeyBindings. This
I'm working on a real-time space strategy game clone which at its time did
For the past few hours I have been trying to clone an image in
I am creating a Guitar Hero Clone using C# and am having some trouble

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.