large background image

In my jump n run game I use a very small field at the moment in which the player can move. When I increase the width to 2000 px, I notice, that everything gets screwed up. My question is, what is the right approach of having a large background image move whenever the player is moving.

The game can be seen at http://powered.at/supeross

[349 byte] By [hgwossa] at [2007-10-2 0:44:32]
# 1
May not be the right approach but you could put the image into a Scroll Pane where the scroll bars are hidden and move the horizontal scrollbar using setValue() when you want the man to move beyond the edge of the currently showing area.
JimDinosaura at 2007-7-15 16:59:27 > top of Java-index,Other Topics,Java Game Development...
# 2

Hi,

I'm not sure if this applies to your case but I read about a group of bugs with java 2D when the numbers being used are very large, but I think the numbers giving the problems were really really large. It was because of number overflow errors or something. Have a look at the bug database. If this is the cause, maybe use -1000 and +1000 instead of 2000?

Good luck,

Keith

CommanderKeitha at 2007-7-15 16:59:27 > top of Java-index,Other Topics,Java Game Development...
# 3
I have replaced the background image with a much larger one and would appreciate anyone telling me wether the game runs smoothly on their machine.The adress is http://powered.at/supeross
hgwossa at 2007-7-15 16:59:27 > top of Java-index,Other Topics,Java Game Development...
# 4
Runs fine on my machine at workAMD 2600with some really old PCI graphics card.That guy is pretty small
MBRpascoea at 2007-7-15 16:59:27 > top of Java-index,Other Topics,Java Game Development...
# 5

I am now using volatileimage, which made the painting much faster.

When I run the applet in Internet Explorer the background image is not displayed correctly. I have no clue, why this is and how to fix it. The background loads correctly, any repaint however, results in the background screwed up.

And I still do not always get a smooth motion. Please anybody tell me wether the current version runs smoothly on their machine.

The game and source can be found at http://powered.at/supeross

Thanks.

hgwossa at 2007-7-15 16:59:27 > top of Java-index,Other Topics,Java Game Development...
# 6
I guess I have fixed it. What about the motion? Is it smooth and playable for you?
hgwossa at 2007-7-15 16:59:27 > top of Java-index,Other Topics,Java Game Development...