10-30-2011, 06:18 PM
slenkar Wrote:does the memcopy command create the background?Yes, it just dumps a chunk of the ROM to the screen in this case - in general terms, it copies bytes of memory around.
slenkar Wrote:The saving and redrawing of the background is cool,In this case it undraws all four sprites back to the background in reverse order; so yes some sprites may have other sprites as their background item, but when you've rubbed out all four in reverse order, it doesn't really matter - you're back to background anyway.
I had a question about that
say in R-Type for example
lets say there is an explosion sprite which has been on the screen for 1 second and needs to disappear, what if there is a ship flying into the explosion, wont the ship be considered as 'background' and be copied back to the screen as a static object?
I've got a part written version (ignored for the past year, listed as Fourspriter Mk 3) that uses push and pop to draw it to the screen, and only rubs out sprites that moved, trying to track collisions. It doesn't really work though. It is low on flicker, however
slenkar Wrote:By the way, is the version in this thread considered the best?
Ooh. Tough call to make, that. It's complete, and it works, in that it's practically identical to the source code the mojon twins released initially, but with some cleanups and optimizations.
Since Boriel surely writes better code than me, it may well be better than the one in this thread - though I think my version uses fewer functions, and because it's more assembly optimized might run faster. I haven't really played with the inbuilt library version.