🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

breakout in c#

Started by
22 comments, last by Tom Sloper 3 years, 3 months ago

pbivens67 said:
I am using a list to store the bricks, is there a way to remove the bricks from the list

Lists are dangerous as they do allow adding multiple entries of the same brick (however you defined that) to it. Instead go for a HashSet<T> where T is your brick class/struct/id? and make sure you properly overriden GetHashCode and Equals. Then a simple Remove(instance) will erase the brick from the list

Advertisement

@SuperVGA well this is my collision detection code

Phil, you're refusing to take advice that you asked for. This is the sort of behavior that has raised hackles numerous times in the past.

This thread is closed.

-- Tom Sloper -- sloperama.com

This topic is closed to new replies.

Advertisement