From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Tile based scrolling? Date: Fri, 17 Jan 1997 20:30:00 +0000 Organization: None Lines: 25 Distribution: world Message-ID: References: <5bjnrh$bu2 AT dailyplanet DOT wam DOT umd DOT edu> NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp James Jeffrey Benjamin writes: >I'm slowly working on a tile based engine using Allegro (mainly for >640x480) and it has become prone to bugs. Anyway, what I'm doing is double >buffer with blitting (moving) the virtual screen around as I add new rows >of sprites. Is this faster or slower with the conventional way of just >rewriting every (compiled) sprite onto the screen buffer? I know my way >will get quite complex when I introduce parallex srolling. Sprite by >sprite is easier, but is it faster? It really depends on the details of your program (sorry, I don't have any easy answer for you :-) If a lot of the screen stays the same from one frame to the next (true for many tile-based systems), your approach will probably save a lot of time. If it scrolls every frame, though, rather than just when you reach the edge of the screen, and certainly if you are doing parallax effects, a brute-force redraw would almost certainly be faster (I can't think of any way to do as-required redraws on a parallaxed screen, unless you restrict the display to each different horizontal line belonging to a single parallax layer). /* * Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/ * Ghoti: 'gh' as in 'enough', 'o' as in 'women', and 'ti' as in 'nation'. */