Tiles using DirectDraw
for example, i have a map ( 50 x50 tiles). the tiles are 40x40. the resolution=800x600, this makes 20x15 tiles on a screen. i made a test version, this works great. i can scroll around the screen TILE by TILE. this isn''t smooth. i want to scroll the map smoothly, so this means DirectDraw must draw not the full tile, but a part of the tile... understand? OR (!) change the viewport. i can''t work these two solutions out, can somebody help me?
i''m drawing tiles like this:
for Row=0 to 15
For Column=0 to 20
Tile(Column,Row).draw backbuffer
Next Column
Next Row
Something like that. I understand that this is totally wrong when you want to do what i want. But what to do? Look, i can draw 25x20 tiles for example and then, on the end of the gameloop set the viewport to some coords. This could work great, but i don''t know which function to use. Is this possible anyway?
Thanks
Mosselmaniac
Are u using D3D?
if not:
first you nead tu use Blt() instead of fastblt() to use the clipper. OK?
Or u can use a border that u blt at last in the cycle.
To select witch to 20*15 TILES to blit u can use two variables one for the upper left and one for upper right, or u can use the center points. but some times it wont be any ceter as now when 15/2 =y.5 so coner will be better. The x and y coner pos shuld be in tiles, NOT pixels!<br><br>if yes:<br>I''m wrong person to ask but most teories from above will work<br><br>//Zuu
if not:
first you nead tu use Blt() instead of fastblt() to use the clipper. OK?
Or u can use a border that u blt at last in the cycle.
To select witch to 20*15 TILES to blit u can use two variables one for the upper left and one for upper right, or u can use the center points. but some times it wont be any ceter as now when 15/2 =y.5 so coner will be better. The x and y coner pos shuld be in tiles, NOT pixels!<br><br>if yes:<br>I''m wrong person to ask but most teories from above will work<br><br>//Zuu
Imagination is more inportant than knowledge.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement