Well you wana write a scroller eh? Well lets begin. Were going to write a pixel*pixel scroller using a camera. The camera is the key in making the hole thing. Cameras are used in 3d as well as 2d. Now let us begin. First of all we need a camera type: type tagCamera CamX as integer CamY as integer endtype this will be used to keep the player in sight. Will explain;) but.. now lets set up our vars use this to check for collision with tiles Xtile=INT(PlayerX/TileSizeX) 'Tile Collision Ytile=INT(PlayerY/TileSizeY) Just add that to the map and you'll get tile colision: if Map(Xtile,Ytile) = Whatever is solid then Collision endif Now it's time to set up our camera dim Camera as tagCamera Camera.CamX=PlayerX-160 Camera.CamY=PlayerY-100 thats to keep the camera at the edge of the map. Now lets check for edge of map collision if Camera.CamX > (MaxMapX*TileSizeX)-320 then Camera.CamX=(MaxMapX*TileSizeX)-320 if Camera.CamY > (MaxMapY*TileSizeY)-200 then Camera.CamY=(MaxMapY*TileSizeY)-200 Thats for the lower right corner if Camera.CamX <0 then Camera.CamX=0 if Camera.CamY <0 then Camera.CamY=0 Thats for the upper left corner Now! lets do our engine Note: Drawing command not in qb This will be from a lib called Rellib ok! Xtile=INT(Camera.CamX/TileSizeX) 'To get start of tiles Ytile=Int(Camera.CamY/TileSizeY) TileX=Camera.CamX mod TileSizeX 'To get position in tile to draw TileY=Camera.CamY mod TileSizeY For Y= 0 to MaxY For X= 0 to MaxX Tile=map(X+Xtile,Y+Ytile) 'Add to map to get right tile RelSprite VARSEG(Buffer(0)),(X*TileSizeX)-TileX,(Y*TileSizeY)-TileY,VARSEG(Tile(1)),VARPTR(Tile(TileIndex(Tile))) Next X,Y Now that wasn't so hard But remeber that the draw rountine is from a lib Oops fogot to inform you of some vars TileSizeX,TileSizeY=Size of your tile MaxX,MaxY= Your TileSizeX/320 and TileSizeY/200 Note: Very important to Know this or you will get errors MaxMapX= Amount of tile going across X * TileSizeX MaxMapY= "" "" "" "" "" "" * TileSizY e.i MaxMapX=26*16 MaxMapY=30*16 a 26x30 map and 16x16 tiles ok,before i forget Use this to put down your hereo sprite Xpos=Playerx-Camera.CamX Ypos=Playery-Camera.CamY Use this for NPC's NPCX=NPCX-Camera.CamX NPCY=NPCY-Camera.CamY Note: Use a different var for the player like e.i Xpos is a var to center him do not use Playerx=Playerx-Camera.CamX or etc. use only for NPC's NPCX=NPCX-Camera.CamX ok, Now you can make a killer scroller with kick ass nPC'S heh...;) E-mail me if any probs kack@qbrpgs.com -Kackurot cya!