Datasets:
cart_id stringlengths 4 32 | title stringlengths 1 83 | author stringlengths 1 20 | description stringclasses 1
value | tags listlengths 0 4 | stars int32 0 1.91k | reply_count int32 1 1.22k | date_posted stringdate 2015-04-18 20:51:18 2026-03-17 20:38:31 | date_updated stringdate 2015-04-21 17:02:27 2026-03-17 21:52:37 | license stringclasses 2
values | thread_id int32 1.81k 156k | thread_url stringlengths 40 42 | lua_code stringlengths 103 65.7k | token_count int32 18 55.4k | char_count int32 103 65.7k | has_init bool 2
classes | has_update bool 2
classes | has_draw bool 2
classes | is_duplicate bool 2
classes | spritesheet imagewidth (px) 128 128 ⌀ | label_image imagewidth (px) 128 128 ⌀ | map_image imagewidth (px) 1.02k 1.02k ⌀ | map_data listlengths 0 4.1k | sprite_flags listlengths 0 256 | gfx_hex stringlengths 0 16.5k | sfx_hex stringlengths 0 10.8k | music_hex stringlengths 0 768 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
phille_turn-0 | phille_turn | Superdog998kytg | [] | 0 | 2 | 2026-03-17 20:38:31 | 2026-03-17 20:45:01 | CC4-BY-NC-SA | 155,668 | https://www.lexaloffle.com/bbs/?tid=155668 | -- phille the turn mover
-- by superdog998kytg
function _init()
speed=8
player={
x=64,
y=64,
}
px=64
py=64
tpr=4
turn=tpr
rotation=0
max_rotation=2
state=0
level=0
max_level=5
mx=0
my=0
wx=0
wy=0
cx=0
cy=0
rest=0
ball=0
cr=4
tr=4
lr=4
s=1
next_level()
end
function _update()
--player movement--
cr=4
tr=4
lr=4
wx=px
wy=py
if state==2 then
if btnp(❎) then
sfx(04)
level=0
next_level()
state=0
end
end
if state==3 and btn(🅾️) then
sfx(04)
state=1
next_level()
end
if state==1 then
if turn>0 then
if btnp(⬆️) and player.y>cy+0 then
sfx(02)
player.y-=speed
turn-=1
end
if btnp(⬇️) and player.y<cy+120 then
sfx(02)
player.y+=speed
turn-=1
end
if btnp(⬅️) and player.x>cx+0 then
sfx(02)
player.x-=speed
turn-=1
end
if btnp(➡️) and player.x<cx+120 then
sfx(02)
player.x+=speed
turn-=1
end
end
if turn==0 then
for tri=1,5 do
tr=9
end
end
--rotation advancing--
if btnp(❎) then
sfx(03)
px=player.x
py=player.y
rotation+=1
if fget(mget(px\8,py\8),1) and rest==0 then
turn+=tpr
rest=1 else
turn=tpr
end
--hazzerd tiles--
if fget(mget(px\8,py\8),0) then
sfx(00)
px=wx
py=wy
player.x=wx
player.y=wy
end
end
--colectibles--
if fget(mget(px\8,py\8),3) then
if mget(px\8,py\8)==17 then
mset(px\8,py\8,18)
end
if mget(px\8,py\8)==33 then
mset(px\8,py\8,34)
end
ball+=1
next_level()
for lri=1,2 do
lr=9
end
end
if turn<0 then
turn=0
end
end
--spesial case--
if px==280 and py==40 then
rest=0
end
if px==384 and py==40 then
rest=0
end
if px==656 and py==56 then
px=576
py=40
player.x=576
player.y=40
end
--button 🅾️--
if btn(🅾️)and state==0 then
sfx(01)
state=1
end
--next system--
if fget(mget(px\8,py\8),2) and state==1 then
sfx(01)
level+=1
next_level()
state=3
end
--restaart--
if rotation==max_rotation then
next_level()
for cri=1,12 do
cr=9
end
end
--finished the game--
if level==max_level then
state=2
end
end
--level system--
function next_level()
--0 level--
if level==0 then
rotation=0
turn=0
tpr=0
rest=0
max_rotation=2
cx=0
cy=0
tpr=4
player.x=cx+64
player.y=cy+72
px=64
py=72
turn=4
tpr=4
end
--1 level--
if level==1 then
rotation=0
turn=0
tpr=0
rest=0
max_rotation=2
cx=136
cy=0
player.x=cx+56
player.y=cy+64
px=cx+56
py=cy+64
turn=4
tpr=4
end
--2 level--
if level==2 then
rotation=0
turn=0
tpr=0
rest=0
max_rotation=5
cx=272
cy=0
player.x=cx+64
player.y=cy+64
px=cx+64
py=cy+64
turn=4
tpr=4
end
--3 level--
if level==3 then
rotation=0
turn=0
tpr=0
rest=0
max_rotation=6
cx=408
cy=0
player.x=cx+0
player.y=cy+120
px=cx+0
py=cy+120
turn=4
tpr=4
end
--4 level--
if level==4 then
rotation=0
turn=0
tpr=0
rest=0
max_rotation=4
cx=544
cy=0
player.x=cx+64
player.y=cy+120
px=cx+64
py=cy+120
turn=4
tpr=4
end
--title image--
if level==6 then
cx=680
cy=0
player.x=cx+64
player.y=cy+64
px=cx+64
py=cy+64
end
end
function _draw()
--start screen--
if state==0 then
camera()
cls()
print("press z to play",35,63,6)
print("⬆️⬇️⬅️➡️ move: x next rotation",4,70,6)
else
--finished screen--
if state==2 then
if ball==7 and s==1 then
sfx(05)
s=0
end
cls()
print("you win thanks for playing",cx+15,cy+58,10)
print("balls: "..ball,cx+50,cy+64)
print("press x to restart ",cx+35,cy+70)
else
--level screen--
if state==3 then
camera()
cls()
print("level: ",50,64,lr)
print(level,73,64,lr+8)
print("press z to continue ",30,70,4)
else
--game--
camera(cx,cy)
cls()
map(mx,my)
spr(1,player.x,player.y)
spr(2,px,py)
rectfill(cx+0,cy+51,cx+3,cy+81,0)
print("t\nu\nr\nn", cx+0, cy+52, tr)
print(turn,cx+0,cy+76,tr+8)
rectfill(cx+124,cy+34,cx+127,cy+94,0)
print("r\no\nt\na\nt\ni\no\nn",cx+125,cy+35,cr)
print(rotation,cx+125,cy+83,cr+8)
print(max_rotation,cx+125,cy+89,cr+8)
--deuging
-- print(mget(px\8,py\8),cx+0,cy+0)
-- print(player.x)
-- print(player.y)
end
end
end
end
| 1,289 | 4,098 | true | true | true | false | [
15,
0,
15,
0,
15,
0,
15,
0,
15,
0,
15,
0,
15,
0,
15,
0,
4,
14,
14,
14,
14,
14,
14,
14,
14,
14,
14,
14,
14,
14,
14,
14,
14,
4,
15,
14,
14,
14,
14,
16,
14,
14,
14,
14,
16,
14,
14,
14,
14,
15,
20,
17,
14,
14,
14... | [
0,
0,
0,
0,
0,
2,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
4,
8,
0,
0,
0,
2,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
4,
8,
0,
0,
0,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
4,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | 000000005c5c5c5c0000000033bbbb3322222222bbbbbbbb33333333333333335d5555550000000000000000000000000000000000000000888888a877777777
00000000c0000005001991003bbbbbb322222222bbbbbbbb33333333333333335555d55d0000000000000000000000000000000000000000a888988877777777
007007005000000c00922900bbbbbbbb22222222bbbbbbbb333333333333333355555555000000000000000000000000000000000000000089a8889877777777
00077000c000000500922900bbbbbbbb22222222bbbbbbbb33333333333333335d5555d50000000000000000000000000000000000000000a888988877777777
000770005000000c0a9999a0bbbbbbbb22222222bbbbbbbb333333333333333355555d5500000000000000000000000000000000000000008988889877777777
00700700c00000050a9999a03bbbbbb322222222bbbbbbbb3333333333333333555555550000000000000000000000000000000000000000888a888a77777777
000000005000000c0090090033bbbb3322222222bbbbbbbb33333333333333335d5d55550000000000000000000000000000000000000000a898988977777777
00000000c5c5c5c5009009005555555555555555555555555555555533333333555555d5000000000000000000000000000000000000000088a8889877777777
3366633399999999999999990000000022222222bbbbbbbb00000000000000000000000000000000000000000000000000000000000000005955555500000000
3633363399766799996dd6990000000022222222bbbbbbbb00000000000000000000000000000000000000000000000000000000000000005555955900000000
333336339765567996d55d690000000022222222bbbbbbbb00000000000000000000000000000000000000000000000000000000000000005555555500000000
33336333965445699d5005d90000000022222222bbbbbbbb00000000000000000000000000000000000000000000000000000000000000005955559500000000
33363333965445699d5005d90000000022222222bbbbbbbb00000000000000000000000000000000000000000000000000000000000000005555595500000000
333333339765567996d55d690000000022222222bbbbbbbb00000000000000000000000000000000000000000000000000000000000000005555555500000000
3336333399766799996dd6990000000022222222bbbbbbbb00000000000000000000000000000000000000000000000000000000000000005959555500000000
5555555599999999999999990000000022222222bbbbbbbb00000000000000000000000000000000000000000000000000000000000000005555559500000000
33666333555555555555555500000000000000005b55555500000000000000000000000000000000000000000000000000000000000000000000000000000000
3633363355766755556dd65500000000000000005555b55b00000000000000000000000000000000000000000000000000000000000000000000000000000000
333336335765567556d55d6500000000000000005555555500000000000000000000000000000000000000000000000000000000000000000000000000000000
33336333565995655d5005d500000000000000005b5555b500000000000000000000000000000000000000000000000000000000000000000000000000000000
33363333565995655d5005d5000000000000000055555b5500000000000000000000000000000000000000000000000000000000000000000000000000000000
333333335765567556d55d7500000000000000005555555500000000000000000000000000000000000000000000000000000000000000000000000000000000
3336333355766755556dd65500000000000000005b5b555500000000000000000000000000000000000000000000000000000000000000000000000000000000
3333333355555555555555550000000000000000555555b500000000000000000000000000000000000000000000000000000000000000000000000000000000
5566d5d5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
5d555655000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
55555d55000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
5555655d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
d55d5555000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
55555d55000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
55565555000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
5d55555d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 | 010400001727017270001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000000
910800000c3701837024370303703c370003000030000300003000030000300003000030000300003000030000300003000030000300003000000000000000000000000000000000000000000000000000000000
010a0000187400e740007000070000700007000070000700007000070000700007000070000700007000070000700007000070000700007000070000700007000070000700007000000000000000000000000000
010a0000247401a740007000070000700007000070000700007000070000700007000070000700007000070000700007000070000700007000070000700007000070000700007000000000000000000000000000
91080000100401c040280403404000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
011000000c0400e040100401304015040180401a0401c0401f040210402404026040280402b0402d0403004032040340403704039040000000000000000000000000000000000000000000000000000000000000 | |||||
zuyenusaji-0 | St. Patrick's Day Block Buster | gelliotcrane | [
"breakout"
] | 0 | 1 | 2026-03-17 20:02:16 | 2026-03-17 20:02:16 | CC4-BY-NC-SA | 155,666 | https://www.lexaloffle.com/bbs/?tid=155666 | --goals
--5.different bricks
-- hardened brick
-- indestructable brick
-- exploding brick
-- powerup brick
--6.(powerups) maybe
--7.juicyness
-- particles
-- screenshake
-- text blinking
-- arrow aim
--8.high score
function _init()
poke(0x5f2e,1)
pal({[0]=0,1,2,3,4,5,6,7,8,9,-6,11,12,13,14,15},1)
cls()
frame=48
mode="start"
level=""
debug=""
levelnum=1
levels={}
levels[1]="xb7bxxb7bxxb7bx"
levels[2]="xb7bxxb7bxxb7bxxb7bxxb7bx"
levels[3]="xxb5bxxxxb5bxxxxb5bxxxxb5bxxxxb5bxxxxb5bxxxxb5bxx"
end
function _update60()
if mode=="game" then
update_game()
elseif mode=="start" then
update_start()
elseif mode=="gameover" then
update_gameover()
elseif mode=="levelover" then
update_levelover()
end
end
function update_start()
frame+=0.30
if frame>53.9 then
frame=48
end
if btnp(❎) then
startgame()
end
end
function startgame()
pad_x=52
pad_y=120
pad_dx=0
pad_w=24
pad_h=3
pad_c=3
brick_w=9
brick_h=4
levelnum=1
level=levels[levelnum]
buildbricks(level)
-- brick_y=20
lives=3
points=0
mode="game"
sticky=true
chain=1 --combo chain
serveball()
end
function nextlevel()
mode="game"
pad_x=52
pad_y=120
pad_dx=0
levelnum+=1
if levelnum>#levels then
--we've beaten the game
--we need some kind of special
--screen here
mode="start"
return
end
level=levels[levelnum]
buildbricks(level)
sticky=true
chain=1
serveball()
end
function buildbricks(lvl)
local i,j,o,char,last
brick_x={}
brick_y={}
brick_v={}
brick_t={}
j=0
--b = normal brick
--x = empty slot
--i = indestructable brick
--h = hard brick
--s = sploding brick
--p = powerup brick
for i=1,#lvl do
j+=1
char=sub(lvl,i,i)
if char=="b"
or char=="i"
or char=="h"
or char=="s"
or char=="p" then
last=char
addbrick(j,char)
elseif char=="x" then
last="x"
elseif char=="/" then
j=(flr((j-1)/11)+1)*11
elseif char>="1" and char<="9" then
debug=char
for o=1,char+0 do
if last=="b"
or last=="i"
or last=="h"
or last=="s"
or last=="p" then
addbrick(j,last)
elseif last=="x" then
--nothing
end
j+=1
end
j-=1
end
end
end
function addbrick(_i,_t)
add(brick_x,4+((_i-1)%11)*(brick_w+2))
add(brick_y,20+flr((_i-1)/11)*(brick_h+2))
add(brick_v,true)
add(brick_t,_t)
end
function levelfinished()
if #brick_v == 0 then return true end
for i=1,#brick_v do
if brick_v[i] == true and brick_t[i] != "i" then
return false
end
end
return true
end
function serveball()
ball_r=2
ball_x=pad_x+flr(pad_w/2)
ball_y=pad_y-ball_r
ball_dx=1
ball_dy=-1
ball_dr=0.5
ball_ang=1
chain=1
sticky=true
end
function setang(ang)
ball_ang=ang
if ang==2 then
ball_dx=0.50*sign(ball_dx)
ball_dy=1.30*sign(ball_dy)
elseif ang==0 then
ball_dx=1.30*sign(ball_dx)
ball_dy=0.50*sign(ball_dy)
else
ball_dx=1*sign(ball_dx)
ball_dy=1*sign(ball_dy)
end
end
function sign(n)
if n<0 then
return -1
elseif n>0 then
return 1
else
return 0
end
end
function gameover()
mode="gameover"
end
function levelover()
mode="levelover"
end
function update_gameover()
if btnp(❎) then
startgame()
end
end
function update_levelover()
if btnp(❎) then
nextlevel()
end
end
function update_game()
local buttpress=false
local nextx,nexty,brickhit
if btn(➡️) then
pad_dx=2.5
buttpress=true
if sticky then
ball_dx=1
end
end
if btn(⬅️) then
pad_dx=-2.5
buttpress=true
if sticky then
ball_dx=-1
end
end
if sticky and btnp(❎) then
sticky=false
end
if not (buttpress) then
pad_dx=pad_dx/1.4
end
pad_x+=pad_dx
pad_x=mid(0,pad_x,127-pad_w)
if sticky then
ball_x=pad_x+flr(pad_w/2)
ball_y=pad_y-ball_r-1
else
--regular ball physics
nextx=ball_x+ball_dx
nexty=ball_y+ball_dy
if nextx>127 or nextx<0 then
nextx=mid(0,nextx,127)
ball_dx=-ball_dx
sfx(0)
end
if nexty<10 then
nexty=mid(0,nexty,127)
ball_dy=-ball_dy
sfx(0)
end
--check if ball hits pad
if ball_box(nextx,nexty,pad_x,pad_y,pad_w,pad_h) then
--deal with collision
--find out dir
if deflx_ballbox(ball_x,ball_y,ball_dx,ball_dy,pad_x,pad_y,pad_w,pad_h) then
--ball hit paddle on side
ball_dx=-ball_dx
if ball_x<pad_x+pad_w/2 then
nextx=pad_x-ball_r
else
nextx=pad_x+pad_w+ball_r
end
else
--ball hit paddle on top/btm
ball_dy=-ball_dy
if ball_y>pad_y then
--btm
nexty=pad_y+pad_h+ball_r
else
--top
nexty=pad_y-ball_r
if abs(pad_dx)>2 then
--change angle
if sign(pad_dx)==sign(ball_dx) then
--flatten angle
setang(mid(0,ball_ang-1,2))
else
--raise angle
if ball_ang==2 then
ball_dx=-ball_dx
else
setang(mid(0,ball_ang+1,2))
end
end
end
end
end
sfx(1)
chain=1
end
brickhit=false
for i=1,#brick_x do
--check if ball hits brick
if brick_v[i] and ball_box(nextx,nexty,brick_x[i],brick_y[i],brick_w,brick_h) then
--deal with collision
if not (brickhit) then
if deflx_ballbox(ball_x,ball_y,ball_dx,ball_dy,brick_x[i],brick_y[i],brick_w,brick_h) then
ball_dx=-ball_dx
else
ball_dy=-ball_dy
end
end
brickhit=true
hitbrick(i,true)
end
end
ball_x=nextx
ball_y=nexty
checkexplosions()
if nexty>127 then
sfx(2)
lives-=1
if lives==0 then
mode="gameover"
else
serveball()
end
end
end
if levelfinished() then
_draw()
levelover()
end
end
function hitbrick(_i,_combo)
if brick_t[_i]=="b" then
sfx(2+chain)
brick_v[_i]=false
if _combo then
points+=10*chain
chain+=1
chain=mid(1,chain,7)
end
elseif brick_t[_i]=="i" then
sfx(10)
elseif brick_t[_i]=="h" then
sfx(10)
brick_t[_i]="b"
elseif brick_t[_i]=="p" then
sfx(2+chain)
brick_v[_i]=false
if _combo then
points+=10*chain
chain+=1
chain=mid(1,chain,7)
end
--todo trigger powerup
elseif brick_t[_i]=="s" then
sfx(2+chain)
brick_t[_i]="zz"
if _combo then
points+=10*chain
chain+=1
chain=mid(1,chain,7)
end
end
end
function checkexplosions()
for i=1,#brick_x do
if brick_t[i] =="z" then
explodebrick(i)
end
end
for i=1,#brick_x do
if brick_t[i] =="zz" then
brick_t[i]="z"
end
end
end
function explodebrick(_i)
brick_v[_i]=false
for j=1,#brick_x do
if j!=_i
and brick_v[j]
and abs(brick_x[j]-brick_x[_i]) <= (brick_w+2)
and abs(brick_y[j]-brick_y[_i]) <= (brick_h+2)
then
hitbrick(j,false)
end
end
end
function _draw()
if mode=="game" then
draw_game()
elseif mode=="start" then
draw_start()
elseif mode=="gameover" then
draw_gameover()
elseif mode=="levelover" then
draw_levelover()
end
end
function draw_start()
cls(10)
spr(frame,20,80)
spr(frame,100,80,1,1)
for i=1,4 do
spr(1,i*20+10,10)
end
spr(9,40,50,6,6)
print("\^o5ffhappy st. patrick's day",18,30,9)
spr(5,15,48,2,2,true)
spr(5,95,48,2,2)
rectfill(0,100,128,120,5)
for i=0,5 do
spr(18,i*20+6,102,2,2)
end
print("press ❎ to play a game",17,92,5)
end
function draw_gameover()
rectfill(0,60,128,75,0)
print("game over",46,62,7)
print("press ❎ to restart",27,68,6)
end
function draw_levelover()
rectfill(0,60,128,75,0)
print("stage clear!",46,62,7)
print("press ❎ to continue",27,68,6)
end
function draw_game()
cls(10)
circfill(ball_x,ball_y,ball_r,9)
if sticky then
--serve preview
line(ball_x+ball_dx*4,ball_y+ball_dy*4,ball_x+ball_dx*6,ball_y+ball_dy*6,5)
end
rectfill(pad_x,pad_y,pad_x+pad_w,pad_y+pad_h,pad_c)
--draw bricks
for i=1,#brick_x do
if brick_v[i] then
if brick_t[i]== "b" then
brickcol=3
elseif brick_t[i]== "i" then
brickcol=6
elseif brick_t[i]== "h" then
brickcol=15
elseif brick_t[i]== "s" then
brickcol=9
elseif brick_t[i]== "p" then
brickcol=12
elseif brick_t[i]== "z" or brick_t[i]== "zz" then
brickcol=8
end
rectfill(brick_x[i],brick_y[i],brick_x[i]+brick_w,brick_y[i]+brick_h,brickcol)
end
end
rectfill(0,0,128,6,3)
-- if debug!="" then
-- print(debug,1,1,7)
-- else
print("lives:"..lives,1,1,7)
print("points:"..points,40,1,7)
print("chain:"..chain,100,1,7)
-- end
end
function ball_box(bx,by,box_x,box_y,box_w,box_h)
--checks for collision of ball with rectangle
if by-ball_r>box_y+box_h then return false end
if by+ball_r<box_y then return false end
if bx-ball_r>box_x+box_w then return false end
if bx+ball_r<box_x then return false end
return true
end
function deflx_ballbox(bx,by,bdx,bdy,tx,ty,tw,th)
local slp = bdy / bdx
local cx, cy
if bdx == 0 then
return false
elseif bdy == 0 then
return true
elseif slp > 0 and bdx > 0 then
cx = tx-bx
cy = ty-by
return cx>0 and cy/cx <slp
elseif slp < 0 and bdx > 0 then
cx = tx-bx
cy = ty+th-by
return cx>0 and cy/cx >= slp
elseif slp > 0 and bdx < 0 then
cx = tx+tw-bx
cy = ty+th-by
return cx <0 and cy/cx <= slp
else
cx=tx+tw-bx
cy=ty-by
return cx<0 and cy/cx >= slp
end
end | 2,288 | 9,068 | true | true | true | false | Not supported with pagination yet | [] | [] | 00000000005550000000000000000000000000000000000000000000000000000000000033333333333333337777777777777777999999999999999900000000
00000000005550000000000000000000000000000000fffffff00000000000000000000033333333333333337777777777777777999999999999999900000000
0070070055050550000000000000000000000000000fffffffff0000000000000000000033333333333333337777777777777777999999999999999900000000
0007700055555550000000000000000000000000000fff4444ff0000000000000000000033333333333333337777777777777777999999999999999900000000
0007700055050550000000000000000000000000000f4f44444f0000000000000000000033333333333333337777777777777777999999999999999900000000
0070070000050000000000000000000000000000000f444444400000000000000000000033333333333333337777777777777777999999999999999900000000
0000000000005000000000000000000000000000000044f444477700000000000000000033333333333333337777777777777777999999999999999900000000
00000000000000000000000000000000000000000000444444400700000000000000000033333333333333337777777777777777999999999999999900000000
00000000000000000009990000999000000000000000444444400700000000000000000033333333333333337777777777777777999999999999999900000000
0000000000000000009000900900090000000000000044444f400700000000000000000033333333333333337777777777777777999999999999999900000000
00000000000000000090004009000400000000000000444444407000000000000000000033333333333333337777777777777777999999999999999900000000
00000000000000000494999949499990000000000000444444470000000000000000000033333333333333337777777777777777999999999999999900000000
00000000000000009090004009000409000000000000444444400000000000000000000033333333333333337777777777777777999999999999999900000000
000000000000000090900090090009090000000000004f4444400000000000000000000033333333333333337777777777777777999999999999999900000000
00000000000000009040009009000909000000000000444444400000000000000000000033333333333333337777777777777777999999999999999900000000
00000000000000000999990000994940000000000000777777700000000000000000000033333333333333337777777777777777999999999999999900000000
00000000000000000040000000000400000000000000000000000000000000000000000033333333333333337777777777777777999999999999999900000000
00000000000000000494990000999990000000000000000000000000000000000000000033333333333333337777777777777777999999999999999900000000
00000000000000009090009009000409000000000000000000000000000000000000000033333333333333337777777777777777999999999999999900000000
00000000000000009090009009000909000000000000000000000000000000000000000033333333333333337777777777777777999999999999999900000000
00000000000000009040009004000909000000000000000000000000000000000000000033333333333333337777777777777777999999999999999900000000
00000000000000000999949499994940000000000000000000000000000000000000000033333333333333337777777777777777999999999999999900000000
00000000000000000040009004000900000000000000000000000000000000000000000033333333333333337777777777777777999999999999999900000000
00000000000000000009990000999000000000000000000000000000000000000000000033333333333333337777777777777777999999999999999900000000
05000000053000000537000005077000050079000500099000000000000000000000000033333333333333337777777777777777999999999999999900000000
03377990033779900337799003377990033779900337799000000000000000000000000033333333333333337777777777777777999999999999999900000000
03377990033779900337799003377990033779900337799000000000000000000000000033333333333333337777777777777777999999999999999900000000
03377990033779900337799003377990033779900337799000000000000000000000000033333333333333337777777777777777999999999999999900000000
03377990030779900300799003300990033700900337700000000000000000000000000033333333333333337777777777777777999999999999999900000000
05000000050000000500000005000000050000000500000000000000000000000000000033333333333333337777777777777777999999999999999900000000
05000000050000000500000005000000050000000500000000000000000000000000000033333333333333337777777777777777999999999999999900000000
05000000050000000500000005000000050000000500000000000000000000000000000033333333333333337777777777777777999999999999999900000000 | 000100001852018520185201852018520185101950015500125000f5000d5000b500095000950016500145001850018500185001850018500185002c5002f5003150031500305002b50025500005000050000500
000400002452024520245202452024520245101c5001c500205000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500
080600001c532195321753215532115320f5320b5320853203532005320c502015320153201532015220151201502005020d50200502005020050200502005020050200502005020050200502005020050200002
000300002d040300403004030030300000d6000b600096000760004600006000e6000d6000a600076000660003600026000060000600006000060000600006000060000600006000060000600006000000000000
000300002f040320403204032030320000d0000b000090000700004000000000e0000d0000a000070000600003000020000000000000000000000000000000000000000000000000000000000000000000000000
0003000030040330403304033030330000d0000b000090000700004000000000e0000d0000a000070000600003000020000000000000000000000000000000000000000000000000000000000000000000000000
0003000031040340403404034030340000d0000b000090000700004000000000e0000d0000a000070000600003000020000000000000000000000000000000000000000000000000000000000000000000000000
0003000033040360403604036030360000d0000b000090000700004000000000e0000d0000a000070000600003000020000000000000000000000000000000000000000000000000000000000000000000000000
0003000035040380403804038030380000d0000b000090000700004000000000e0000d0000a000070000600003000020000000000000000000000000000000000000000000000000000000000000000000000000
00030000370403a0403a0403a0303a0000d0000b000090000700004000000000e0000d0000a000070000600003000020000000000000000000000000000000000000000000000000000000000000000000000000
000200003955335553355433552321503225032550326503295032b5032d5032f50330503325033450335503355033550334503315032c5032a50326503005030050300503005030050300503005030050300503 | ||||
speechsynth_v0_3_1-0 | Speech Synthesis Test v0.3.1 | Nour Ramy | [] | 0 | 2 | 2026-03-17 19:21:50 | 2026-03-17 19:32:10 | 155,664 | https://www.lexaloffle.com/bbs/?tid=155664 | -- speech synthesis (ver 3)
-- author: nour ramy
-- init function
function _init()
init = 3
i = 0
words = {"wELCOME TO pICO-8!","pICO-8","THE sTARTUP mELODY"}
col = 7
rcol = 0
end
function scrollval(mini,maxi,val)
val += 1
if (val > maxi) then val = mini end
if (val < mini) then val = maxi end
return val
end
-->8
-- update function
function _update()
if init > 1 then
init -= 1
elseif init == 1 then
init = 0
sfx(2,1)
end
if btnp(🅾️) then
sfx(i,0)
end
if btnp(❎) then
sfx(-1,0)
end
if btnp(⬅️) then
i -= 1
i %= 64
end
if btnp(➡️) then
i += 1
i %= 64
end
if btnp(⬆️) then
i = 63
end
if btnp(⬇️) then
i = 0
end
end
-->8
-- draw function
function _draw()
rcol += 1
rcol %= 5
if rcol == 4 then
col = scrollval(8,15,col)
end
cls(1)
spr(1,0,0)
print("pICO-8 sPEECH sYNTHESIS tEST",8,1,6)
print("vER. 0.3",8,7,col)
if words[i+1] != nil then
if i+1 != 3 then
print("🅾️ TO SAY:",44,32,7)
print(words[i+1],32,60,7)
else
print("🅾️ TO PLAY:",44,32,7)
print(words[i+1],32,60,7)
end
else
print("cOMING sOON:",38,32,7)
print("sfx "..(i+1),48,60,7)
end
print("cURRENT sfx: sfx #"..(i+1),28,90,12)
if btn(⬅️) then
spr(4,10,60)
else
spr(2,10,60)
end
if btn(➡️) then
spr(5,109,60)
else
spr(3,109,60)
end
if btn(⬆️) then
spr(9,100,119)
spr(12,82,119)
else
spr(7,100,119)
spr(10,82,119)
end
if btn(⬇️) then
spr(8,19,119)
spr(13,37,119)
else
spr(6,19,119)
spr(11,37,119)
end
end | 487 | 1,483 | true | true | true | false | Not supported with pagination yet | [] | [] | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000008000000060000000060000000000000000000000606000060600000000000000000000000000000000000000000000000000000cccc0000000000
007007000097f0000066000000006600000b00000000b0000066060000606600000b0b0000b0b0000006000006666600000000000000000000c00c0000000000
000770000a777e00066600000000666000bb00000000bb00066606000060666000bb0b0000b0bb000066600005666500000b00000bbbbb0000c00c0000000000
0007700000b7d00005660000000066500bbb00000000bbb005660600006066500bbb0b0000b0bbb0066666000056500000bbb00000bbb0000cc0cc0000000000
00700700000c0000005600000000650000bb00000000bb00005606000060650000bb0b0000b0bb0005555500000500000bbbbb00000b00000cc0cc0000000000
00000000000000000005000000005000000b00000000b0000005050000505000000b0b0000b0b000000000000000000000000000000000000000000000000000 | 010700001a2511c2411c5511c45100000000001c45000000000001f450232510d4510000000000184502425100000000000000000000000000000000000000000000000000000000000000000000000000000000
011000001c0551805000000000001d055000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
01100000180501a0501c0501d0501f050210502305024050185501a5501c5501d5501f550215502355024550187501a7501c7501d7501f750217502375024750181501a1501c1501d1501f150211502315024150 | |||||
speechsynth_v0_4-0 | Speech Synthesis Test v0.4 | Nour Ramy | [] | 0 | 1 | 2026-03-17 19:00:58 | 2026-03-17 19:00:58 | CC4-BY-NC-SA | 155,663 | https://www.lexaloffle.com/bbs/?tid=155663 | -- pico-8 speech synthesis test
-- by: nour r.
-- init function
function _init()
init = 3
i = 0
words = {"wELCOME TO pICO-8!","pICO-8","THE sTARTUP mELODY","wELCOME TO pICO-8!\n(REVISED)","uP FOR DRUM"}
col = 7
rcol = 0
end
function scrollval(mini,maxi,val)
val += 1
if (val > maxi) then val = mini end
if (val < mini) then val = maxi end
return val
end
-->8
-- update function
function _update()
if init > 1 then
init -= 1
elseif init == 1 then
init = 0
sfx(2,1)
end
if btnp(🅾️) then
sfx(i,0)
end
if btnp(❎) then
sfx(-1,0)
end
if btnp(⬅️) then
i -= 1
i %= 64
end
if btnp(➡️) then
i += 1
i %= 64
end
if btnp(⬆️) then
i = 63
end
if btnp(⬇️) then
i = 0
end
end
-->8
-- draw function
function _draw()
rcol += 1
rcol %= 5
if rcol == 4 then
col = scrollval(8,15,col)
end
cls(1)
spr(1,0,0)
print("pICO-8 sPEECH sYNTHESIS tEST",8,1,6)
print("vER. 0.4",8,7,col)
if words[i+1] != nil then
if i+1 != 3 then
print("🅾️ TO SAY:",44,32,7)
print(words[i+1],32,60,7)
else
print("🅾️ TO PLAY:",44,32,7)
print(words[i+1],32,60,7)
end
else
print("cOMING sOON:",38,32,7)
print("sfx "..(i+1),48,60,7)
end
print("cURRENT sfx: sfx #"..(i+1),28,90,12)
if btn(⬅️) then
spr(4,10,60)
else
spr(2,10,60)
end
if btn(➡️) then
spr(5,109,60)
else
spr(3,109,60)
end
if btn(⬆️) then
spr(9,100,119)
spr(12,82,119)
else
spr(7,100,119)
spr(10,82,119)
end
if btn(⬇️) then
spr(8,19,119)
spr(13,37,119)
else
spr(6,19,119)
spr(11,37,119)
end
end | 491 | 1,527 | true | true | true | false | Not supported with pagination yet | [] | [] | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000008000000060000000060000000000000000000000606000060600000000000000000000000000000000000000000000000000000cccc0000000000
007007000097f0000066000000006600000b00000000b0000066060000606600000b0b0000b0b0000006000006666600000000000000000000c00c0000000000
000770000a777e00066600000000666000bb00000000bb00066606000060666000bb0b0000b0bb000066600005666500000b00000bbbbb0000c00c0000000000
0007700000b7d00005660000000066500bbb00000000bbb005660600006066500bbb0b0000b0bbb0066666000056500000bbb00000bbb0000cc0cc0000000000
00700700000c0000005600000000650000bb00000000bb00005606000060650000bb0b0000b0bb0005555500000500000bbbbb00000b00000cc0cc0000000000
00000000000000000005000000005000000b00000000b0000005050000505000000b0b0000b0b000000000000000000000000000000000000000000000000000 | 010700001a2511c2411c5511c45100000000001c45000000000001f450232510d4510000000000184502425100000000000000000000000000000000000000000000000000000000000000000000000000000000
011000001c0551805000000000001d055000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
01100000180501a0501c0501d0501f050210502305024050185501a5501c5501d5501f550215502355024550187501a7501c7501d7501f750217502375024750181501a1501c1501d1501f150211502315024150
010700001a2511c251162511845024250000000000018450000000000024150241501845000000000002326023260000000000000000000000000000000000000000000000000000000000000000000000000000
010700001a25000000000001f2501a55000000000000f450242501755000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 | ||||
myregularshmup-2 | myregularshmup | waibiwaibi | [] | 1 | 3 | 2026-03-17 18:54:34 | 2026-03-17 19:49:12 | CC4-BY-NC-SA | 155,662 | https://www.lexaloffle.com/bbs/?tid=155662 | --press f for mirror the sprite
--press f9 to shot a gif for 9s
--for i=a,b,c do..end (i+=c)
--start / game / over / level
--object: star={x=40,y=60,spd=1}
--star.x ➡️ 40 // by reference
--use music(-1,t) to shut m in t
--when ctrl+f,use ctrl+g/h to the next/page
--rnd(table) choose from table
--to do list: enemy bullet
--spawn logic,enemy behavior
--[[
tips for musics
til now some muc effect are
lack. and some are list here
★08 thym music(use in the start?
★?? gingle win (level finish)
★?? game win music (for once)
★?? gameover gingle
]]--
function _init() --once
cls(0)
start_screen()
--contorl the blink
blinkt = 0
--control the level of game
level = 1
--control time of level mode
timer = 0
--a new logic to make starsfield
--for pause in special time
pt = 0
--couting frames
t=0
end
function _update()
if mode=="game" then
update_game()
elseif mode=="start" then
update_start()
elseif mode=="level" then
update_level()
elseif mode=="over" then
update_over()
elseif mode=="win" then
update_win()
end
end
function _draw()
if mode=="game" then
draw_game()
elseif mode=="start" then
draw_start()
elseif mode=="level" then
draw_level()
elseif mode=="over" then
draw_over()
elseif mode=="win" then
draw_win()
end
end
function start_screen()
mode = "start"
level = 1
pt=0
music(8)
--sfx(6)
end
function start_init()
music(-1,1000)
t=0
ship = fundspr()
ship.x = 64
ship.y = 64
--for drawing the ship
ship.spr = 2
ship.invincible = 0
--the speed of ship
ship.sx = 0
ship.sy = 0
ship.hitbox[4] = 6
--the position of bullet
bullets = {}
bul_cd = 0
--enemies' bullet
enbullets = {}
--create enemies
enemies = {}
--create explotions
--explods = {} now not use it
circles = {}
shwaves = {} --a shrink circle
--create particals
particles = {} --for explods
--for drawing the flame
flame_spr = 5
--for drawing a muzzle
muzzle = 0
--numbers
score = 0
--string--nil
string = "very ".."good"
--heart
lifes = 4
--bombs
bombs = 3
--backgroud stars
stars = {}
for i = 1,100 do
local newstar = {}
newstar.x = flr(rnd(128))
newstar.y = flr(rnd(128))
newstar.spd = rnd(1.5)+0.5
add(stars,newstar)
end
end
-->8
--background / tools
--flr() rnd()
--table a={1,2,3} ➡️ a[1]=1
--#a = 3 ➡️ use # to get the num
--add(a,sth.) / del(a,sth.)
--[[deli(a,n) can be used to del
the certain num of a table]]--
--[[ press alt+⬇️/⬆️ to swift
between functions ]]--
function starfield()
for i=1,#stars do
--sc is the stars' color
local sc=7
local astar = stars[i]
if astar.spd<1.1 then
sc = 1
elseif astar.spd<1.8 then
sc = 5
else
--draw lines for fast stars
line(astar.x,astar.y,astar.x,astar.y-7,1)
line(astar.x,astar.y,astar.x,astar.y-4,13)
line(astar.x,astar.y,astar.x,astar.y-2,6)
end
--set a point
pset(astar.x,astar.y,sc)
end
end
function animatestars()
for i=1,#stars do
--objects change togeter
local astar=stars[i]
--move stars
astar.y += astar.spd
if astar.y > 128 then
astar.y = 0
astar.x = flr(rnd(128))
astar.spd = rnd(1.5)+0.5
end
end
end
--blink the text/ return a num
--creat a table to animate
function blink()
local c = {5,5,5,5,5,5,5,5,5,5,6,6,6,7,7,6,6,6,5}
blinkt += 1
if blinkt>#c then
blinkt=1
end
return c[blinkt]
end
function blink2()
local c = {8,9,10,11,12,13,14,15,0}
blinkt += 1
if blinkt>#c then
blinkt=1
end
return c[blinkt]
end
--dwar objects
function drawaspr(aspr)
if aspr.size==nil then
spr(aspr.spr,aspr.x,aspr.y)
else
spr(aspr.spr,aspr.x,aspr.y,aspr.size[1],aspr.size[2])
end
end
--animate objects in loop
function aniloop(obj,f1,f2,speed)
obj.spr += speed
if obj.spr>=f2 then
obj.spr=f1
end
end
--detect collision
function col(a,b)
--lots of math
local a_left = a.x+a.hitbox[1]
local a_top = a.y+a.hitbox[3]
local a_right = a.x+a.hitbox[2]
local a_bottom = a.y+a.hitbox[4]
local b_left = b.x+b.hitbox[1]
local b_right = b.x+b.hitbox[2]
local b_top = b.y+b.hitbox[3]
local b_bottom = b.y+b.hitbox[4]
if a_top>b_bottom then return false end
if b_top>a_bottom then return false end
if a_left>b_right then return false end
if b_left>a_right then return false end
return true
end
--draw an outline for spr with
--given colors
function outline(obj,c)
for i = 1,15 do
--change all color
pal(i,c)
end
--draw 4 spr aroud the one
for dx=-1,1 do
for dy=-1,1 do
spr(obj.spr,obj.x+dx,obj.y+dy)
end
end
pal()
end
--get scores
function getscore(obj)
score += obj.type
end
--create some explotioms/ particles
function explode(x,y,t)
--t can be "en1" "ship"
--local anex={}
--anex.x = x-4
--anex.y = y-4
--anex.time=0
--add(explods,anex)
local ap={}
ap.x = x
ap.y = y
ap.type = t
ap.sx = 0
ap.sy = 0
ap.age = 0
ap.size = 10
ap.c = 7 --color
ap.maxage= 0
add(particles,ap)
for i=1,20 do
local ap={}
ap.x = x
ap.y = y
ap.type = t
local s1= rnd()-0.5
local s2= rnd()-0.5
ap.sx = 6*s1
ap.sy = 6*s2
ap.age = rnd(2)
ap.size = 1+rnd(4)
ap.c = 7 --color
ap.maxage= 10+rnd(10)
add(particles,ap)
end
--add sparks
for i=1,5+flr(rnd(10)) do
local ap={}
ap.x = x
ap.y = y
ap.type = "spark"
local s1= rnd()-0.5
local s2= rnd()-0.5
ap.sx = 10*s1
ap.sy = 10*s2
ap.age = rnd(2)
ap.size = rnd(2)
ap.c = 7 --color
ap.maxage= 10+rnd(10)
add(particles,ap)
end
end
--give particles color
function paintp(ap)
local pc={5,2,8,9,10}
if ap.type=="en1" then
pc={5,2,8,9,10,7}
elseif ap.type=="ship" then
pc={1,1,13,12,6,7}
end
ap.c = pc[6]
if ap.age>15 then
ap.c = pc[1]
elseif ap.age>12 then
ap.c = pc[2]
elseif ap.age>10 then
ap.c = pc[3]
elseif ap.age>7 then
ap.c = pc[4]
elseif ap.age>5 then
ap.c = pc[5]
end
end
--create an expanding cirle
function circle(x,y,size,c)
local acir={}
acir.x=x
acir.y=y
acir.c=c
acir.size=size
acir.spd = 0
add(circles,acir)
end
--create a shrinking circle
function shwave(x,y,maxr,spd,c)
local asw={}
asw.x = x
asw.y = y
asw.r = 2
asw.maxr = maxr
asw.spd = spd
asw.c = c
add(shwaves,asw)
end
--create a single spark behind enemy
function gethit(x,y,c)
local ap={}
local s1= rnd()-0.5
local s2= rnd()-1
ap.x = x+s1
ap.y = y+s2
ap.type = "spark"
ap.sx = 6*s1
ap.sy = 5*s2
ap.age = rnd(2)
ap.size = rnd(2)
ap.c = c --color
ap.maxage= 10+rnd(10)
add(particles,ap)
end
--write fundimental elements
--in creating a spr
function fundspr()
local newspr={}
newspr.x = 0
newspr.y = 0
newspr.sx= 0
newspr.sy= 0
--left1,right2,top3,bottom4
newspr.hitbox={0,7,0,7}
newspr.spr = 0
newspr.size= {1,1}
newspr.invincible = 0
newspr.flag=false
newspr.shake=0
return newspr
end
-->8
--_update
function update_game() --gamepley 1
t += 1
--[[
if flr(rnd(30-t/200))==5 then
spawnen()
end
]]--
--pt is for pause
if pt>t then return end
--controls
ship.sx = 0
ship.sy = 0
ship.spr= 2
if btn(0) then
ship.sx = -2
ship.spr = 1
end
if btn(1) then
ship.sx = 2
ship.spr = 3
end
if btn(2) then
ship.sy = -2
end
if btn(3) then
ship.sy = 2
end
--for test
if btnp(4) then mode="over" end
--btnp() activate once push
if bul_cd > 0 then
bul_cd -= 1
elseif btn(5) then
local abullet=fundspr()
abullet.x=ship.x
abullet.y=ship.y-3
abullet.spr=16
add(bullets,abullet)
sfx(0)
--create a muzzle
muzzle = 5
bul_cd = 3
end
--moving the ship
ship.x += ship.sx
ship.y += ship.sy
--moving/animate the bullet
for i = #bullets,1,-1 do
local abullet = bullets[i]
abullet.y += -4
aniloop(abullet,16,20,0.25)
if abullet.y<-20 then
deli(bullets,i)
end
end
--move/animate enemies
for anen in all(enemies) do
--anen.y += 0.25
--enemy mission or behavior
doenemy(anen)
--animate enemies
local a=enspr(anen)
if anen.size==nil then
aniloop(anen,a,a+#anen.ani-1,0.25)
else local aniz=1+flr((t/4)%(#anen.ani-1))
anen.spr=anen.ani[aniz]
end
--kill enemy when leave screen
if anen.y>128 then
local entype=anen.type
del(enemies,anen)
--one down one up
--◆spawnen(entype)
end
end
--collision ship & enemies
if ship.invincible <= 0 then
for anen in all(enemies) do
if col(anen,ship) then
lifes -= 1
--pause for 4 fps
pt = t+10
sfx(1)
circle(ship.x+2,ship.y+2,0,6)
circle(ship.x+2,ship.y+2,1,12)
explode(ship.x+4,ship.y+4,"ship")
anen.invincible = 3
anen.lifes -= 4
if anen.lifes<=0 then
del(enemies,anen)
--one down one up
sfx(4)
end
ship.invincible = 20
end
end
else
ship.invincible -= 1
end
--collision bullets & enemies
for abullet in all(bullets) do
for anen in all(enemies) do
if col(abullet,anen) and anen.flag==false then
anen.lifes -= 1
anen.invincible = 3
sfx(2)
del(bullets,abullet)
shwave(abullet.x+4,abullet.y+4,5,1,9)
gethit(abullet.x+4,abullet.y,7)
if anen.lifes <=0 then
shwave(abullet.x+4,abullet.y+4,18,6,7)
killen(anen)
end
end
end
end
--check if ship hits edge
if ship.x >120 then
ship.x = 120
end
if ship.x<0 then
ship.x = 0
end
if ship.y > 120 then
ship.y = 120
end
if ship.y<0 then
ship.y = 0
end
picking()
--animate the flame
flame_spr += 1
if flame_spr==10 then
flame_spr = 5
end
--animate muzzle
if muzzle>0 then
muzzle -= 1
end
--animate the background stars
animatestars()
--game over
if lifes<=0 then
mode="over"
timer=20
--music(??)
end
--next level
if #enemies==0 and timer<0 then
nextlevel()
end
end
-------------------------------
function update_start()
timer = 48
--use btnp more
if btnp(5) or btnp(4) then
mode="level"
start_init()
--music(0)
end
end
-------------------------------
function update_level()
update_game()
timer -= 1
if timer < 0 then
spawnwave()
mode="game"
end
end
-------------------------------
function update_over()
--use btnp more
timer -= 1
if timer < 0 then
if btnp(5) or btnp(4) then
start_screen()
end
end
end
-------------------------------
function update_win()
--use btnp more
if btn(4)==false and btn(5)==false then
btnreleased=true
end
timer -= 1
if timer < 0 and btnreleased then
if btnp(5) or btnp(4) then
start_screen() --level=1
btnreleased=false
end
end
end
-->8
--_draw()
function draw_game()
cls(0)
--draw a backgruond
starfield()
--draw all particles
for ap in all(particles) do
--change the color
if ap.type=="spark" then
circfill(ap.x,ap.y,ap.size,ap.c)
else
paintp(ap)
circfill(ap.x,ap.y,ap.size,ap.c)
end
ap.x += ap.sx
ap.y += ap.sy
ap.sx = ap.sx*0.85
ap.sy = ap.sy*0.85
ap.age += 1
if ap.age>ap.maxage then
ap.size -= 0.5
if ap.size<0 then
del(particles,ap)
end
end
end
--draw circles
for acir in all(circles) do
circ(acir.x,acir.y,acir.size,acir.c)
acir.spd += 1
acir.size+=acir.spd
if acir.size>128 then
del(circles,acir)
end
end
--draw shrinking waves(circle)
--after draw enemies
--this draws the ship
--[[
if ship.invincible>0 then
outline(ship,blink2())
end
if ship.invincible<15 then
drawaspr(ship)
end
--flames
spr(flame_spr,ship.x,ship.y+8)
]]--
if ship.invincible<=0 then
drawaspr(ship)
spr(flame_spr,ship.x,ship.y+8)
elseif sin(t/6)<0 then
drawaspr(ship)
spr(flame_spr,ship.x,ship.y+8)
end
--this draws the bullet
for i=1,#bullets do
local abullet=bullets[i]
drawaspr(abullet)
--spr(bul_spr,abullet.x,abullet.y)
end
--draw a muzzle circle explotion
if muzzle>0 then
if ship_spr==1 then
circfill(ship.x+3,ship.y-1,muzzle,7)
elseif ship_spr==3 then
circfill(ship.x+4,ship.y-1,muzzle,7)
else
circfill(ship.x+3,ship.y-1,muzzle,7)
circfill(ship.x+4,ship.y-1,muzzle,7)
end
end
--draw all explotions
--[[
local exframe={64,64,66,66,68,68,70,70,72,72}
for anex in all(explods) do
anex.time += 1
spr(exframe[anex.time],anex.x,anex.y,2,2)
if anex.time>=#exframe then
del(explods,anex)
end
end
]]--
--draw enemies
for i=1,#enemies do
local anen = enemies[i]
--draw the waiting enemies
if anen.flag then
outline(anen,blink2())
end
drawaspr(anen)
--when being attacked
if anen.invincible>0 then
local s=anen.spr
outline(anen,blink())
drawaspr(anen)
anen.spr = anen.ani[#anen.ani]
drawaspr(anen)
anen.spr=s
anen.invincible -= 1
end
end
--draw shrinking waves(circle)
for asw in all(shwaves) do
circ(asw.x,asw.y,asw.r,asw.c)
asw.r += asw.spd
if asw.spd>1 then
asw.spd -= 1
end
if asw.r>asw.maxr then
del(shwaves,asw)
end
end
--creating the ui
print("score:"..score,45,1,12)
--hearts ui
for i=1,4 do --for loop i+=c
if lifes>=i then
spr(13,i*9-8,1)
else
spr(14,i*9-8,1)
end
end
--bombs ui
for i=1,3 do
if bombs>=i then
spr(29,128-i*9,1)
end
end
end
-------------------------------
function draw_start()
cls(1)
local title="shoot'm up"
local tx=(128-(#title*4))/2
print(title,tx,40,12)
title="press ❎ to start"
tx=(128-(#title*4))/2
print(title,tx,90,blink())
end
-------------------------------
function draw_level()
draw_game()
local title = "level "..level
local tx = (128-(#title*4))/2
print(title,tx,40,blink())
end
-------------------------------
function draw_over()
cls(4)
draw_game()
--print("score:"..score,45,1,blink2())
local title="game over"
local tx=(128-(#title*4))/2
print(title,tx,40,8)
title="press ❎ to continue"
tx=(128-(#title*4))/2
print(title,tx,90,7)
title="score:"..score
tx=(128-(#title*4))/2
print(title,tx,60,blink())
end
-------------------------------
function draw_win()
cls(3)
draw_game()
local title="you win"
local tx=(128-(#title*4))/2
print(title,tx,40,7)
title="press ❎ to continue"
tx=(128-(#title*4))/2
print(title,tx,90,7)
title="score:"..score
tx=(128-(#title*4))/2
print(title,tx,60,blink())
end
-->8
--waves and enemies spawn
function spawnwave()
if level==1 then
--spawnen(1)
attacfreq=60
placens({
{1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1},
{1,2,2,3,1,3,2,2,1}
})
elseif level==2 then
attacfreq=45
placens({
{1,1,0,2,3,2,0,1,1},
{1,1,0,3,3,3,0,1,1},
{1,2,0,3,3,3,0,2,1},
{2,2,0,1,1,1,0,2,2}
})
elseif level==3 then
attacfreq=30
placens({
{0,0,3,0,0,0,3,0,0},
{0,2,2,2,0,2,2,2,0},
{2,3,0,3,2,3,0,3,2},
{2,0,0,0,2,0,0,0,2}
})
elseif level==4 then
attacfreq=30
placens({
{2,3,3,2,0,2,3,3,2},
{3,4,0,3,0,3,4,0,3},
{3,0,0,3,0,3,0,0,3},
{2,3,3,2,0,2,3,3,2}
})
--spawnen(level)
end
end
function placens(types)
for y=1,4 do
for x=1,9 do
if types[y][x] != 0 then
spawnen(types[y][x],x*12,4+12*y)
end
end
end
end
function nextlevel()
level += 1
mode = "level"
timer = 48
if level >=5 then
mode="win"
timer=30
end
end
--create enemies
function spawnen(entype,enx,eny)
local anen=fundspr()
--type is scroe as well
if entype == nil or entype == 1 then
anen.type = 1
else anen.type = entype end
anen.x = enx*1.5-36 -- enx+64-128*rnd() -- rnd(120)
anen.y = eny-55 -- eny -- -10
anen.tx= enx --target x position
anen.ty= eny
anen.hitbox={1,6,1,7}
anen.mission="flyin"
--anen.spr = 21
anen.spr = enspr(anen)
anen.lifes = enlifes(anen)
anen.invincible = 0
add(enemies,anen)
end
--choose spr for enemies
function enspr(en)
if en.type==1 then
en.ani={21,22,23,24,25,26}
return 21
elseif en.type==2 then
en.ani={128,129,130,131,132,133}
return 128
elseif en.type==3 then
en.ani={144,145,146,147,148,149}
return 144
elseif en.type==4 then
en.ani={160,162,68}
en.hitbox={2,13,2,13}
en.size={2,2}
return 160
end
end
--making lifes for enemies
function enlifes(en)
if en.type==1 then
return 3
elseif en.type==2 then
return 5
elseif en.type==3 then
return 3
elseif en.type==4 then
return 3
end
end
--[[
explanation for enemy types
1◆green enemy
2◆red enemy
5◆tech enemy
100◆boss
]]--
--[[
notebooks for create a spr
write a function to create
including:
◆type-subfunction to decide anis,hitedanis etc.
◆score
◆max lives
◆size-{w,h}spr
◆hitbox-{x1,x2,y1,y2}
◆volum/hit volume
and generate
◆spr-exacte aniframe of the spr
◆x,y
◆aniframe-for drawing
]]--
-->8
--behavior
function doenemy(en)
if en.mission=="flyin" then
en.y+=(en.ty-en.y)/8
en.x+=(en.tx-en.x)/8
if abs(en.y-en.ty)<0.1 then
en.y = en.ty
end
if abs(en.x-en.tx)<0.1 then
en.x = en.tx
end
if en.x==en.tx and en.y==en.ty then
en.mission = "stay"
end
elseif en.mission=="stay" then
return
elseif en.mission=="attac" then
--hint for attacing
if en.shake>0 then
en.shake-=1
en.x+=sin(t/2.5)
--en.sy=1-rnd(2)
return
end
if en.type==1 then
en.sy=1.5
en.sx=1.5*sin(t/42)
if en.x<32 then
en.sx+=1-(en.x/32)
elseif en.x>96 then
en.sx-=1-((en.x-96)/24)
end
move(en)
elseif en.type==2 then
--red:fly to the same x then down
en.sy=cos(t/30) --(t%6)/30+cos(t/30)/30
en.sx=5*sin((4+rnd()+t)/24)+2*(rnd()-0.5)
en.sx+=(ship.x-en.x)/8
if en.x<=ship.x+1 and en.x>=ship.x-1 and en.flag==false then
en.wait=25
en.tx=en.x
en.ty=145
--en.lifes=6
en.flag=true
end
if en.flag then
en.sy=1-rnd(2)
en.sx=1-rnd(2)
en.wait-=1
if en.wait<=0 then
en.mission="flyin"
en.flag=false
end
end
--[[if en.x<8 then
en.sx+=5-5*(en.x/8)
elseif en.x>104 then
en.sx-=5-5*((en.x-104)/16)
end]]--
move(en)
elseif en.type==3 then
elseif en.type==4 then
end
end
end
function picking()
if mode!="game" then
return
end
if t%attacfreq==attacfreq-1 then
pickattac()
end
end
function pickattac()
local limit = min(10,#enemies)
local picker=flr(rnd(limit))
picker=#enemies-picker
if picker<=0 then return end
local en=enemies[picker] --rnd(enemies)
if en.mission=="stay" then
en.mission="attac"
--attacing hint
en.shake=20
end
end
function move(obj)
obj.y+=obj.sy
obj.x+=obj.sx
end
function killen(en)
del(enemies,en)
sfx(4)
explode(en.x+4,en.y+4,"en"..en.type)
getscore(en)
if en.mission=="attac" then
pickattac()
end
end | 4,685 | 18,192 | true | true | true | false | Not supported with pagination yet | [] | [] | 00000000000200000002200000002000000000000000000000000000000000000000000000000000000000000000000000000000088008800880088000000000
0000000000082000002882000002800000000000000aa000000aa000000aa0000077770000077000000000000000000000000000888888888008800800000000
007007000028e20002e88e20002e8200000000000079970000099000007997000c6996c000799700000000000000000000000000888888888000000800000000
000770000027e8000e8718e0008e72000000000000c66c000007700000c66c0000cccc0000c66c00000000000000000000000000888888888000000800000000
00077000021c1820281c1182028c112000000000000cc00000066000000cc00000000000000cc000000000000000000000000000088888800800008000000000
007007000211e82028e11e82028e11200000000000000000000cc000000000000000000000000000000000000000000000000000008888000080080000000000
000000000228e2202e2882e2022e8220000000000000000000000000000000000000000000000000000000000000000000000000000880000008800000000000
0000000000296000006a96000006a200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0099990000999900009999000099990000000000033003300330033003300330033003300330033003300330000000000000000000049a000000000000000000
09aaaa90099aa990099aa990099aa9900000000033b33b3333b33b3333bbbb3333b33b3333b33b33337777330000000000000000066666600000000000000000
09a77a9009a77a9009a77a9009a77a90000000003bbbbbb33bbbbbb33bbbbbb33bbbbbb33bbbbbb3377717730000000000000000660067660000000000000000
09a77a9009a77a9009a77a9009a77a90000000003b7717b33b7717b33b7717b33b7717b33bbbbbb3377117730000000000000000600066760000000000000000
09aaaa9009aaaa90099aa99009aaaa90000000000371173003711730b371173b0371173003711730037cc7300000000000000000600006660000000000000000
09aaaa90099aa99009999990099aa9900000000030377303b037730b30377303b037730b30377303003773000000000000000000600000060000000000000000
099aa99009999990049999400999999000000000b003300b300330030303303030033003b003300b000330000000000000000000660000660000000000000000
00999900009999000044440000999900000000000300003003000030000000000300003003000030000000000000000000000000066666600000000000000000
00999900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
09aaaa90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
09a77a90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
09a77a90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
09aaaa90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
099aa990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00999900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00099000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00999900009999000009900000999900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
09aaaa90099aa99000999900099aa990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
9aa77aa999aaaa9909aaaa9099aaaa99000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
9a7777a99aa77aa999a77a999aa77aa9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
9a7777a99aa77aa999a77a999aa77aa9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
9aa77aa999aaaa9909aaaa9099aaaa99000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
09aaaa90099aa99000999900099aa990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00999900009999000009900000999900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000505000000000000050000000000000000000000000000000000000000000000000000000
00000000000000000000999999900060000000555550005000555055555050500000005555500000000000000000000000000000000000000000000000000000
000700000000700060099aaaaaaa9066050055552225505505055555525555500005050555005000000000000000000000000000000000000000000000000000
00000799900000000009aaaaaaaa9900505552222882500050552255585550050000000005555000000000000000000000000000000000000000000000000000
07007799aa9000700099aa7777aaa900005228889992250000525088599255500000000000550050000000000000000000000000000000000000000000000000
0000097777a00000099a777777aaaa90055289999999850005555555588955000000000000000000000000000000000000000000000000000000000000000000
00009a77777a000009aa7777777aaa99005899aaaa99885000589985552555500005555000000000000000000000000000000000000000000000000000000000
00009a77777a000009aa7777777aaa99005899a7aaa9825000089599998882500055555555000000000000000000000000000000000000000000000000000000
0009aa7777a9900099aa7777777aaa9005299aa77aa9825005288222299988500000555000000000000000000000000000000000000000000000000000000000
00009aa77aa9007099aa7777777aa990052899aaaa99855055222299558222505000050000000000000000000000000000000000000000000000000000000000
000099aaaa900000099aa77777aaa9900558899a9998850005528888882585000000000000000000000000000000000000000000000000000000000000000000
077000a999000700009aaaaaaaaa9900005588888882250000555558888225000005500005505000000000000000000000000000000000000000000000000000
00000000000000000099aaaaaaaa9000000522222222550005555222252255000005500000555500000000000000000000000000000000000000000000000000
00070000000000000609999999999060000055255555500050505525555555000000005550005000000000000000000000000000000000000000000000000000
00000000000000000660000990000000005000550000000000500055550050500000005550000000000000000000000000000000000000000000000000000000
00000000000000000000000000000006000000000000005000000000000500000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
02000020002000200002020000202000020002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
28200282288202820e822882288228e0282028820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
82888828e2888828e288882ee288882e8288882e02eeee2000000000000000000000000000000000000000000000000000000000000000000000000000000000
e28ee82e028ee82e028ee820028ee820e28ee82002e22e2000000000000000000000000000000000000000000000000000000000000000000000000000000000
288228822882288228822882288228822882288207c887c000000000000000000000000000000000000000000000000000000000000000000000000000000000
8878878888788782287887e22e7887e22e7887880cceecc000000000000000000000000000000000000000000000000000000000000000000000000000000000
2e0000e22e000ee22ee00220022000e22e0000e20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
02e00e2002e00020020000000000022002200e200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
01600610001006000001600000061000006001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
d6dbbd6d0d6bbdd000d6bd0000db6d000ddbb6d00004400000000000000000000000000000000000000000000000000000000000000000000000000000000000
d6b7336d0d6733d000d6330000b76d000db736d00047940000000000000000000000000000000000000000000000000000000000000000000000000000000000
16b33b6101633b1000163b0000b3610001b336100097790000000000000000000000000000000000000000000000000000000000000000000000000000000000
0163361000633600060630600d0360d000633600000aa00000000000000000000000000000000000000000000000000000000000000000000000000000000000
d060060dd060060d0606d060060d60600d6006d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
60100106d010010d07011070a001100a601001060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
80000008200000020000000000000000900000090000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000b000000000300000b000000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000b300000033330000b30000003333000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000333333033bb00000333333033bb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
33b333bbbb33300033b333bbbb333000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
03303b3bbbb3300003303b3bbbb33000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0033bbb3bbb330000033bbb3bbb33000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0033b3bb3b3b33000033b3bb3b3b3300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
003bb73b337bb300003bb73b337bb300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
003bb7733773b300003bb7733773b300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0033b678876b33000033b678876b3300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
03b333666633300003b3336666333000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
3b0037333373b0003b0036733763b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
30000670076033003000006776003300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
33300060060003333330000000000333000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00b00000000003b300b00000000003b3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000b000000000000000b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 | 000100003854034540315402d5402954024540205401c5401954016540125400e5400b54008540045400060015700227002c70030700317002b700167000e7000f7001c70029700307002b7001b7000e70021700
0002000026650366503e650266502d650336503635034350303502d3502835025350213501f3501965014650106301e3301b33006620036200e62007620113200a62006610036100061000610006100061000600
0001000001730017300173002730027300273004730067300a7300c7300e73013730177301a7301d7302073022730257202672027720287202971029710077000470002700007000070000700007000070006700
000200000070015700157001570015700157001570015700157001570015700157002c7002c7502c7502c7502c7302c7302c7203f700387503875038750387503873038730387200070000700007000070000700
0002000025740017402f6202f62001740247500175001750207500175017750017501875002750177500275002750117500275002750107500272002720117200272002720000000000000000000000000000000
011000200c055130550c055130550c055130550c055130550e055130550e055130550e055130550e0551305510055150551005515055100551505510055150551105518055110551805511055180551105518055
0110002018050000000000000000130500000000000000001a050000000000000000130500000000000000001c050000001500015000150500000000000000001d05000000000000000018050000000000000000
911f00000c5500c5501c5501355010550115501f500205000c55010550185501c5500c5501f55022500235000c5500c5501c5501f550105500c55000500005001d5501d550105500c5500e5500c5500050000500
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
011000001d7501f7501f7501f70022750227501f7501f70024750247502775027750247501f7501f7502270024750227501f7501f700227502b7502b75029750227500070026750267500070027750277501f700
011000000955303300000000000009553000000000000000095530950000000095000955309553095000950009553000000000000000095530000000000000000955309500000000950009553095530950009500 | 01 14154344
04 41154344
00 41424344
00 41424344
00 41424344
00 41424344
00 41424344
00 41424344
03 05060744 | |||
stackrobats-0 | Stackrobats | beepyeah | [
"puzzle",
"sokoban",
"game"
] | 3 | 2 | 2026-03-17 17:15:26 | 2026-03-17 21:52:37 | 155,652 | https://www.lexaloffle.com/bbs/?tid=155652 | -- stackrobats
-- by tom and arthur brinton
-- 2023-25
-- you are the leader of a
-- troupe of acrobats--
-- only the leader may accept
-- the trophy after each feat.
-- 26 feats
-- check for bugs with playtesters
cartdata("beepyeah-stackrobats")
function _init()
mode="menu"
menuitem(1, "main menu", function() mode="menu" ;music(0);camera()end)
menuitem(2, "prev. level", function() level-=1;max(level,1);sfx(3);levelinit()end)
--menu,game,message,win
menuchoice=1
levelselect=1
menusprites={17,38,39,40}
ms=17
--head location vars
hx=0
hy=0
anim=true
starttimes=true
intro = 200
feats={"the carry","the drop",
"tower of power","leaning tower",
"handoff","rebuild","ladder down",
"step down","highwire",
"pick a path","the show goes on",
"the leap","step right up",
"jump and stack","build up",
"up and down","barrels of fun",
"roll out","roll up","trap-ease",
"the climb","team up","potholes",
"pit crew","rung-around",
"troupes and ladders",
"the big top","hangers-on",
"tight squeeze","grand finale"}
body={}
goal={}
goal.x=0
goal.y=0
goal.s=6
barrels={}
fw={}
level=1
levelunlocked = dget(0) or 1
levelselect=levelunlocked
endtimes=-1
mx,my=0,0
at=0
end
function _update60()
if (at==100) at=0 else at+=1
if mode=="menu" and intro<1 then
if btnp(⬆️) or btnp(⬇️) then
sfx(7)
if menuchoice==1 then
menuchoice=2
else
menuchoice=1
end
end
if menuchoice==1 then
if btnp(➡️) then
levelselect+=1
sfx(6)
elseif btnp(⬅️) then
levelselect-=1
sfx(6)
end
levelselect=min(levelselect,levelunlocked)
levelselect=max(levelselect,1)
end
if btnp(❎) then
sfx(5)
if menuchoice==1 then
mode="game"
level=levelselect
levelinit()
music(-1)
else
mode="help"
music(-1)
end
end
elseif mode=="help" or mode=="win" then
if btnp(🅾️) then
mode="menu"
music(0)
end
elseif mode=="game" then
foreach(body,findhead)
movebarrels()
anim = false
for b in all(body) do
--check if animating
if (b.dx != b.x * 8 or b.dy != b.y * 8) then
anim = true
break
end
end
if (not anim and endtimes<0) movebot()
if (not anim) checkfall()
if (not anim) checktouch()
if hx==goal.x and hy==goal.y and not anim and endtimes<0 then
sfx(11)
makefw(goal.x*8+3,goal.y*8-2,10)
makefw(goal.x*8+4,goal.y*8-1,9)
endtimes=72
end
if (endtimes>0) endtimes-=1
if endtimes==1 and not starttimes then
endtimes=-1
level+=1
if level>#feats then
--win game mode
music(4)
mode="win"
else
levelinit()
end
elseif endtimes==1 and starttimes then
endtimes=-1
starttimes=false
end
end
end
function _draw()
cls()
if mode=="menu" then
if intro>0 then
intro-=1
if intro>100 then
fillp(0b1001011001101001)
rectfill(0,0,128,128,1)
fillp()
spr(76,52,46,2,2)
print("beep \nyeah!\ngames",52,67,5)
print("beep \nyeah!\ngames",52,66,7)
else
spx=72-(intro)
spy=16+sin(intro/25)*16
fillp(0b0101101001011010)
circfill(spx+2, spy+4, 7,0x5d)
fillp()
spr(18,72,16)
end
if (intro==1)music(0)
else
fillp(0b0101010101010101)
rectfill(0,0,128,128,1)
fillp()
fillp(0b0101101001011010)
circfill(72+2, 16+4, 7,0x5d)
fillp()
spr(19,72-2,16+2)
for pp=1,15 do
pal(pp,0)
end
spr(64,20,27,11,2)
pal()
spr(64,20,24,11,2)
rectfill(36,47,92,53,0)
print("by tom brinton",37,48,2)
rectfill(24,72,104,112,0)
map(112,48,0,0,16,16)
if (at%20==0) ms=menusprites[ceil(rnd(#menusprites))]
spr(ms,72,16)
print("feat "..levelselect.."..",52,78,15)
print("how to play",52,92,15)
if (menuchoice==1) then
if (levelselect>1) spr(25,30,76)
if (levelselect<levelunlocked or levelselect==1) spr(26,40,76)
elseif (menuchoice==2) then
spr(26,40,90)
end
end
elseif mode=="help" then
fillp(0b0111101111011110)
rectfill(0,0,128,128,1)
fillp()
spr(17,16,16)
print("this is the leader of\nthe acrobat troupe",32,16,15)
spr(18,16,32)
spr(16,16,40)
print("activate other acrobats\nby touching them",32,34,15)
spr(6,16,56)
print("the leader must grab\nthe trophy to win",32,54,15)
spr(5,16,72)
spr(22,16,80)
print("use the highwire and\ntrampolines to reach\nyour goal",32,71,15)
print("let the show begin!",28,98,8)
print("press z to return",32,112,2)
elseif mode=="game" then
sx,sy=mx*8,my*8
camera(sx,sy)
fillp(0b0111110101111101)
rectfill(sx,sy,sx+128,sy+128,1)
fillp()
drawshadows()
map(mx,my,sx,sy,16,16)
foreach(body,drawbody)
foreach(barrels, drawbarrel)
levelstring="feat "..level..": "..feats[level]
print(levelstring,sx+63-(#levelstring*4)/2,sy+2,0)
print(levelstring,sx+64-(#levelstring*4)/2,sy+1,2)
if (endtimes<1 or starttimes) drawgoal()
if endtimes>0 then
local endt=endtimes
if (starttimes) endt=64-endt
fillp(0b0101101001011010.1)
rectfill(sx,sy,sx+128,sy+128,0)
fillp()
for i= 0,72,8 do
curl=1
for j=0,15 do
curl*=1+(endtimes/400)
--if (starttimes)
curtx=((sx+64)-endt)-i
spr(104,curtx-curl,sy+j*8)
curtx=((sx+64)+endt)+i
spr(104,curtx+curl,sy+j*8)
end
end
end
foreach(fw,drawfw)
elseif mode=="win" then
camera()
for i=at/1000,2,.02 do
aline(64,128,i,150,1)
end
if (at==50) makefw()
foreach(fw,drawfw)
map(96,48,0,0,16,16)
if (at%20==0) ms=menusprites[ceil(rnd(#menusprites))]
spr(ms,56,96)
spr(96,32,40,8,2)
end
end
function drawshadows()
for b in all(body) do
if b.alive then
fillp(0b0101101001011010)
circfill(b.dx+2, b.dy+4, 7,0x5d)
fillp()
end
end
for b in all(body) do
if b.alive then
spr(19,b.dx-2,b.dy+2)
end
end
end
--goal
function drawgoal()
gang=at/99
spr(goal.s,goal.x*8, goal.y*8-sin(gang)*1.5)
goal.s+=.25
if(goal.s==11) then goal.s=7 end
end
-->8
--level set up
function levelinit()
--refresh map
reload(0x1000, 0x1000, 0x2000)
mx=((level-1)%8)*16
my=flr((level-1)/8)*16
body={}
barrels={}
starttimes=true
endtimes=72
if (level>levelunlocked) levelunlocked=level
if (levelunlocked>#feats) levelunlocked=#feats
dset(0,levelunlocked)
for i = mx,mx+16 do
for j = my,my+16 do
mt=mget(i,j)
if mt==17 then
makebody(i,j,true,true)
mset(i,j,0)
elseif mt==16 then
makebody(i,j,true,false)
mset(i,j,0)
elseif mt==18 then
makebody(i,j,false)
mset(i,j,0)
elseif mt==6 then
goal.x=i
goal.y=j
goal.s=6
mset(i,j,0)
elseif mt==50 then
makebarrel(i,j)
mset(i,j,0)
end
end
end
end
-->8
--movement functions
function touchingbody(o)
if not o.alive then
return
end
for b in all(body) do
if not b.alive then
if (abs(b.x-o.x) <2 and b.y==o.y) or (abs(b.y-o.y) <2 and b.x==o.x) then
b.alive=true
touchingbody(b)
end
end
end
end
function canmove(cx, cy)
if fget(mget(cx, cy), 0) then
return false
end
for b in all(body) do
if cx == b.x and cy == b.y then
return false
end
end
for br in all(barrels) do
if cx == br.x and cy == br.y then
return false
end
end
return true
end
function is_on_or_entering_ladder(b, dy)
local y = b.y + dy
return is_ladder(b.x, y)
end
function is_ladder(x, y)
return fget(mget(x, y), 3)
end
function is_blocked(x, y, ignore_active)
-- check solid tile
if fget(mget(x, y), 0) then return true end
-- check barrels
for br in all(barrels) do
if br.x == x and br.y == y then return true end
end
-- check other acrobats
for b in all(body) do
if b.x == x and b.y == y then
if not ignore_active or (not b.alive) then
return true
end
end
end
return false
end
function is_occupied_by_stationary_active(x, y)
for b in all(body) do
if b.x == x and b.y == y and b.alive and not b.climbing then
return true
end
end
return false
end
function isonground(o)
local below = o.y + 1
-- solid ground check
if fget(mget(o.x, below), 0) then
return true
end
-- barrel support check
for br in all(barrels) do
if br.x == o.x and br.y == below then
return true
end
end
-- ladder top support check
-- allows standing directly on top of a ladder
if is_ladder(o.x, below) then
return true
end
return false
end
function canblastmove(cx, cy)
-- block if another acrobat is there
for b in all(body) do
if cx == b.x and cy == b.y then
return false
end
end
-- block if a barrel is there
for br in all(barrels) do
if cx == br.x and cy == br.y then
return false
end
end
-- allow if it's a "walkable" tile (flag 1) or not solid
if fget(mget(cx, cy), 1) then return true end
if not fget(mget(cx, cy), 0) then return true end
return false
end
function isonwalkway(o)
if fget(mget(o.x,o.y+1),1) then
return true
end
return false
end
-->8
--body parts
function makebody(bx,by,ba,bh)
local b={}
b.x=bx
b.y=by
b.dx=bx*8
b.dy=by*8
b.alive=ba
b.head=bh
b.animating=false
b.climbing = false
add(body,b)
end
function findhead (b)
--set head location vars
if b.head then
hx=b.x
hy=b.y
end
--animate motion
if b.dx<b.x*8 then
b.dx+=2
elseif b.dx>b.x*8 then
b.dx-=2
end
if b.dy<b.y*8 then
b.dy+=2
elseif b.dy>b.y*8 then
b.dy-=2
end
end
function movebot()
--reset level
if btnp(❎) then
sfx(4)
levelinit()
end
--launch
if btnp(🅾️) then
--are you on a movement block
if can_blast("up") then
blast("up")
elseif can_blast("left") then
blast("left")
elseif can_blast("right") then
blast("right")
end
end
if btnp(⬆️) then
sort(body, topdown)
local ladder_found=false
for b in all(body) do
if b.alive and (is_ladder(b.x,b.y) or is_ladder(b.x,b.y-1)) then
ladder_found=true
break
end
end
if ladder_found then
for b in all(body) do
if b.alive and not is_blocked(b.x,b.y-1,true) then
b.y-=1
b.climbing=true
end
end
sfx(1)
end
end
if btnp(⬇️) then
sort(body, bottomup)
local ladder_found=false
for b in all(body) do
if b.alive and (is_ladder(b.x,b.y) or is_ladder(b.x,b.y+1)) then
ladder_found=true
break
end
end
if ladder_found then
for b in all(body) do
if b.alive and not is_blocked(b.x,b.y+1,true) then
b.y+=1
b.climbing=true
end
end
sfx(1)
end
end
--move left or right
if btnp(⬅️) then
sort(body, rtol)
for b in all(body) do
if b.alive then
local tx = b.x - 1
-- is there a barrel?
local pushed = false
for br in all(barrels) do
if br.x == tx and br.y == b.y then
-- try to push barrel
if canmove(br.x - 1, br.y) then
br.x -= 1
b.x -= 1
pushed = true
break
end
end
end
if not pushed and canmove(tx, b.y) then
b.x -= 1
end
end
end
sfx(1)
elseif btnp(➡️) then
sort(body, ltor)
for b in all(body) do
if b.alive then
local tx = b.x + 1
-- is there a barrel?
local pushed = false
for br in all(barrels) do
if br.x == tx and br.y == b.y then
-- try to push barrel
if canmove(br.x + 1, br.y) then
br.x += 1
b.x += 1
pushed = true
break
end
end
end
if not pushed and canmove(tx, b.y) then
b.x += 1
end
end
end
sfx(1)
end
--check if on walkway and can move down
local walkway=false
for b in all(body) do
if b.alive and isonwalkway(b) then
walkway=true
end
end
if walkway and btnp(⬇️) then
blast("down")
end
end
function checkfall()
-- acrobats fall
sort(body, bottomup)
for b in all(body) do
-- skip fall if climbing ladder
if b.climbing then
b.climbing = false -- clear for next frame
else
-- skip if supported by anything
local below = b.y + 1
local supported = false
-- check solid ground
if fget(mget(b.x, below), 0) then
supported = true
end
-- check barrels
for br in all(barrels) do
if br.x == b.x and br.y == below then
supported = true
break
end
end
-- check other acrobats
for other in all(body) do
if other != b and other.x == b.x and other.y == below then
supported = true
break
end
end
-- fall if not supported and not active
if not supported and not b.alive then
b.y += 1
sfx(2)
end
end
end
-- barrels fall
sort(barrels, bottomup)
for br in all(barrels) do
if canmove(br.x, br.y + 1) then
br.y += 1
sfx(2)
end
end
end
function checktouch()
--check for body parts to activate
foreach(body,turnoff)
for b in all(body) do
if b.head then
touchingbody(b)
end
end
--if nothing active is touching the ground,
--fall until something is
local floating = true
for b in all(body) do
if b.alive then
-- treat ladder as support, and also treat "just climbed" as supported for 1 frame
if isonground(b) or is_ladder(b.x, b.y) or b.climbing then
floating = false
break
end
end
end
if floating then
for b in all(body) do
if b.alive then
b.y += 1
sfx(2)
anim = true
end
end
end
end
function can_blast(dir)
for b in all(body) do
if b.alive then
if dir == "up" and mget(b.x, b.y+1) == 22 then return true end
if dir == "left" and mget(b.x+1, b.y) == 23 then return true end
if dir == "right" and mget(b.x-1, b.y) == 24 then return true end
end
end
return false
end
function blast(dir)
local dx, dy = 0, 0
if dir == "up" then dy = -1
elseif dir == "down" then dy = 1
elseif dir == "left" then dx = -1
elseif dir == "right" then dx = 1
end
if dir == "up" then sort(body, bottomup)
elseif dir == "down" then sort(body, topdown)
elseif dir == "left" then sort(body, rtol)
elseif dir == "right" then sort(body, ltor)
end
for b in all(body) do
if b.alive then
local nx = b.x + dx
local ny = b.y + dy
while canblastmove(nx, ny) do
b.x = nx
b.y = ny
nx += dx
ny += dy
end
end
end
checktouch()
sfx(3)
end
function turnoff(b)
if (not b.head) b.alive=false
end
function drawbody(b)
local drx=b.dx
local dry=b.dy
if b.head then
if btn(➡️) then
spr(38,drx,dry)
elseif btn(⬅️) then
spr(39,drx,dry)
else
if at>90 then
spr(40,drx,dry) --blink
else
spr(17,drx,dry) --norm
end
end
return
end
--draw other acrobat sprites
if b.alive then
spr(16,drx,dry)
else
spr(18,drx,dry)
end
end
-->8
--misc
function sort(a,cmp)
for i=1,#a do
local j = i
while j > 1 and cmp(a[j-1],a[j]) do
a[j],a[j-1] = a[j-1],a[j]
j = j - 1
end
end
end
function topdown(a,b)
return a.y<b.y
end
function bottomup(a,b)
return a.y>b.y
end
function ltor(a,b)
return a.x<b.x
end
function rtol(a,b)
return a.x>b.x
end
function aline(x0, y0, angle, length, col)
local x1 = x0 + cos(angle) * length
local y1 = y0 + sin(angle) * length
line(x0, y0, x1, y1, col) --
end
function makefw(fwx,fwy,fwc)
fwl= 60
fcl= fwc or 7+ceil(rnd(5))
fx= fwx or rnd(128)
fy= fwy or rnd(72)
for i=1,10 do
local f={}
f.x=fx
f.y=fy
f.sp=1
f.a=i/10
f.c=fcl
f.s=2
f.l=fwl
add(fw,f)
end
end
function drawfw(f)
f.sp*=.96
f.x+=cos(f.a)*f.sp
f.y-=sin(f.a)*f.sp
f.y+=.5+rnd()/2
f.s-=.03
if (rnd()>.3)circfill(f.x,f.y,f.s,f.c)
f.l-=1
if (f.l<1) del(fw,f)
end
-->8
--barrels
function makebarrel(bx,by)
local b={}
b.x=bx
b.y=by
b.dx=bx*8
b.dy=by*8
b.s=50
add(barrels,b)
end
function drawbarrel(b)
spr(b.s,b.dx,b.dy)
end
function movebarrels()
for br in all(barrels) do
if br.dx < br.x * 8 then br.dx += 2
elseif br.dx > br.x * 8 then br.dx -= 2 end
if br.dy < br.y * 8 then br.dy += 2
elseif br.dy > br.y * 8 then br.dy -= 2 end
end
end
| 4,429 | 16,166 | true | true | true | false | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
1,
0,
0,
1,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
5,
5,
5,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
1,
1,
1,
1,
0,
0,
0,
0,
8,
8,
0,
0,
0,
0,
1,
1,
0,
1,
1,
0,
0... | 000000008888ffff0000003000090000eeee77776700006600000000000000000000000000000000000000000f0440f00606606005055050000a700000000000
000000008888ffff0000b003009990008888ffff556666550aaaa7a00aaaa7a00aaaa7a00aaaa7a00aaaa7a0080ff0800606606005055050009aa70000000000
007007008888ffff000bbb00009999008888ffff005555000aaaa7a00aaaa7a00aaaa7a00aaaa7a00aaaa7a0008ff8000066660000555500009aaa0000000000
000770008888ffff00bbbbb0099999008888ffff0000000009aaa7a009aaa7a009aaa7a009aaa7a009aaa7a00008800000066000000550000009a88e00000000
000770008888ffff0bbbbb00099999908888ffff00000000009aaa00009aaa00009aaa00009aaa00009aaa00000cc00000066000000550000009a88888e00000
007007008888ffff00bbb000099999908888ffff00000000000990000009900000099000000990000009900000c00c0000600600005005000009a8888888e000
000000008888ffff300b0000099999908888ffff0000000000aa7a0000aa7a0000aa7a0000aa7a0000aa7a0000c00c0000600600005005000009a8888888888e
000000008888ffff03000000009999008888ffff0000000000000000000000000000000000000000000000000ff00ff006600660055005500009a88888888888
a002200af004400f60055006111111112222444411111111ddddddddd22222222222222d0000000000000000bbbbbbbbbbbbbbbb333333330009a88888882000
0b0aa0b0080ff0800d0660d001111110222244441111111122222222d222e222222e222d0007777007777000bbbbbbbbbbbbbbbb333333330009a88888200000
03baab30028ff82000d66d000011110022224444111111112228e222d22882222228e22d7777777777777777bbbbbbbbbb7777bb333333330009a88200000000
003bb30000288200000dd00000111000111122220011001122888e22d2888ee228888e2d6666677777766666bbbbbbbbbb7227bb333333330009a00000000000
003bb30000288200000dd000011111000000000000000000288888e2d28888822888882d1177777777777711bbbbbbbbbb7227bb333333330009a00000000000
00b33b000082280000d00d0011111110000000000000000022288222d22882222228822d0066677777766600bbbbbbbbbb7777bb333333330009a00000000000
0b3003b0082002800d0000d011111111000000000000000022288222d22282222228222d0017777117777100bbbbbbbbbbbbbbbb333333330009a00000000000
aa0000aaff0000ff6600006611111111000000000000000022222222d22222222222222d0001111001111000bbbbbbbbbbbbbbbb3333333300999a0000000000
800000080000000000000000000000000000000000000000f00044000044000ff000000fbbbbbbbb0eee77700eee77770eee7777eeee7770eeee777000000000
08088080000d0000000d0000000dd000000dd0000dddddd00800ff0000ff008008044080bbbbbbbbe888fff7e888ffffe888ffff8888fff78888fff700000000
0000000000dd0000000dd000000dd00000dddd00022222d00288ff8ff8ff8820088ff880bb7227bb8888ffff8888ffff8888ffff8888ffff8888ffff00000000
080880800ddddd000ddddd000dddddd00dddddd00000dd200028820000288200002ff200bb7227bb8888ffff8888ffff8888ffff8888ffff8888ffff00000000
080880800ddddd000ddddd0002dddd20022dd22000dd2200002882000028820000288200bb7777bb8888ffff8888ffff8888ffff8888ffff8888ffff00000000
0000000002dd2200022dd200002dd200000dd0000d220000008228000082280008822880bb7777bb8888ffff8888ffff8888ffff8888ffff8888ffff00000000
08088080002d0000000d200000022000000220000dddddd0082002800820028008200280bbbbbbbb8888ffff8888ffff8888ffff8888ffff8888ffff00000000
800000080002000000020000000000000000000002222220ff0000ffff0000ffff0000ffbbbbbbbb8888ffff2888ffff8888ffff8888ffff8888fff400000000
d00000d00000000029d99df2004ff00009f009f0000000000000000000000000098e00008888ffff0eee7770222244448888ffff8888ffff222244440000e8a0
2d000d200ddd00d099d99dff004f900009ffa7f0dd00ddd00dd0ddd0ddd0000009888e008888ffffe888fff7222244448888ffff8888ffff2222444400e888a0
02d0d20002d20d2d242442440049f00009f444f0d2d0d220d220d2202d2000000988888e8888ffff8888ffff122244448888ffff8888ffff22224442e88888a0
002d200000d00d0dd666667704fffa0009f004f0d0d0d000d000d0000d000000098888208888ffff8888ffff011122228888ffff8888ffff11112220028888a0
00d2d00000d00d0d15555555049fff0009f009f0dd20dd002d00dd000d000000098820008888ffff8888ffff000000008888ffff8888ffff00000000000288a0
0d202d0000d00d0d242442440049900009ffa7f0d2d0d20002d0d2000d000000094000008888ffff8888ffff000000008888ffff8888ffff00000000000004a0
d20002d000d002d2242442440049f00009f444f0d0d0ddd0dd20ddd00d00000009a000008888ffff8888ffff000000008888ffff8888ffff00000000000009a0
200000200020002014244241004ff00009f004f0202022202200222002000000999a00002888fff42888fff4000000002888ffff8888fff4000000000000999a
028888e08888888e0008e00000888e00888e0028888888e000088e00888888e00008e0008888888e0288888e0000000000000007700000000000000000000000
288888808888888800888e00088888e0888802888888888e008888e08888888e00888e0088888888288888880000000007700067760007700000000000000000
8888888088888888028888208888888e888808888888888802888882888888880288882088888888888888880000000007776d7777d677700000000000000000
88888800828888280888888088888888888808882888288808888888288888880888888082888828888888800000000000777777777777000000000000000000
8ff82000808ff808088ff8808f82088828f808f808ff09f808f888f808ff29f8088ff880808ff8088ff820000000000000677761167776000000000000000000
88880000008888000882288088800288088808880888028808880888088802880882288000888800888800000000000000d7776116777d000000000000000000
8fff8000008ff80008f00f808f80000008ffff8008ff0f8808f808f808ff0f8808f00f80008ff8008fff80000000000006777761167777600000000000000000
28888800008888000888888088800000088888000888888008820288088888800888888000888800288888000000000077777761167777770000000000000000
028fff80008ff80008ffff808f80028808fff80008fff80008f202f808ff8f8008ffff80008ff800028fff800000000077777761167777770000000000000000
0028fff8008ff80008f88f808f8008f808f88f8008f88f8008f808f808ff2ff808f88f80008ff8000028ff880000000006777777777777600000000000000000
00028fff808ff8008ff22ff88f8008f808f808f808f828f808f808f808ff04f88ff22ff8008ff80000028ff80000000000d7776116777d000000000000000000
00028fff808ff8008f9009f88f8208f808f808f808f808f808f888f808ff09f88f9009f8008ff80000028ff80000000000677761167776000000000000000000
0888fff882ffff208f8008f88ff88ff88ff808f88ff808f808ff8ff888ff8ff88f8008f828ffff822888fff80000000000777777777777000000000000000000
08ffff8808ffff88ff8008ff89fffff88ff808ff8ff808ff889ffff88ffffff8ff8008ff8ffffff88fffff880000000007776d7777d677700000000000000000
899ff882089fff889f80089f8889f88089f8089f89f8089f8289ff8289ffff889f80089f89fffff899fff8820000000007700067760007700000000000000000
88888820088888828800008880888800888808888888028880288820888888808800008888888888888888200000000000000007700000000000000000000000
28ef28ef0128ef0128ef28ef0000000128ef28ef28ef12888ef128ef00128ef0222d888e00000000000000000000000000000000000000000000000000000000
288e288e01288e01288e288e00000001288e288e288e128888e1288e001288e0222d888e00000000000000000000000000000000000000000000000000000000
2888288801288801288828880000000128882888288812888881288800128880222d888e00000000000000000000000000000000000000000000000000000000
1280128012822281228122800000000122812281228001228100128280012800222d888e00000000000000000000000000000000000000000000000000000000
1280128012801280128012800000000012801280128000128000128280012800222d888e00000000000000000000000000000000000000000000000000000000
1280128012801280128012800000000012801280128000128000128128012800222d888e00000000000000000000000000000000000000000000000000000000
01282800128012801280128000000000128012801280001280001281280128009a2d889a00000000000000000000000000000000000000000000000000000000
0128280012801280128012800000000012801280128000128000128012812800229a9a8e00000000000000000000000000000000000000000000000000000000
00128000128012801280128000000000128012801280001280001280128128000000000000000000000000000000000000000000000000000000000000000000
00128000128012801280128000000000128012801280001280001280012828000000000000000000000000000000000000000000000000000000000000000000
00128000128012801280128000000000128012801280001280001280012828000000000000000000000000000000000000000000000000000000000000000000
00128000128012801280128000000000128012801280001280001280001288000000000000000000000000000000000000000000000000000000000000000000
0128ef000128ef000128ef000000000001288e288e0012888ef128ef00128ef00000000000000000000000000000000000000000000000000000000000000000
01288e0001288e0001288e0000000000012888288800128888e1288e001288e00000000000000000000000000000000000000000000000000000000000000000
01288800012888000128880000000000001282128000128888812888001288800000000000000000000000000000000000000000000000000000000000000000
01222000012220000122200000000000000120012000122222012220000122000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000083000000830000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000c2101010101010d2000000000000c240404040404040d20000000000c240404040404040404040d20000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000c24040404040404040d2000000000000000000100000000000001000000000c240d3000000000000001000000000001060000000002300000000100000
0000000000c210101010d20000000000000000000000000000000000000000000000f300f300f300000000000000000000c24040404040404040d20000000000
00000010110023000000000010000000000000000000100000000000001000000000102100000000000000001000000000001000000000002300000000710000
000000000010004323001000000000000000000000c2101010101010d200000000c24040404040d2008300830083000000102100000000002121100000000000
000000104040d200c240d20010000000000000f30000100000000000001000000000c3d200000000000000001000000000001040e20000002300b2e250100000
0000000000100043a20010000000000000000000c2d30060000000001000000000100000000000c3404040404010d200001050a343b2e25050b210404040d200
00000010101010101010d300100000000000c2101010d35050505050501000000000b3105050505050505050c3d2000000001000000000002100000000100000
000000f3001043431000100083000000000000c2d30000000043a300100000000010000023434300100060000000100000100000430000000000000000001000
00000010600000000000230010000000000010600000000000000000001000000000001000000000000000006010000000008100000000002300000000100000
000000c210d343009300c310d2000000000000100000000000430000c3d200000010000023430000935050500043100000100000432300000000000000001000
000000c3404040d20000232110000000000010002300000000000000001000000000001000000000000000000010000000001050b2e20000230000b261100000
00000010110043000000006010000000000000100000000000430000001000000010210011432100000000000043100000100011432300230000000000601000
000000b3414141c3d200c240d3000000000010112300000000000000211000000000001000230000000000000010000000c2d300000000002300000000100000
000000c310101010d200c210d30000000000001011000000004300002110000000c340404040d20000a20000c240d30000c34040404040d20000000000c2d300
00000000000000b3c310d341e30000000000c3d22300002100002300c2d300000000001000230000002300210010000000100000001100002300000000100000
000000b341414141c310d341e3000000000000c3d200000000430021c2d3000000b341414141104040104040d341e30000b34141414141c3d20000000010e300
0000000000000000b341e300000000000000b3c34040404061404040d3e300000000001000230000112300230010000000c3406140404040d20000c240d30000
0000000000000000b341e30000000000000000b3c340404040404040d3e30000000000000000b34141414141e300000000000000000000b3c340404040d30000
00000000000000000000000000000000000000b34141414141414141e3000000000000c3404040614040406140d3000000b3414141414141c34040d341e30000
0000000000000000000000000000000000000000b341414141414141e3000000000000000000000000000000000000000000000000000000b341414141e30000
0000000000000000000000000000000000000000000000000000000000000000000000b3414141414141414141e300000000000000000000b34141e300000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000c24040404040d20000000000000000000000f30000f300008300008300000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000830083000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000010004300006010000000000000000000c2404040404040404040404040d20000000000000000000000000000000000
00000000000000000000000000000000000000f300f300c240404040d20000000000000000000000000000000000000000000000000000000000000000000000
0000000000f300000000008300000000001000430000b2104040404040d200000010000000000000000000000000100000000000000000f30000830000000000
00000000000000c2404040d2000000000000c210101010d300000021100000000000000000000000000000000000000000000000000000000000000000000000
000000c2404040404040404040d200000010004300000000000000000010000000100000000000004300000000001000000000000000c210101010d200000000
00c24040404040d30000111000000000000010210021001100002121100000000000000000000000000000000000000000000000000000000000000000000000
00000010001100106000000000100000001000000000000000210000431000000010000000000000000000000021100000000000000010110000001000000000
001000000000000021c24010000000000000104040e250b2e200b24010d200000000000000000000000000000000000000000000000000000000000000000000
000000100043b210e2000043b2100000001000000043000000a20000431000000010000000000000000000000021100000000000000010e20043b21000000000
00c3d250c24040404010101000000000000010601000000000000000001000000000000000000000000000000000000000000000000000000000000000000000
0000008100430000000000430010000000c3d2000043000000100000431000000010210000000000000000000021100000000000000010210043001000000000
00b31000c31010210000c31040d200000000104393000000000000000010000000000000000000000000000000000000000000f30000f3000083000083000000
0000001000430000000000430010000000b310000043000000100043b210000000102100000000000000000000c2d30000000000000010e20043b21000000000
0000102100c31043432100000010000000001043000000000000000000710000000000000000000000000000000000000000c240404040404040404040d20000
000000100043210000002143001000000000c340d243000000101143001000000010212100000000000000002110e30000000000000010430000211000000000
0000c3d20000934343a200a250100000000010000000000000000000001000000000000000000000000000000000000000001000000000000000000000100000
000000c34040d2000000c24040d300000000b34110430000001021430010000000c310d20000000000000000211000000000000000c2d3430000b21000000000
0000b3c3d2000043431040d300100000000010000000000000000000001000000000000000000000000000000000000000001000000000000000000000100000
000000b34141c3404040d34141e3000000000000c3d2000043c3404040d3000000b3411021000060000000002110000000000000001021000000601000000000
000000b3c3d200c24010600000100000000010000000000023000000001000000000000000000000e0f000000000000000001000000000000000000000100000
000000000000b3414141e3000000000000000000b31043004300104141e30000000000102100002100000000c2d300000000000000c34040404040d300000000
00000000b3c340101010404040d300000000100000c24040d2001010001000000000000000010000e1f101000000000000001000000000000000000000100000
0000000000000000000000000000000000000000001043430000100000000000000000c3d2000011000000c2d3e300000000000000b34141414141e300000000
0000000000b341414141414141e3000000001000c2d34141c340104040d3000000000000f3c240404040d283000000000000c340404040404040404040d30000
000000000000000000000000000000000000000000c340404040d30000000000000000b3c3404040404040d3e300000000000000000000000000000000000000
000000000000000000000000000000000000c310d3000000b341414141e3000000000001c2101010101010d2010000000000b341414141414141414141e30000
000000000000000000000000000000000000000000b341414141e3000000000000000000b3414141414141e30000000000000000000000000000000000000000
000000000000000000000000000000000000b341e30000000000000000000000000000c21010101010101010d200225200000000000000000000000000000000 | 091000000c14300000347310000024655000000c1430000000000000000c14300000246551c0251f025230250c143000003473100000246551d0001a7310e731000000c1430c14300000246551d0252102524025
010300001303513015000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
01060000130440e025000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
090800000e04111021150211802123025000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
11080000230451f0111c0451801515045110150e04500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0109000017035180351f1352113500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
011000001a12500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
010900001c03500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
011000000c030000001862517030150300000018625000000e030000001862515030130300000018625000000c030000001862517030150300000018625000000e03000000186251503013030000001862500000
0110000000000000001c5351b5351c53500000195350000000000000001e5351d5351e535000001753500000185350000018535000001c535000001c535000001a535000001a535000001f535000001f53500000
01100000185271c5271f5271c527195271c527215271c5271a5271e527215271e5271a5271f527235271f5271c5271f527245271f5271c5271f52721527255271e5272152724527215271f527235272652723527
010c00001b0301c03024032240351d5301e530265322653522730237302673025731267302b7312b7322b7352a6002c6002e60031600000000000000000000000000000000000000000000000000000000000000 | 01 08494344
00 08094344
00 08090a44
02 08490a44
03 00424344 | |||||
newitiruni-0 | Blackjack | drd1000 | [] | 0 | 1 | 2026-03-17 15:30:29 | 2026-03-17 15:30:29 | CC4-BY-NC-SA | 155,651 | https://www.lexaloffle.com/bbs/?tid=155651 | -- blackjack
-- ◆♥◆♥
function _init()
-- suits = {"hearts","diamonds","spades","clubs"}
-- hearts = {2,3,4,5,6,7,8,9,10,11,12,13,14}
-- diamonds = {2,3,4,5,6,7,8,9,10,11,12,13,14}
-- spades = {2,3,4,5,6,7,8,9,10,11,12,13,14}
-- clubs = {2,3,4,5,6,7,8,9,10,11,12,13,14}
-- thecards = {"ace",2,3,4,5,6,7,8,9,10,"jack","queen","king"}
cardworth = {11,2,3,4,5,6,7,8,9,10,10,10,10,1}
-- reject 0 value cards
dealtcards={0,14,28,42}
playerhand={}
dealerhand={}
playervalue=0
dealervalue=0
whoseturn=0
winner=0
gameover=0
firstdeal=1
money=50
bet=5
oldbet=5
playercanbet=0
startgame()
end
function _update()
cardvalue()
if gameover==1 then
checkscores()
if btnp(❎) or btnp(🅾️) then
startgame() end
else
if choice==0 then
if (btnp(🅾️)) choice=1 --hit
if (btnp(❎)) choice=2 --stay
if firstdeal==1 then
if (btnp(⬇️)) choice=3 --ddown
end
hitorstay()
end
end
end
function _draw()
cls(3)
drawcards()
drawtable()
if winner>0 then
showwinner()
end
end
-->8
function drawtable()
print("dealer must stand on 17",17,86,10)
print("and draw to 16",34,94,10)
print("blackjack pays 3:2",27,102,10)
-- there has to be a better way
-- to switch the text back to
-- white
print("",0,0,7)
if whoseturn==0 then
print("press 🅾️ to hit or ❎ to stay",5,112)
if firstdeal==1 then
print("press ⬇️ to double down",16,120)
end
end
end
function drawcards()
local cardno=0
for card in all(playerhand) do
cardno+=1
local suit = flr(card/14)
local value = card - (suit*14)
spr(suit+16,cardno*8+cardno,8)
spr(value,cardno*8+cardno,16)
-- shows the card as 1-54
-- print(card,(8*cardno),14)
end
print(money.." zorkmids",70,0)
print(bet.." wager",70,7)
print("total",0,26)
print(playervalue,0,34)
cardno=0
for card in all(dealerhand) do
cardno+=1
suit = flr(card/14)
value = card - (suit*14)
if cardno==1 then
if gameover==1 then
spr(suit+16,8*cardno+cardno,50)
spr(value,8*cardno+cardno,58)
else
spr(14,8*cardno+cardno,50)
spr(14,8*cardno+cardno,58,1,1,0,1)
end
-- hide the dealers 1st card
else
spr(suit+16,8*cardno+cardno,50)
spr(value,8*cardno+cardno,58)
--print(card,(8*cardno),64)
end
end
end
function showwinner()
print("total",0,68)
print(dealervalue,0,76)
whoseturn=1
if winner==1 then
print("you win!",60,34)
elseif winner==2 then
print("dealer wins!",60,34)
elseif winner==3 then
print("push!",60,34)
elseif winner==4 then
print("blackjack!",60,34)
end
if broke==1 then
print("no more money!",35,44,8)
print("press ❎ or 🅾️ to sell house",10,120,7)
else
print("press ❎ or 🅾️ to redeal",16,112)
print("press ⬆️ or ⬇️ to change bet",7,120)
end
end
-->8
function startgame()
local card=0
-- rejct 0 value cards
dealtcards={0,14,28,42}
playerhand={}
dealerhand={}
playervalue=0
dealervalue=0
whoseturn=0
winner=0
gameover=0
firstdeal=1
paidout=0
choice=0
if broke==1 then
money=50
broke=0
bet=5
end
card=dealcard()
add(playerhand,card)
card=dealcard()
add(playerhand,card)
card=dealcard()
add(dealerhand,card)
card=dealcard()
add(dealerhand,card)
cardvalue()
if dealervalue == 21 or
playervalue == 21 then
gameover=1
checkscores()
else
hitorstay()
end
end
function dealcard()
local card=0
local alreadydealt=1
while alreadydealt > 0 do
card=flr(rnd(51))+1
alreadydealt=count(dealtcards,card)
end
add(dealtcards,card)
sfx(8)
return card
end
function hitorstay()
local card=0
if whoseturn==0 then
--remember initial bet in case
--player doubles down
oldbet=bet
--hit
if choice==1 then
card = dealcard()
add(playerhand,card)
choice=0
cardvalue()
firstdeal=0
--stand
elseif choice==2 then
choice=0
whoseturn=1
--double down
elseif choice==3 then
if money-(bet*2)<0 or
not firstdeal then
else
choice=0
bet*=2
firstdeal=0
card = dealcard()
add(playerhand,card)
cardvalue()
whoseturn=1
end
end
else
--dealer draws under 17
if dealervalue<17 then
card = dealcard()
add(dealerhand,card)
else
gameover=1
end
end
checkscores()
end
function cardvalue()
local card=0
local cardscore=0
local suit=0
playervalue=0
dealervalue=0
for i=1,2 do
if (i==1) whosehand=playerhand
if (i==2) whosehand=dealerhand
for card in all(whosehand) do
suit = flr(card/14)
card = card-(14*suit)
cardscore = cardworth[card]
if i==1 then
playervalue+=cardscore end
if i==2 then
dealervalue+=cardscore end
end
end
-- going over 21 and having
-- an ace makes the ace's
-- value 1
if playervalue>21 then
playervalue=acescheck(playerhand,playervalue)
end
if dealervalue>21 then
dealervalue=acescheck(dealerhand,dealervalue)
end
end
-- sets only the needed
-- amount of aces to 1 to get
-- under 21
function acescheck(hand,score)
local acesno=count(hand,1)+
count(hand,15)+count(hand,29)+
count(hand,43)
while score>21 and acesno>0 do
score-=10
acesno-=1
end
return score
end
function checkscores()
if gameover==1 then
if playervalue==dealervalue then
winner=3 end
if playervalue>dealervalue then
winner=1 end
if playervalue<dealervalue then
winner=2 end
if dealervalue>21 then
winner=1 end
if playervalue>21 then
winner=2 end
--blackjack
if firstdeal==1 and
playervalue==21 and
dealervalue<21 then
winner=4 end
payout()
elseif playervalue>21 then
whoseturn=1
winner=2
gameover=1
end
end
function payout()
if paidout==0 then
if winner==1 then
sfx(10)
money+=bet end
if winner==2 then
sfx(9)
money-=bet end
if winner==4 then
sfx(11)
money+=flr(bet*1.5) end
paidout=1
bet=oldbet
end
nomoney()
changebet()
end
function nomoney()
if money<1 then
broke=1
end
end
function changebet()
if btnp(⬆️) then
bet+=1
end
if btnp(⬇️) then
bet-=1
end
if (bet>money) bet=money
if (bet<1) bet=1
if (bet>10) bet=10
end
| 1,382 | 5,940 | true | true | true | false | Not supported with pagination yet | [] | [] | 0000000077777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777cccccccc00000000
0000000071111117711111177111111771777717711111177177777771111117711111177111111771711117711111177111117771777177c121212c00000000
0070070071777717777777177777771771777717717777777177777777777717717777177177771771717717777771777177717771771777c212121c00000000
0007700071111117711111177777111771777717711111177111111777777717711111177177771771717717777771777177717771117777c121212c00000000
0007700071777717717777777777771771111117777777177177771777777717717777177111111771717717777771777177717771771777c212121c00000000
0070070071777717717777777777771777777717777777177177771777777717717777177777771771717717717771777111117771777177c121212c00000000
0000000071777717711111177111111777777717711111177111111777777717711111177777771771711117711111777777771771777717c212121c00000000
0000000077777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777c121212c00000000
77777777777777777777777777777777777777770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
78877887777887777771177777711777777777770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
78888887778888777711117777711777777777770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
78888887788888877111111771177117777777770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
78888887788888877711117771177117777777770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
77888877778888777771177777711777777777770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
77788777777887777711117777111177777777770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
77777777777777777777777777777777777777770000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 | 000100001d3001d3001d300000001d000000003560035600000000000026600266002660026600000000000000000000000000000000256002560026600266000000000000000000000025600256002460000000
000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000001a7201a7201a7201b3001e300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000001505010050090500405001050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0010000000050000500105003050080500f0501605000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00100000190501c0501f050200502205024050170501d050200502305024050170501a0501d0501f0502005023050000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
002000001885000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 | ||||
kusanoripo-0 | Minesweeper with autoreveal | drd1000 | [
"minesweeper"
] | 0 | 1 | 2026-03-17 15:27:34 | 2026-03-17 15:27:34 | CC4-BY-NC-SA | 155,650 | https://www.lexaloffle.com/bbs/?tid=155650 | -- minesweeper
-- 🐱
-- ttd
-- try to shorten code
-- unhide entire map on win/lose
function _init()
gamemap={}
playermap={}
xsize=8
gamestart=0
totalbombs=0
uncheckedspaces = xsize*xsize
lastgame=0 -- win or lose
animclock=0
px=0 -- players x,y position
py=0
firstmove=1
end
function _update()
if gamestart==0 then
updatemenu()
else
moveplayer()
end
end
function _draw()
cls(0)
if gamestart==0 then
startmenu()
else
drawmap()
drawplayer()
zeroboard()
end
end
-->8
function drawmap()
--"adjustment" is used to
--move the map more to the
--center of the screen
local xx=0
local yy=0
if animclock > 20 then
animclock = 0
end
animclock+=1
print("uncovered:"..uncheckedspaces,0,0)
if firstmove==0 then
print("bombs:"..totalbombs,70,0) end
local adjustment = (15 - xsize)*3
for i=1,xsize do
for j=1,xsize do
local maptile=playermap[i][j]
xx = i*8 + adjustment
yy = j*8 + adjustment
--make flags wave
if maptile == 1 then
if animclock > 15 then
spr(18,xx,yy)
elseif animclock > 10 then
spr(17,xx,yy)
elseif animclock > 5 then
spr(16,xx,yy)
else
spr(17,xx,yy)
end
else
spr(maptile,xx,yy)
end
end
end
end
function startmenu()
gamestart = 0
totalbombs = 0
if lastgame == 0 then
print ("welcome to minesweeper!",0,0,7) end
if lastgame == 1 then
print ("you won!",0,0,11)
end
if lastgame == 2 then
print ("you lost!",0,0,8)
end
-- change txt back to white
-- is there a better way?
print ("",0,100,7)
-- make the flashing menu
if animclock>4 then
animclock=0
end
if animclock>2 then
spr(96,25,12)
spr(96,93,12)
for i=1,8 do
spr(63+i,(i*8)+22,12)
end
elseif animclock<=2 then
for i=1,8 do
spr(97,25,12)
spr(97,93,12)
spr(79+i,(i*8)+22,12)
end
end
animclock+=1
print ("how wide?",0,70)
-- only allow set map sizes
uncheckedspaces = xsize*xsize
print (xsize, 60, 80)
print ("press x/❎ to check", 0, 30)
print ("press z/🅾️ to place flag", 0, 40)
spr(1,100,38)
print ("press ⬆️/⬇️ to change width",0, 60)
print ("press ❎/🅾️ to start", 24, 100)
end
function drawplayer()
if px>xsize then px=xsize end
if px<1 then px=1 end
if py<1 then py=1 end
if py>xsize then py=xsize end
adjustment = (15 - xsize)*3
xx = px*8+adjustment
yy = py*8+adjustment
spr(13,xx,yy)
end
-->8
-- this is a poor way to place
-- bombs
function createmap()
totalbombs=0
local l_spot=0
for i=1,xsize do
gamemap[i] = {}
playermap[i] = {}
for j=1,xsize do
--1/8 chance for bomb
l_spot=flr(rnd(8))+1
if l_spot==1 then
totalbombs+=1
else
l_spot=3
end
gamemap[i][j] = l_spot
playermap[i][j] = 2
end
end
if totalbombs > flr(xsize*xsize/6)+1
or totalbombs < flr(xsize*xsize/6)
then
createmap()
end
end
function updatemenu()
firstmove = 1
if btnp(2) then xsize+=1 end
if xsize > 15 then xsize = 15 end
if btnp(3) then xsize-=1 end
if xsize < 3 then xsize = 3 end
if btnp(4) or btnp(5) then
gamestart=1 end
if gamestart == 1 then
sfx(-1)
createmap()
sfx(3)
end
end
function moveplayer()
if btnp(0) then px-=1 end-- ⬅️
if btnp(1) then px+=1 end-- ➡️
if btnp(2) then py-=1 end-- ⬆️
if btnp(3) then py+=1 end-- ⬇️
if btnp(4) then
-- place flag or remove it
if playermap[px][py]==2 then
playermap[px][py]=1
elseif playermap[px][py]==1 then
playermap[px][py]=2
end
end
if btnp(5) then
sfx(4)
checkbomb(px,py)
end
end
function checkbomb(xx,yy)
local bomb=0
-- first move is always safe
if firstmove == 1 then
if gamemap[xx][yy] == 1 then
gamemap[xx][yy]=0
totalbombs-=1
end
firstmove = 0 end
if gamemap[xx][yy]==1 then
losegame()
end
-- don't recheck spaces
if playermap[xx][yy] < 3 then
for i=-1,1 do
for j=-1,1 do
-- checks surrounding spaces
-- for bombs and makes sure
-- they are inside the board.
if xx+i >= 1 and xx+i <= xsize
and yy+j >= 1 and yy+j <= xsize then
if gamemap[xx+i][yy+j] == 1
then bomb+=1
end
end
end
end
playermap[xx][yy]=bomb+3
uncheckedspaces-=1
end
if uncheckedspaces == totalbombs then
wingame()
end
end
function losegame()
sfx(-1)
sfx(1)
lastgame=2
startmenu()
end
function wingame()
sfx(-1) sfx(2)
lastgame=1
startmenu()
end
function zeroboard()
local xx=0
local yy=0
for xx=1,xsize do
for yy=1,xsize do
if playermap[xx][yy]==3 then
for i=-1,1 do
for j=-1,1 do
if xx+i >= 1 and xx+i <= xsize
and yy+j >= 1 and yy+j <= xsize
then checkbomb(xx+i,yy+j)
end
end
end
end
end
end
end
| 1,193 | 4,596 | true | true | true | false | Not supported with pagination yet | [] | [] | 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000888888884004004400000000
00000000008870000000000000bbbb00000cc00000cccc0000aaa000008008000088880000077000007777000007700000777700800000084404044000000000
0000000008887000000000000b0000b00000c00000000c0000000a00008008000080000000700000000007000070070000700700800000080040440000000000
00000000088870000004f0000b0000b00000c00000cccc00000aaa00008888000088800000777000000007000007700000777700800000084044400400000000
000000000880700000444f000b0000b00000c00000c0000000000a00000008000000080000700700000007000070070000000700800000080044444000000000
0000000000007000044444f00b0000b00000c00000c0000000000a00000008000000080000700700000007000070070000000700800000084400004000000000
00000000000070000000000000bbbb00000ccc0000cccc0000aaa000000008000088800000077000000007000007700000000700800000084000004400000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000888888884000400400000000
00000000000000000880000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00887000088870000888700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
08887000088870000888700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
08887000088870000088700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
08807000000070000000700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00007000000070000000700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00007000000070000000700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000888888080888880888880888808000808888088880888808888088880000000000000000000000000000000000000000000000000000000000000000000
00000800808080800080800000800008000808000080000800808000080080000000000000000000000000000000000000000000000000000000000000000000
00000800808080800080888880888808080808888088880800808888080080000000000000000000000000000000000000000000000000000000000000000000
00000800808080800080800000000808080808000080000888808000088880000000000000000000000000000000000000000000000000000000000000000000
00000800008080800080800000000808080808000080000800008000080800000000000000000000000000000000000000000000000000000000000000000000
00000800008080800080888880888808888808888088880800008888080080000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000aaaaaa0a0aaaaa0aaaaa0aaaa0a000a0aaaa0aaaa0aaaa0aaaa0aaaa0000000000000000000000000000000000000000000000000000000000000000000
00000a00a0a0a0a000a0a00000a0000a000a0a0000a0000a00a0a0000a00a0000000000000000000000000000000000000000000000000000000000000000000
00000a00a0a0a0a000a0aaaaa0aaaa0a0a0a0aaaa0aaaa0a00a0aaaa0a00a0000000000000000000000000000000000000000000000000000000000000000000
00000a00a0a0a0a000a0a00000000a0a0a0a0a0000a0000aaaa0a0000aaaa0000000000000000000000000000000000000000000000000000000000000000000
00000a0000a0a0a000a0a00000000a0a0a0a0a0000a0000a0000a0000a0a00000000000000000000000000000000000000000000000000000000000000000000
00000a0000a0a0a000a0aaaaa0aaaa0aaaaa0aaaa0aaaa0a0000aaaa0a00a0000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00088000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
01111110011111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
01111110011111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 | 000000001e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601e6601f6601e660
0010000023750217501f7501d7501a750187501675014750117500e75009750067500575003750027000070000700017000070000700007000070000000000000000000000000000000000000000000000000000
001000000b0500e0500f0501205015050180501a0501c0501e050210502405025050280002a0002c0002000021000200001d000180001a0001c0001d0001f000200001e0001b0001b0001c0001e0002000022000
00100010137501375014700163000570005700115001150006750067501d1001d1002f5002f5001b1001a1001a1001a1001910019100191001e10019100191001e100191001a1001e1001b1001d1001e1001f100
001000000d5502c2002f4000240000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
001000000c50017500175001350013500135001350010500135001350010500105001050013500135001750017500135001350013500105001350013500135001050013500135001350017500135001750010500 | 03 05424344 | |||
picofantasyroguelike-1 | PicoFantasyRoguelike | Smithy | [] | 5 | 1 | 2026-03-17 10:48:04 | 2026-03-17 20:39:49 | CC4-BY-NC-SA | 155,646 | https://www.lexaloffle.com/bbs/?tid=155646 | "-- picofantasy\n-- by smithy\n\n-- =================================\n-- overrides & helpers\n-- ==(...TRUNCATED) | 7,443 | 43,999 | true | true | true | false | Not supported with pagination yet | [] | [] | "000000000000000000000000000000000000000000000000000000000000000000044440000000000004444000000000000(...TRUNCATED) | "001400000e1520e1520e152101520e15211152131520e152131520e1521515210152171521115217152151520e152131521(...TRUNCATED) | "01 02014344\n00 03014344\n00 00014344\n02 03014444\n01 04464344\n02 05464344\n01 06424344\n02 07424(...TRUNCATED) | |||
picofantasybeta-0 | picofantasybeta | Smithy | [] | 1 | 1 | 2026-03-17 05:26:10 | 2026-03-17 05:26:10 | CC4-BY-NC-SA | 155,644 | https://www.lexaloffle.com/bbs/?tid=155644 | "-- ff/lufia pico-8 jrpg framework v8.9\n-- unified, optimized, and complete\n\n-- =================(...TRUNCATED) | 4,826 | 27,504 | true | true | true | false | Not supported with pagination yet | [] | [] | "000000000000000000000000000000000000000000000000000000000000000000044440000000000004444000000000000(...TRUNCATED) | "001e00001870211702137020d70214702197021e702147020e702177021270211702137021a70210702107021a702117021(...TRUNCATED) |
PICO-8 Games Dataset
The first multimodal dataset of PICO-8 games. 10,967 cartridges scraped from the Lexaloffle BBS, each decomposed into Lua source code, pixel-art spritesheets, tile maps, sound effects, music patterns, and metadata.
Label screenshots from the top 48 games by star count
What's Inside
Every PICO-8 cartridge is a self-contained game packed into a single file. This dataset cracks each one open into its component parts:
The anatomy of a PICO-8 cartridge (Celeste by Matt Thorson & Noel Berry)
| Modality | Format | Description |
|---|---|---|
| Lua source code | String (up to 65,535 chars) | The complete game logic in PICO-8's Lua dialect |
| Spritesheet | 128x128 PNG (16 colors) | Up to 256 8x8 sprites — all the game's pixel art |
| Label image | 128x128 PNG | The developer's chosen screenshot representing the game |
| Tile map | 128x32 grid of tile indices | The spatial layout of game levels |
| Sound effects | 64 SFX slots, hex-encoded | Each SFX has 32 notes with pitch, waveform, volume, and effects |
| Music patterns | 64 patterns, hex-encoded | 4-channel music sequencer data referencing SFX slots |
| Sprite flags | 256 bytes | 8 boolean flags per sprite, used for collision/behavior |
Dataset Schema
{
# --- Metadata ---
"cart_id": str, # Unique cart identifier (lid)
"title": str, # Game title
"author": str, # Author username
"description": str, # Author's description (when available)
"tags": list[str], # User-applied tags ("platformer", "shooter", etc.)
"stars": int, # Community star/like count (primary quality signal)
"reply_count": int, # Number of thread replies (engagement signal)
"date_posted": str, # Original post date (YYYY-MM-DD HH:MM:SS)
"date_updated": str, # Last update date
"license": str, # "CC4-BY-NC-SA" or "" (71% are CC4-licensed)
"thread_id": int, # BBS thread ID
"thread_url": str, # Direct link to the BBS thread
# --- Code ---
"lua_code": str, # Complete Lua source code
"token_count": int, # Approximate PICO-8 token count
"char_count": int, # Character count of Lua code
# --- Quality flags ---
"has_init": bool, # Has _init() function
"has_update": bool, # Has _update() or _update60() function
"has_draw": bool, # Has _draw() function
"is_duplicate": bool, # Exact code duplicate of a higher-starred cart
# --- Visual data ---
"spritesheet": Image, # 128x128 RGB spritesheet (PICO-8's 16-color palette)
"label_image": Image, # 128x128 cart label screenshot (if captured by dev)
"map_image": Image, # Rendered tile map using spritesheet (if map data exists)
# --- Raw data (for lossless roundtripping) ---
"gfx_hex": str, # Raw spritesheet as hex digits
"map_data": list[int], # Raw tile indices (uint8)
"sprite_flags": list[int], # Raw sprite flags (uint8)
"sfx_hex": str, # Raw sound effect data
"music_hex": str, # Raw music pattern data
}
Quick Start
from datasets import load_dataset
ds = load_dataset("Fraser/pico-8-games")
# Browse the top games
top = ds["train"].sort("stars", reverse=True)
for row in top.select(range(10)):
print(f"{row['title']:30s} {row['stars']:4d} stars by {row['author']}")
# Filter to high-quality, unique, CC4-licensed games
hq = ds["train"].filter(lambda x: (
x["stars"] >= 10
and not x["is_duplicate"]
and x["has_init"] and x["has_update"] and x["has_draw"]
and x["license"] == "CC4-BY-NC-SA"
))
print(f"High-quality subset: {len(hq)} games")
Running a Cart
PICO-8 carts are playable games. To run one:
1. In the browser — Visit the thread_url for any cart and click "Play" on the BBS page.
2. With PICO-8 ($15, lexaloffle.com) — Reconstruct the .p8 text file:
row = ds["train"][0]
# Build the .p8 file from dataset columns
p8_text = "pico-8 cartridge // http://www.pico-8.com\nversion 42\n"
p8_text += f"__lua__\n{row['lua_code']}\n"
p8_text += f"__gfx__\n{row['gfx_hex']}\n"
# Add map data (convert byte array back to hex lines)
map_bytes = row["map_data"]
if map_bytes:
p8_text += "__map__\n"
for y in range(0, len(map_bytes), 128):
line = "".join(f"{b:02x}" for b in map_bytes[y:y+128])
p8_text += line + "\n"
# Add sprite flags
flags = row["sprite_flags"]
if flags:
p8_text += "__gff__\n"
p8_text += "".join(f"{b:02x}" for b in flags) + "\n"
p8_text += f"__sfx__\n{row['sfx_hex']}\n"
p8_text += f"__music__\n{row['music_hex']}\n"
with open("game.p8", "w") as f:
f.write(p8_text)
# Then: pico8 -run game.p8
Extracting Components
Render the spritesheet
Each cart's spritesheet is a 128x128 image using PICO-8's fixed 16-color palette. It's stored both as a rendered PNG and as raw hex for lossless access.
# The spritesheet is already a PIL Image
row = ds["train"][0]
row["spritesheet"].save("sprites.png")
# Or parse individual 8x8 sprites from the hex data
gfx = row["gfx_hex"]
lines = gfx.strip().split("\n")
# Each hex digit = one pixel (4-bit color index)
# Sprite 0 is at (0,0), sprite 1 at (8,0), ..., sprite 16 at (0,8)
sprite_id = 42
sx = (sprite_id % 16) * 8
sy = (sprite_id // 16) * 8
for y in range(8):
row_pixels = lines[sy + y][sx:sx + 8]
print(row_pixels) # e.g. "00770700" — each digit is a color index
Extract the tile map
The map is a grid of tile indices referencing sprites from the spritesheet:
import numpy as np
from PIL import Image
PICO8_PALETTE = [
(0,0,0), (29,43,83), (126,37,83), (0,135,81),
(171,82,54), (95,87,79), (194,195,199), (255,241,232),
(255,0,77), (255,163,0), (255,236,39), (0,228,54),
(41,173,255), (131,118,156), (255,119,168), (255,204,170),
]
row = ds["train"][0]
map_data = row["map_data"] # flat list of uint8 tile indices
# Reshape to 32 rows x 128 columns (some carts use 64 rows, sharing sprite memory)
width = 128
height = len(map_data) // width
tiles = np.array(map_data).reshape(height, width)
print(f"Map size: {width}x{height} tiles = {width*8}x{height*8} pixels")
print(f"Unique tiles used: {len(np.unique(tiles))}")
Parse sound effects
Each SFX slot contains 32 notes. The hex format encodes pitch, waveform, volume, and effect per note:
row = ds["train"][0]
sfx_lines = row["sfx_hex"].strip().split("\n")
for i, line in enumerate(sfx_lines[:4]): # First 4 SFX
# First 2 chars: editor mode, next 2: speed, next 2: loop start, next 2: loop end
header = line[:8]
notes = line[8:]
speed = int(header[2:4], 16)
print(f"SFX {i}: speed={speed}, {len(notes)//5} notes")
# Each note is 5 hex chars: pitch(2) waveform(1) volume(1) effect(1)
Parse music patterns
Music patterns sequence up to 4 SFX channels together:
row = ds["train"][0]
music_lines = row["music_hex"].strip().split("\n")
for i, line in enumerate(music_lines[:8]):
# Each line: 2 flag chars + 4 channel values (2 hex chars each)
flags = int(line[0:2], 16)
channels = [int(line[2+j*2:4+j*2], 16) for j in range(4)]
# Bit 0-2 of each channel byte: loop flags; bits 6+: SFX index (0-63, 65+ = off)
ch_display = [f"sfx {c & 0x3f}" if c < 65 else "---" for c in channels]
print(f"Pattern {i}: {' | '.join(ch_display)} flags={flags:08b}")
Quality Distribution
| Star Tier | Count | % |
|---|---|---|
| 0 stars | 858 | 7.8% |
| 1-4 stars | 4,049 | 36.8% |
| 5-9 stars | 2,653 | 24.1% |
| 10-49 stars | 2,868 | 26.0% |
| 50-99 stars | 206 | 1.9% |
| 100-199 stars | 246 | 2.2% |
| 200+ stars | 133 | 1.2% |
Suggested quality tiers for downstream use:
- Featured (200+ stars): 133 exceptional games — Celeste, POOM, Porklike, etc.
- High quality (50+ stars): 585 polished, community-recognized games
- Solid (10+ stars): 3,453 games that found an audience
- Full corpus: 10,967 games including experiments, demos, tools, and art
Use is_duplicate=False to exclude 53 carts that are exact code copies of higher-starred originals (mostly Celeste/Jelpi mods).
About PICO-8
PICO-8 is a fantasy console by Lexaloffle — a deliberately constrained environment for making tiny games:
- Display: 128x128 pixels, 16 fixed colors
- Code: Lua subset, max 8,192 tokens / 65,535 characters
- Sprites: 256 8x8 sprites on a 128x128 sheet
- Map: 128x32 tiles (or 128x64 sharing sprite memory)
- Sound: 64 SFX slots, 64 music patterns, 4 channels
- Input: 6 buttons (directional pad + O/X)
Every game's complete source code, art, sound, and music fits in a single .p8.png file — a 160x205 PNG with data steganographically encoded in the least significant bits.
How This Dataset Was Built
- Index: Scraped all ~368 pages of the PICO-8 BBS Releases category
- Download: Fetched 10,999
.p8.pngcart files (14 were unavailable) - Parse: Converted each cart to
.p8text format using shrinko8, then extracted all sections - Render: Generated spritesheet and map PNGs using the PICO-8 palette
- Quality: Computed entry point flags, duplicate detection, and star/engagement metadata
Data was collected in March 2026. The scraper respected rate limits (1.5s between requests) and identified itself via User-Agent.
Citation
@dataset{pico8games2026,
title={PICO-8 Games Dataset},
author={Fraser Greenlee},
year={2026},
url={https://huggingface.co/datasets/Fraser/pico-8-games},
note={10,967 PICO-8 cartridges from the Lexaloffle BBS}
}
License
71% of carts in this dataset are released under CC4-BY-NC-SA by their authors. The remaining 29% have no explicit license specified. Filter on the license column for your use case. The dataset metadata and tooling are released under CC-BY-NC-SA-4.0.
- Downloads last month
- 52