Skip to content

Instantly share code, notes, and snippets.

@omgmog
Last active August 1, 2018 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omgmog/cbb42a7b3e0dab927a65a6010a2e1993 to your computer and use it in GitHub Desktop.
Save omgmog/cbb42a7b3e0dab927a65a6010a2e1993 to your computer and use it in GitHub Desktop.
pico-8 cartridge // http://www.pico-8.com
version 16
__lua__
function sleep(s)
for i=1,s*30 do
flip()
end
end
c = 0
function _update()
c += 1
if c > 4 then c = 1 end
end
states = {
{20,19,false,true},
{19,19,true,true},
{19,20,true,false},
{20,20,false,false}
}
function _draw()
cls()
-- pole
spr(4, 20, 20)
spr(4, 20, 14)
-- shadow
spr(3, 20, 20)
-- valve
spr(
1,
states[c][1],
states[c][2],
1,1,
states[c][3],
states[c][4]
)
-- hilight
spr(2, 20, 20)
print(c)
sleep(.2)
end
__gfx__
00000000000004400000000000000000022212000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000004444400090000000000000012221000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00700700044044000900000000010000022212000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00077000040404000000000000101000012221000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00077000044044000000000000010000022212000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00700700004440000000000000000100012221000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000111000022212000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000012221000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment