help : Scrolling & Fullscreen !!

Hey, i m a little french coder and i have a problem with fullscreen & the scrolling?

we have a project for the end of my study which is a bomberman in 2d.
i read some post & saw that we have some brilliant coder here so you probably can help me.

the problem : we have flicker during the scrolling. we do use doublebuffering

first idea : we try make a JScrollPane in a frame, hide the scroll-bar and do our scrolling with the viewport() command. it work great but we want it in fullscreen and here it flickering on screen.

second idea : to make it work in full screen mode, i thought about don’t use the Jscrollpane and use instead the copyarea() function but we have another problem and also flickering

  1. so anyone know where can i found good post, source or tuto tuto to make scrolling in fullscreen mode (if possible using multiple buffering)?

  2. tell me which is the best method for scrolling in fullscreen or if there’s another wich?

thanx? :wink:

Search the forum, there are numerous Threads about 2d scrollers, including a bomberman clone i believe.

There are even 2 tile based engines, ideal for a bomberman game.

JScrollPane, despite the name, is totally unsuitable for a scrolling game. Ditch it and use a Canvas with a BufferStrategy (again, search the forums). You’ll need to have some sort of camera position and when drawing you offset all coords by the camera position. And then make sure you optimise it by only drawing onscreen images, but you can worry about that later.

thanks for replies, i’m searching

Is it a problem if we use lot of png image

to explain : we make a random function that create a big map

we use a graph to represent the map (each edge is a square : little png 30*30 pixels) and having breakable object and unbreakable

  1. we create the graph wich represent the map
  2. we use a function which associate a random image to each edge (function takes care of placing object because we have different sort of object (little, middle, big) and it works great)
  3. to draw the map we first trace on a background image (using createCompatibleImage()) the passive (unbreakable) object and then we complete this created image by the draw of dynamic (breakable) object.

as we try 800*600 fullscreen mode we approximatively have to trace 500 mini png to draw a portion of the map

is it a good method or can it create problem for the scrolling?

another thx to replie so fast :wink: