super smooth 4 way screen scrolling - possible?

Blitz3D Forums/Blitz3D Beginners Area/super smooth 4 way screen scrolling - possible?

Dax Trajero(Posted 2005) [#1]
Although I'm using B3D, I'd like to build a retro looking 2D game using sprites and bitmaps.

How viable is it to build a *super* smooth 4 way scrolling screen routine ?


sswift(Posted 2005) [#2]
I suppose that depends on what you mean by super smooth.

Blitz 3D can draw 2D graphics at a decent speed. Not as fast as Blitxplus, but I have little doubt you could get over 60fps out of it, especially if you were using polygons instead of the 2D commands.

But if you're talking abotu synchng up with the refresh rate to render exactly one frame per refresh... I dunno if you'd be able to do that.


D4NM4N(Posted 2005) [#3]
if you use a system of 3d sprites as 2d, ive found it really fast


WolRon(Posted 2005) [#4]
I'd like to build a retro looking 2D game using sprites and bitmaps.

Do you mean something like this:
Pitfall II
and the source.


Dax Trajero(Posted 2005) [#5]
wolron, very nice - but thats a flip screen game - I wanted something to continually scroll, not flip.

Best way to find out is to give it a go I guess. I have an idea for a game which if I can implement it, should be pretty cool and not seen before (yeah right)


WolRon(Posted 2005) [#6]
but thats a flip screen game - I wanted something to continually scroll, not flip
The concept is the same...


Andy(Posted 2005) [#7]
Example:

tilesize: 64x64
screensize: 800x600

Create a buffer slightly larger than the size of the screen + 2 times the tilesize. Copyrect part of the buffer to the backbuffer every frame.

ceil(800/64=12.5) equals 13
13+2 equals 15
15*64 equals 960

ceil(600/64=9.375) equals 10
10+2 equals 12
12*64 equals 768

buffer needs to be 960x768

You then have 2 variables for each direction. X1 and X2 and Y1 and Y2.

X1 is incremented in steps of 1 and X2 is incremented in steps of 1 when X1 reaches 63. X1 is reset to 0 when that happens. It's the same for both Y1 and Y2. When X2 or Y2 change, then the buffer is redrawn using the new values.

This way you have a system where X2 and Y2 are used to position the tiles on the buffer and X1 and Y1 is used to position where the copyrect is copying from.

This saves alot of time and allows you to draw only the interesting stuff like characters every fps.

Andy