Log In  

While experimenting with translating some "Zelda - Link From The Past" tiles into pico, I noticed that a lot of sprites save memory by mirroring the left half to the right one.

While the API allows drawing sprites mirrored along the x-axis, the map editor only permits one tile direction.

Would it be possible to add the ability to mirror sprites to the map editor as well?

P#10758 2015-05-18 01:46 ( Edited 2015-05-18 12:32)

One way to do it would be to add a bit to every map cell. If you partition sprite memory in half (one half for sprites that are map tiles, one half for others) then you could paint wrong-half sprites on the map to indicate the corresponding right-half sprite should be drawn, but flipped.

Another way to do it, if the proportion of flipped tiles are much smaller than the proportion of non-flipped tiles, is to have an exceptions table, something like:

flip={{x=34,y=53},{x=38,y=55}}

Regardless, you probably end up doing your own map drawing, instead of map(), something like this:

for i=0,16 do
 for j=0,16 do
  local m = mget(i,j)
  spr(m,i*8,j*8,1,1,flipped(m,i,j))
 end
end
P#10760 2015-05-18 08:32 ( Edited 2015-05-18 12:32)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 15:17:11 | 0.005s | Q:11