Log In  


For those who missed the Twitter post by Zep, he's published the official 0.1.6 changelog! He said the new version is coming this week.

Pico-8 0.1.6 changelog

1


w00t! Last one to write setmetatable and coroutine tutorials is a rotten egg!


I'm so excited for the cartridge explorer! Also I got in the habit of typing a bit slower because of the duplicate keypress thing, that'll be nice to have fixed.

The coroutine and metatable stuff is nice too. For me, the absence of these was the only thing keeping it from feeling like full Lua.

Thanks @zep!


Thank god I saw this now - was going to spend the day rewriting my object system again to work around the absence of setmetatable!


The audio mixer pops fix is a life saver, prior to this I always had to make sure to set all muted notes to the same waveform and effect as the previous one.

The explorer sounds really exciting as well!


Sounds great, especially raising the memory limit again. Prevents me from the need to add some kind of swapping to Tower of Rhavenna.


\o/ very excited for setmetatable \o/ and memory limit increase is nice too.


Agreed! Memory limit increase is so welcomed. And with the metatables, I can actually transpile JS to Lua and a somewhat sane manner. :D


Those sound fixes will help greatly with mixing sfx with music that needs 4 channels.

And setmetatable is a very welcome thing! In anticipation, I wrote a vector math helper type that I might never use. (and it works fine in regular Lua, just need to provide atan2/sqrt as upvalues to the script)

v2mt={
__add=function(a,b)return v2(a[1]+b[1],a[2]+b[2])end,
__mul=function(a,b)return type(a)=='number'and v2(a*b[1],a*b[2])or v2(a[1]*b,a[2]*b)end,
__div=function(a,b)return a*(1/b)end,
__unm=function(v)return v*-1 end,
__sub=function(a,b)return a+-b end,
__tostring=function(v)return v[1]..' '..v[2]end,
}
function v2(x,y)return setmetatable({x,y},v2mt)end
function v2dot(a,b)return a[1]*b[1]+a[2]*b[2]end
function v2dir(v)return atan2(v[2],v[1])end
function v2mag(v)return sqrt(v[1]^2+v[2]^2)end
function v2norm(v)return v/v2mag(v)end

Just call v2 with an x and y component, and it'll generate a table value with a vector metamethods. Alternatively, call with no arguments and you get the zero vector.

This vector type supports addition (a + b), subtraction (a - b), unary negation (-v), multiplication by scalar (k v, v k), division by scalar (v / k), tostring(v), dot product (vdot), direction (vdir) + magnitude (vmag) (for polar coordinates), and normalization (vnorm). And you can also treat as a table with two elements by indexing, but be careful if you modify the components, as this will modify all references to that value.

If PICO-8 could one day support _G or _ENV (maybe as _g / _env), I'd be very happy. It's easy enough to work around, but with token and character limits, being able to index the globals table like a regular table is occasionally handy. And it means that functions/variables that are accessed by name in this fashion can just be top-level declarations, which cost less tokens than a table literal containing a bunch of junk. (no {}, no comma/semicolon delimiters needed, functions don't need to be written name = function() end)


0.1.6 came out. Did anyone try to search things in SPLORE? As soon as I make a search I can not reset it anymore an start another one...


Ah -- that's a bug. Work-around is to quit & reload PICO-8. o_o


thank you for quick response! :)



[Please log in to post a comment]