|
-
Jun 6th, 2016, 10:57 AM
#1
Re: Trouble with Collision Between Objects Defined in Different Arrays
Be aware that LINQ is concise, but it isn't fast. You won't see a difference in speed for something like this, since either way will appear to happen instantly, but if you find LINQ painful to read then don't worry that you're missing out.
One thing I would suggest is that you try to make the reset work with the existing form rather than creating a new form and hiding the current. There's an issue with doing it as you are, since every object takes up a bit more memory and it never gets freed. If you hit reset enough times, the computer would crash...though it would likely take a few thousand presses before that happened, so you could ignore it. Still, truly resetting the current form is a better solution.
In any case, you want to study this error a bit more by putting a breakpoint on the For statement in the Load event. When execution stops at the breakpoint, use F11 to step through the code. What you are specifically looking for is what gets put into each array and what the values of I and J are. I suspect that you will find that you get different results between the first time you run this and after the reload.
My usual boring signature: Nothing
 
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|