[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bored at work....



On Wednesday, August 8, 2012 11:50:06 AM UTC-7, Antoine Vignau wrote:
> I thought you would have used a screen buffer of 40*20/24 (depending on the size of your tiles) and scroll that buffer internally and then refresh on screen what was necessary by comparing the buffer before scrolling and the new buffer.
> 
> 
> 
> Let's try some algorithm:
> 
> 
> 
> oldMAPBUFFER <= currentMAPBUFFER
> 
> scrollLEFT(currentMAPBUFFER)
> 
> for y=0 to 23
> 
>  for x=0 to 39
> 
>   if currentMAPBUFFER(x, y) =! oldMAPBUFFER(x, y)
> 
>     drawTILEONSCREEN(currentMAPBUFFER(x, y))
> 
>  next x
> 
> next y
> 
> RTS ; for fun ;-)
> 


I see..  so I  don't have to scroll empty space on the screen :-)  Even faster scrolling.  Also will make collision detect work easier.

Rich