hi there,
this is my first post here, so hi there :).
i’m working with java for some years (server & normal gui apps), did some c++ gaming stuff (mostly 3d, using opengl, irrlicht).
since i want to learn java2d and game programming (2d) in java in general, i started with a very simple experiment: a scrolling background. the render loop looks like this:
Graphics g;
for (int i = 0; i < 1000; i++) {
g = (Graphics) strategy.getDrawGraphics();
g.drawImage(img, 0, 0, 640, 480, i, 0, i + 640, 480, null);
g.dispose();
strategy.show();
}
it runs very slow. i use a java.awt.Window with a size of 640x480. what am i wrong about?
the second thing i want to ask:
what is (in general) a good way or technique to do these image stuff (scrolling and drawing sprites)? i do not want to use a third-party api like gage cos i want to learn how it works :).
ok, cu,
verence
