Re: Additional Video Pages
- Posted by Michael Packard <lgp at EXO.COM> Mar 26, 1997
- 1061 views
On Wed, 26 Mar 1997, William Eiten wrote: > > I am making a game and would like to know how to get more video pages in > mode 19, 320x200 256 colors. I think I've seen it before but don't > remember where. I don't have a whole lot of the details of the game worked > out, but I am planning on making it some sort of a strategy game. Thanks > for any help. You get one display page in 320x200x256 mode. The best way I know to work with it is to have a Virtual Screen, a screen sized sequence in ram, then "draw" your sprites into it by indexing into the sequence. After you "draw" all your sprites, you update the actual graphics screen by grabbing the changed regions of the Virtual Screen (with a few pixel border to help erase the previous sprite positions) and display_image() them to the screen. It sounds pretty complicated, but once you figure it out, it's VERY straightforward. The only confusing part is the actual "drawing." In my SpriteEngine I do something like: setVS -- this makes a clean copy of the background screen_update={0,1,0,1} -- is is my table of regions in VS to update to the screen. for each sprite procedure draw_sprite(atom x, atom y) for i = 1 to length(sprite) --height for j= 1 to length(sprite[1]) --width a=sprite[i][j] -- color of pixel in sprite if a>0 then -- if the color is 0 don't draw it, thus masking the sprite with the background VS[y+i][x+j]=a -- replace whatever is at that location with a end for end for screen_update=append -- add a 3 pixel safety region around it to erase the last position, -- increase this is if it moves more than 3 pixels in any direction end procedure Then after you get done with all your sprites, do through the screen_update() table and grab regions from the VS and display_image them. The format above for that table is {x1,x2,y1,y2} for the regions from {x1,y1} to {x2,y2}. Michael Packard Lord Generic Productions lgp at exo.com http://exo.com/~lgp A Crash Course in Game Design and Production http://exo.com/~lgp/euphoria