Hello everybody,
first time posting on this forum, so please be nice :D.
I am programming a 2D tiles gamebut i have some probelms of lags. Ok, my computer is quite old, and the game works perfectly fine on gamer computer, but i amsure i have a problem in my interface architecture.
I tried to improve it several time and as far as i am, my architecture is the one below :
JFrame <- JLayeredPane <- JPanel
I use the JFrame to display the whole game. It implements a double buffering hardware based on a JLayeredPane.getGraphics()…
I use the JLayeredPaneto organize all my interface : show or hide the character inventory, craft interface, overview map, etc.
JPanel are used to paint all the interface components such as the global view, the charcater inventory, overview map, etc.
Each JPanel implements a software double buffering to update their image. They are also implementing the museListener for all the player actions.
Despite all that buffers, it is still laggy and not fluent.So i am sure there is a problem coming from the way i structured everything (for example, i guess the JLayredPane.getGraphics is not very fine because it use the EDT… but i don’t know any other way to do it.)
Tkank’s for you’r help and advices.
Please also excuse my english… i am doing my best