Log In  

Cart #onek_shooter-0 | 2023-02-10 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

This is a shooter I made with less than 1k compressed bytes

P#125677 2023-02-10 17:26

Good game, @scrapSavage. Gold star work.

Your code is 653-tokens in size and uses 1505 characters.

Here now I compressed it further to 637-tokens and 1353 characters.

β§—=-5::β™ͺ::😐="\\()/\n/`'\\"웃="(())\n('`)"⬅️={-1,1,0,0}⬆️={0,0,-1,1}➑️=60⬇️=64❎=0πŸ…ΎοΈ=0β˜…={}🐱={}β—†={}β˜‰=0β–€=1for i=1,96do add(β˜…,{x=rnd(128),y=rnd(128)})end function …(β–ˆ,x,y)return((x>=β–ˆ.x)and(y>=β–ˆ.y)and x<=β–ˆ.x+14and y<=β–ˆ.y+16)end::_::for i=1,4do if btn(i-1)then ❎+=⬅️[i]*0.5πŸ…ΎοΈ+=⬆️[i]*0.5end end ➑️+=❎ ⬇️+=πŸ…ΎοΈ for i=1,#β˜… do pset(β˜…[i].x,β˜…[i].y,5)β˜…[i].y+=4if β˜…[i].y>128then β˜…[i].y-=128end end for i=1,#🐱 do?(time()\1%2==0and 😐 or 웃),🐱[i].x,🐱[i].y,7
🐱[i].x+=🐱[i].v 🐱[i].y-=(🐱[i].y-🐱[i].t)/3if 🐱[i].x>112or 🐱[i].x<0then 🐱[i].v*=-1🐱[i].t+=14+(β–€-1)*4end if((➑️>=🐱[i].x)and(➑️<=🐱[i].x+16)and(⬇️>=🐱[i].y)and(⬇️<=🐱[i].y+14))then β§—=time()goto β™ͺ end if((➑️+14>=🐱[i].x)and(➑️+14<=🐱[i].x+16)and(⬇️+12>=🐱[i].y)and(⬇️+12<=🐱[i].y+14))then β§—=time()goto β™ͺ end if 🐱[i].y>=116then β§—=time()goto β™ͺ end end for i=1,#β—† do βŒ‚=β—†[#β—†+1-i]?"|",βŒ‚.x,βŒ‚.y,7
βŒ‚.y+=βŒ‚.v for o=1,#🐱 do a=🐱[#🐱+1-o]if …(a,βŒ‚.x,βŒ‚.y)then a.h-=1β˜‰+=5if a.h==0then del(🐱,a)β˜‰+=200break end βŒ‚.y+=βŒ‚.v-20end end end for i=1,#β—† do o=β—†[#β—†+1-i]if o.y<0then del(β—†,o)break end end for i=4,5 do if btnp(i)then for x=1,2do add(β—†,{x=➑️+(x-1)*12,y=⬇️,v=-8})end end end?"|/\\|\n<__>",➑️,⬇️,7
❎*=0.75πŸ…ΎοΈ*=0.75?"\^tscore: "..β˜‰,1,116
?"\^t\^iscore: "..β˜‰,1,116,0
if β§—+5>time()then?"\^iyou died",48,120,0
?"you died",48,120,7
end if#🐱==0then for r=1,β–€ do for i=1,6do add(🐱,{h=6,x=(i-1)*20,y=-256,t=-12-(r-1)*12,v=β–€*0.5*(r%2==0and 1or-1)})end end β–€+=1end flip()cls()goto _
P#125682 2023-02-10 18:40 ( Edited 2023-02-10 18:42)

Awesome, I totally forgot about ?"" and those other optimizations are great.

P#125686 2023-02-10 19:43

[Please log in to post a comment]