Skip to content

Instantly share code, notes, and snippets.

@mhungerford
Created Sep 14, 2021
Embed
What would you like to do?
pico-8 xkcd comic for #pico1k jam
pico-8 cartridge
version 33
__lua__
-- PICOxkcd (based on xkcd.com)
-- by mhungerford (#pico1k jam)
-- draw a 1-bit pico8 binstr (https://www.lexaloffle.com/bbs/?tid=38692)
-- width must be byte-aligned
function xdraw(x,y,w,h,s)
for b=0,w*h-1 do
pset(x+b%w,y+b/w,((ord(s,b/8+1)&(1<<b%8))>>b%8)*7)
end
end
-- wait for user button press (and release)
function wait()
while(btn()==0) flip()
while(btn()!=0) flip()
end
-- setup 64x64 graphics mode
poke(24364,3)
::_:: -- label to loop program on
cls(0)
?"\^t\^w\#7\f0xkcd",16,20 -- using double-size text and text-background
?"\f7press x",18,50
wait()
cls(7)
xdraw(20,20,16,22,"◝◜◝ョ○◝◝ネかツOツき]おm\\のセりクャんャ◝ャ◝ャ◝ャ◝ャ◝ャ◝レ◝ロ◝モ○モ○ヤ")
color(0)
?"stand back",12,12
-- do some special manual spacing to make this look nice
?"I\^x2'\^x4M GOING TO TRY\n\|j science",1,44
wait()
cls(7)
xdraw(8,26,16,23,"ᶠ◝o◜ワ◜ワョレョラョモ◜.◝🅾️◝゛◜ツゆツツツニツ◝え◝}らョトョにョにョo¹`レッヨヲ")
xdraw(38,25,8,24,"ニツゆゆテテメリワネクコふふvvラミミツツやゆゆ")
color(0)
?"MAKE ME A\nSANDWICH",1,0
?"WHAT? MAKE\nIT YOURSELF",20,12
?"SUDO MAKE ME\nA SANDWICH",1,50
?"OKAY",48,58
wait()
cls(7)
xdraw(28,28,32,25,"?ュ◝ユトン○モヤャsトヤょuトトつzヤト]ョモよゆ◜レ゜\\ョン♥た:ナみれˇえおんょ}スネん。あリ♥]ち◝かZj◝○[t◝○'u◝○き ュよ◆ヨャト◆ンョよか¹◜○█_◝◝ッᶠ◝◝ヲgュ?ヌフュ?フ")
color(0)
?"HEY! GET BACK\nTO WORK",1,0
?"MY CODE'S\nCOMPILING",26,12
?"OH. CARRY ON.",1,56
wait()
cls(7)
xdraw(20,40,40,23,"○ヲ◝◝ニ?ッん◝メ?ッめ◝テ?ッ}◝テ?ッ}◝テ?ャ}◝テ?ャや◝ツ?ャみ◝ミ?ャれ◝フ○む_゛ナ\0@Fョヤ\0らYョエ◜ヤ_ョに◜ヤ_ョに◜ヤ@ョo◜o@◜ヤ◜に゛◝フ◜にお◝シ◜にら◝タ◜にレ◝め◜ヤヨ◝や◜ヤナ◝}\0ナノ◝}")
color(0)
?"WEIRD. MY\nCODE CRASHES\nWHEN GIVEN\nPRE-1970 DATES",1,0
?"EPOCH FAIL!",21,28
wait()
goto _
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment