Re: Sprites
- Posted by Lewis Townsend <keroltarr at HOTMAIL.COM> Jul 13, 1998
- 538 views
Ralf said: >Split the sprite up in pieces of horizontal lines and store the complete >offset of every set of those lines. The use pixel to display every set. If >you want to poke () and do the bank-switches yourself, you're better off >replacing the {x,y} position wiht a fixed calculated position, an offset to >add to the begin offset in memory. > >This is the theory behind the compiled sprites in my GFX. >Here I remade a simplified version of those routines: <SNIPPED STUFF> >Ralf Nieuwenhuijsen >nieuwen at xs4all.nl That's not at all the way I do it and my way seems pretty fast: Somebody (I can't remember whom) posted to the recent users contribution page a certain "bitmap.e" which does stuff like extract a bitmap from a larger bitmap given UL and LR points and insert a smaller bitmap into a larger one. Once you cut a peice (bm) out of the background the same size as your sprite do something like this temp = (sprite = 0) temp = bm * temp temp = temp + sprite temp now contains the sprite with the background showing through where the sprite is zero. you can now INSERT temp into the background where you extracted bm from. Or at least show it that way on the screen. I'm sure Ralf's way is good but this seems much simpler to me Will whoever made "bitmap.e" please explain this better and take credit for this cool set of routines. Sincerely, Lewis Townsend |\ ____ _ _ _ _ __ | \ | __/ || / | // || / __ \ | \ ||_ || //|| // || ||__\| | \ | _| || // || // || \___ \ | |\ \ ||__ ||// ||// || |\__|| | | \ \|___\ |_/ |_/ || \____/ | | \ \ _____ _______ | | \ \ | __ \ | _ _ | | | \ \ ||__|| |/ | | \| | | \ \ | __ / | | | |______\ \ || \\ | | |___________\ || || |_| Keroltarr at hotmail.com ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com