Page 1 of 1

Can som1 tell me y my reticle doesnt have velocity on the first press once its reached the edge?

Posted: August 3rd, 2019, 1:32 am
by TheCollector
Here's the code for the borders and the pixels.
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);

Re: Can som1 tell me y my reticle doesnt have velocity on the first press once its reached the edge?

Posted: August 3rd, 2019, 1:42 am
by albinopapa
Once the boat reaches the edge of the screen the velocity is still going in that direction. Stop the velocity and it should take only one press after that to get the boat going another direction

Re: Can som1 tell me y my reticle doesnt have velocity on the first press once its reached the edge?

Posted: August 3rd, 2019, 1:50 am
by TheCollector
ah. Thanks again albino.

Re: Can som1 tell me y my reticle doesnt have velocity on the first press once its reached the edge?

Posted: August 3rd, 2019, 2:28 am
by albinopapa
np