Do logic in whatever size you feel like. Then draw it at whatever size you (or the user, depending on what you allow) feel like.
Scale input to your logic, instead of trying to scale your logic based on screen size.
If your logical window is 640 x 360, and the render resolution is at 1280 x 720, just treat input at coordinate 500 x 250 as if it were at 250x 125.
The exact process will depend a bit on what kind of stuff you're using -- some frameworks operate in normalized values from -1 to 1 across the entire screen, others might only give you access to the pixels and the window size. Regardless, you don't really care what size the window is, you care what size your world and logic is.
Or does anyone know if there is a way to track specific variables and act like a breakpoint when their value changes?
If you're using Visual Studio, you can set a breakpoint, and then set a Data Breakpoint (Debug --> New Breakpoint --> New Data Breakpoint...).
Set your address and it should notify you when the memory is written to.
That said, it sounds like maybe your not actually using the same camera as you're constructing.I would guess that your camera instance goes out of scope, and you're using a different (not correctly initialized) camera instance later on, or something like that...
Yes, but in that for loop, you have a piece of code that will essentially restart the current iteration of the for loop if the randomly chosen card has already been randomly chosen.
As you keep choosing unused cards, the chance of choosing an already chosen card will increase, which means constantly trying to select a new card, taking more and more time.
Other than the issue mentioned above, there's also an issue with how you randomly select a card. You currently choose a card between 1 and 52.
However, your arrays are only initialized to , so if card 52 is chosen (which will try to index into your arrays at ), you'll be comparing against uninitialized values, which might be what's causing your code to never finish.
Arrays are zero-indexed -- meaning that the first item in an array is at , not .
The fix for this issue is to simply remove the + 1 part of the random number generation.
Math.Rand() returns a number from 0 (0 is included) up to 1 (1 is not included).
Math.Floor(Math.Rand() * 52) -- this includeds the fix I mentioned -- yields a minimum of 0 and a maximum of 51. This is exactly what we want for indexing into our arrays.
If you have errors with your code, post the actual code that gives the error. Posting "cleaned up" code which doesn't contain the errors or show the full picture just makes everything harder when trying to help.
What you've posted omits too much to point to specific code other than guessing a lot.
That said, my guess is that "final" isn't a valid index for your deck_array. Why it isn't is a whole different question, which requires more information.
Helping someone is a lot harder when you don't know what the problem is.
That said, you're currently clearing the screen right before presenting it, which will essentially discard all rendering you've done before the clear.
You should also separate updating and rendering better than you do. Currently, you render the snake, then update it, then render other stuff -- I'd suggest updating everything that needs to be updated first, and then rendering everything that needs to be rendered after.
Additionally, your snake seems to have a lot of responsibilities -- updating time and input, spawning food, etc. For future projects, I would suggest splitting these responsibilities up further into additional classes. (See also: Single Responsibility Principle).