Best way to code a side-scrolling game?
I have three questions about coding a side-scrolling game, which I hope that you guys might know the answers to.
1. When drawing the background to the buffer image (I am planning to use double buffering of course), how should I break up the background into several images? I can't have the whole background's image as one image, otherwise drawing the image all the time would be very inefficient. I am wondering how to break up the image into panels; should I break the image up so that each panel is the size of the screen? Half the screen size? I am wondering what the optimum background panel size is, without having to use any complicated calculations when drawing to the screen.
2. How would I regulate the game speed? For example, if the game runs at the correct speed on a 90MHz CPU, how do I make sure that it won't go out of control on a 3GHz CPU? A friend of mine suggested drawing to the offscreen buffered image at any speed, and then using some sort of timer to draw the the onscreen image a set number of times per second. Would I use a thread and the sleep method to do this, or would a javax Timer be better? Or is there a completely better solution?
3. Let's say I write an interface called Damageable with the method isHit() which will be implemented by an EnemySprite class. How do I trigger the EnemySprite's isHit() method when a Weapon's range touches the range of the EnemySprite?
Thanks in advance.

