super smooth 4 way screen scrolling - possible?
Blitz3D Forums/Blitz3D Beginners Area/super smooth 4 way screen scrolling - possible?
| ||
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 ? |
| ||
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. |
| ||
if you use a system of 3d sprites as 2d, ive found it really fast |
| ||
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. |
| ||
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) |
| ||
but thats a flip screen game - I wanted something to continually scroll, not flip The concept is the same... |
| ||
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 |