From looking at your Game.cpp file you have this
a part of you edge correction
Code: Select all
if (x - 5 <= 0)
{
x = 5;
vx = 0;
}
and this for your box mode
Code: Select all
if (x < 200 || x > 300)
{
IsBoxMode = true;
}
The issue seems to be when you go into box mode ( x < 200 ) for example, you draw your box, but .....
when you are checking edges you haven't taken into account that the box is larger then the reticle.
Looking at your putpixel calls you have this
Code: Select all
gfx.PutPixel(-11 + x, 7 + y, rg,rg,255);
Can you see the issue, or what i believe is the issue,? lets go back to the edge correction where you have this
if (x - 5 < 0) .. where the putpixel above has -11 + x (which subtracts as i'm sure you know)which puts you out of bounds. So you need to make your box the same size (width and height) as your reticle, or do another correction from the edges for the box.
Hope it makes sense, i'm not the best at explaining
Peace