TIC-80 icon indicating copy to clipboard operation
TIC-80 copied to clipboard

Should the map() remap callback read/write flags?

Open paul59 opened this issue 2 years ago • 0 comments

I'm trying to use map()'s remap callback to animate a tile using four sprites (#32-#35). These tiles have flag '0' set and RIGHT=0 is defined elsewhere but this code doesn't work so I'm guessing only the pixel data is being sent to and returned by the function.

I tried using fget()/fset() inside the callback but that doesn't seem to work either. The only workaround I can see is forget using the callback and manually iterating over the map using fget(mget(x,y),RIGHT) instead (which works but I'm guessing is a lot slower).

function remap(t,x,y)

	if fget(t,RIGHT) then 
		t=t+1
		if t==36 then t=32 end
	end
	return(t)

end

paul59 avatar Aug 17 '22 16:08 paul59