I've written a little routine that scrolls a map in all directions.
Screen res is at 800 x 600, with my tiles being 64x64 pixels.
I've allowed an overlap of a tile in all directions, so its blitting 12 across and 10 down
To counter for the scroll, I've got an offset that moves the blit of the tiles over - till its more than 64 pixels, where I can just increase the map value and put the offset back to 0
Works well, but I cant seem to work out a method to get the tile at the screen coords.
At the mo I've got this:
Function get_tile(xtemp,ytemp)
tilex=xtemp/64+(mapx)
tiley=ytemp/64+(mapy)
tilenum=maze(tilex,tiley)
Return
End Function
But its wrong.. :( (also doesnt allow for the offset - xoff,yoff)
Cant seem to work it out !
Also.. I want to have a HUD over the scrolling area, is it best to blit the map, then the HUD over it - or copy the map into a blank space on the HUD.
Screen res is at 800 x 600, with my tiles being 64x64 pixels.
I've allowed an overlap of a tile in all directions, so its blitting 12 across and 10 down
To counter for the scroll, I've got an offset that moves the blit of the tiles over - till its more than 64 pixels, where I can just increase the map value and put the offset back to 0
Works well, but I cant seem to work out a method to get the tile at the screen coords.
At the mo I've got this:
Function get_tile(xtemp,ytemp)
tilex=xtemp/64+(mapx)
tiley=ytemp/64+(mapy)
tilenum=maze(tilex,tiley)
Return
End Function
But its wrong.. :( (also doesnt allow for the offset - xoff,yoff)
Cant seem to work it out !
Also.. I want to have a HUD over the scrolling area, is it best to blit the map, then the HUD over it - or copy the map into a blank space on the HUD.