This bottom code is in the UpdateModel and I was wondering what method can I use to approach when our reticle collides with the stationary reticle? I don't want the answer, but some advice where I can implement my own style.
I was thinking about using the OR operator, but when I try using both the ax or x variable, nothing changes when the reticle collides with the box.
Here is my code:
Code: Select all
//Code Below Ensures That The Reticle Is Green Outside Of Set Parameters.
if (ax <= 200)
{
rb = 0;
}
else
{
int rb = 255;
}
//The Code Below With Change The Color of X/Y If AX/AY Collides With It.
if (ax + 5 >= x)
{
gb = 0;
}
Code: Select all
gfx.PutPixel(-5 + ax, -5 + ay, rb, 255, rb);
gfx.PutPixel(-5 + ax, -4 + ay, rb, 255, rb);
gfx.PutPixel(-5 + ax, -3 + ay, rb, 255, rb);
gfx.PutPixel(-4 + ax, -5 + ay, rb, 255, rb);
gfx.PutPixel(-3 + ax, -5 + ay, rb, 255, rb);
gfx.PutPixel(-5 + ax, 5 + ay, rb, 255, rb);
gfx.PutPixel(-5 + ax, 4 + ay, rb, 255, rb);
gfx.PutPixel(-5 + ax, 3 + ay, rb, 255, rb);
gfx.PutPixel(-4 + ax, 5 + ay, rb, 255, rb);
gfx.PutPixel(-3 + ax, 5 + ay, rb, 255, rb);
gfx.PutPixel(5 + ax, -5 + ay, rb, 255, rb);
gfx.PutPixel(5 + ax, -4 + ay, rb, 255, rb);
gfx.PutPixel(5 + ax, -3 + ay, rb, 255, rb);
gfx.PutPixel(4 + ax, -5 + ay, rb, 255, rb);
gfx.PutPixel(3 + ax, -5 + ay, rb, 255, rb);
gfx.PutPixel(5 + ax, 5 + ay, rb, 255, rb);
gfx.PutPixel(5 + ax, 4 + ay, rb, 255, rb);
gfx.PutPixel(5 + ax, 3 + ay, rb, 255, rb);
gfx.PutPixel(4 + ax, 5 + ay, rb, 255, rb);
gfx.PutPixel(3 + ax, 5 + ay, rb, 255, rb);