Hi! I don’t know if I’ve some system’s problem or other …
public GameView(){
JFrame container= new JFrame("Loderunner");
JPanel panel= (JPanel) container.getContentPane();
panel.setPreferredSize(new Dimension(460,460));
panel.setLayout(null);
setBounds(0,0,460,460);
panel.add(this);
setIgnoreRepaint(true);
container.pack();
container.setResizable(false);
container.setVisible(true);
container.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
requestFocus();
createBufferStrategy(2);
strategy=getBufferStrategy();
loadLevel("level.txt");
}
and this is the game loop
public void gameLoop(){
while(true){
Graphics2D g = (Graphics2D) strategy.getDrawGraphics();
g.setColor(Color.BLACK);
g.fillRect(0,0,460,460);
//draw(g);
g.dispose();
strategy.show();
}
}
http://imageshack.us/photo/my-images/23/rqs3.png/ in this link there is the screenshot of my pc so you can see that java don’t paint a part of window