nano9 0.1.0-alpha.7

A Pico-8 compatibility layer for Bevy
Documentation
--[===[
template = "pico8"
[defaults]
initial-palette = 1
time-to-live = 0
[[sprite-sheet]]
path = "bird-sprite-indexed.png"
index-color = true
sprite-size = [16, 16]
[[palette]]
path = "bird-sprite-indexed.png"
extract-index = true
[[palette]]
path = "red-palette.png"
extract-index = false
]===]

t = 0
p = 0

function _init()
end

function _draw()
    cls()
    local n = time() * 4 % 8 + 8
    local x, y = t % 128, t / 128
    local flip_horizontal = true
    spr(n, x, y, 1, 1, flip_horizontal)
    t = t + 1
end

function _update()
    if btnp() then
        p += 1 -- Cycle through the palettes.
        palm(p)
    end
end