Losing pixels in 2D game.

So I have a background that is meant to scroll. The background image is 2000 pixels wide, however when it is drawn to the screen it comes to 1530 pixels wide.

Why is this occurring?

g.drawImage(background, worldPosition.getBgX(), worldPosition.getBgY(), this);

I just realized the window width is 470. But, why is this happening?

Oh and bonus unrelated(kind of) code:


public class f**kyou
{

	
	public static void main(String[] args)
	{
		f**kyou f**k = new f**kyou();
		
		int x = f**k.f**kyou();
		
		System.out.println(x);
	}
	
	int f**kyou()
	{
		int h = 2;
		int y = "GWH".hashCode() % 3000;
		int b = "WWI".hashCode() % 3000;
		for (int l = 0; l <= b; l++)
			h = (h ^ l) % y;
		return h;
	}
}

Little did I know how apt the class name was

EDIT: Oh and worldposition.getBgX, etc etc, thats for the scrolling background. So x is update, background scrolls, not sure why length of background is OHHHHH
I think I know what’s happening now. Rofl. Thanks.

You know this happens all the time with me. Typing it out really helps me think about it

glad we could help? :clue:

Give hi’m a medal!

Rubber duck debugging in action, people.

Eeehm… Wut? :clue: