Advertisement

breakout in c#

Started by February 26, 2021 08:32 PM
22 comments, last by Tom Sloper 3 years, 6 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

@SuperVGA well this is my collision detection code

Advertisement

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