As it stands, you reach the edge and then you have to press the arrow key twice, once to get it to move a space then a second time to get it to move with velocity. No clue why it's doing this. Also, why does the + -17 work in B top border?
Code: Select all
//B right border
if (bx + 35 >= gfx.ScreenWidth)
{
bx = gfx.ScreenWidth - 37;
}
//B left border
if (bx + 33 <= 1)
{
bx = 0 + -30;
}
//B top border
if (by + 19 <= 1)
{
by = 0 + -17;
}
//B bottom border
if (by + 23 >= gfx.ScreenHeight)
{
by = gfx.ScreenHeight - 24;
}
//Boat gfx
//Upper
gfx.PutPixel(30 + bx, 20 + by, 0, 255, 0);
gfx.PutPixel(31 + bx, 20 + by, 0, 255, 0);
gfx.PutPixel(32 + bx, 20 + by, 0, 255, 0);
gfx.PutPixel(33 + bx, 20 + by, 0, 255, 0);
gfx.PutPixel(34 + bx, 20 + by, 0, 255, 0);
gfx.PutPixel(35 + bx, 20 + by, 0, 255, 0);
//Lower
gfx.PutPixel(31 + bx, 21 + by, 0, 255, 0);
gfx.PutPixel(32 + bx, 21 + by, 0, 255, 0);
gfx.PutPixel(33 + bx, 21 + by, 0, 255, 0);
gfx.PutPixel(34 + bx, 21 + by, 0, 255, 0);