function _draw()for x=0,63 do for y=0,63 do k=rnd(3)-1 a=x*2+k b=y*2+k c=pget(a,b) c+=flr(rnd(9)/8) pset(a+rnd(3)-1,b+rnd(3)-1,c)end end end |
Warning: This contains flashing colours.
c=0 t=0 function _draw() for i=124,4,-4 do a=64-i b=64+i rect(a,a,b,b,c) c=(c+1)%16 end t+=0.01 x=cos(t)*9 y=sin(t)*9 camera(x,y) end |
t=0 while 1 do cls() for i=0,14 do y=84+4*sin(t+i/15) rectfill(i*9-5,0,i*9+5,y,7) circfill(i*9,y,5) end circ(25,25,15,0) t+=.01 flip() end |
The character limit pretty much forces you to make something abstract, but I wanted to try and make a scene of some sort. :)
t=0 c=0 x=3 y=4 function _update() t+=.008 cls() for i=16,0,-1 do c+=1 circ(64+cos(t)*x*i,64+sin(t)*y*i,i,c%16) end end |
Here's my humble contribution to this great thread.
waterfall
cls()t={}w=128 function _draw()for i=1,w do y=t[i] if(y==e)y=flr(rnd(w))-9 rect(i,y,i+2,y,({1,7,12})[flr(rnd(3))+1])t[i]=y+1 end e=w end |
This takes advantage of the fact that comparing two nil values together is true to initialize a table on the first pass inside the draw loop!
125
t=0 m=12 function _draw()t+=0.05 for n=0,m*m do x=n%m y=n/m circfill(x*12,y*12,12+4*cos(t+y/5)+4*sin(t+x/7),8+(x+y)%8)end end |
edit: forgot to replace a few 12's with "m" to save 3 more chars :P
function _draw()for x=0,63 do for y=0,63 do k=rnd(3)-1 a=x*2+k b=y*2+k rectfill(a-1,b-1,a+1,b+1,pget(a,b)+flr(rnd(99)/98))end end end |
c=0
s=0
f=0
while 1 do
v=(c/4032cos(s))(f/4+cos(f/5)*f/4)
poke(0x6000+c,v-rnd(1))
c+=1
s+=.01551+0x6000
if(c>128*63)then c=0
f+=0.1 end
end
Not tweet length, sadly >:(
cls()
c=0
f=0
while 1 do
for x=1,128 do
for y=10,80 do
r=rnd()
p = pget(x,y)
pn = pget(x+1,y)
if(pn~=0 and p==0)then
if(r<.8)pset(x,y,pn)
else pset(x,y,p.99(y/128)) end
end
end
c+=1
circfill(120,50+cos(f)25,r3,7)
if(c>5)then f+=rnd(.02)
end
end
I decided I wanted to try to make something that was somehow interactive. Here's my tweet-length "RPG" (ha).
You press "Z" to "attack" and then the monster attacks. Monster HP on the left, your HP on the right. Attack until one of you (or both) is dead. If you run this in the PICO-8 app, it'll quit back to the command line after it ends. But in the cartridge version I guess it's perma-death. ;)
u=8 m=6 cls()function _draw() if btnp(4) then m-=flr(rnd(3)) u-=flr(rnd(4)) print(m..":"..u) end if(m<=0)print(":)") if(u<=0)print(":(") end |
I had a version that displayed a bit more information to the player, but had to remove it to fit in 140 chars. :D
Owen
m=128 function _draw() for k=0,m^2 do x=k%m y=k/m d=pget(x,y) if(d==0)pset(x,y,pget(x+rnd(2)-1,y+rnd(2)-1))end end |
s=0 x=64 _=127 while x>0 and x<_+1 do memcpy(24576,24640,8128)pset(x,_,0)x+=4-rnd()*8 pset(x,_,-abs(64-x)/8)flip()s+=1 end print(s.." \135") |
140/140
Which side will win, right or left? What will your final score be? Never before have video games been as tense and exciting as this!
Always changing
cls()poke(0x5f2c,7)a=0 n=2 function _draw()for i=64,0,-(n%7) do s=64-abs(sin(a)*i)circfill(s,s,i,i%2)a+=0.001 end n+=0.002 end |
As seen in Terminator 2: Judgement Day
cls()poke(0x5f2c,6)a=0 function _draw() for i=64,0,-3 do circ(64-(sin(a)*i),64+cos(a)*i,i,i)a+=0.001 end end |
Classic 3d ribbon effect in a bite-sized package :)
t=0k=256 function _draw()cls()t+=.01 for y=0,k do v=9*sin(t+y/k)d=9*sin(t+v/k)x=v+d+48 rect(x,y,x+32,y,2)rect(x+d,y,x+d+32-d*d/9,y,8)end end |
Exactly 140 :)
Press <z> to flap. Quite playable for the size IMO. Try to finish the level without hearing a single crash sound.
d=16 w=64 x=0 y=0 function _draw() x+=2 x%=d*w cls()map(0,0,-x,0,d*d,d)spr(0,w,y)y+=1 if(fget(mget((x+w)/8,y/8),0))sfx(0) if(btn(4))y-=6 end |
I hope using sprites is not cheating ;)
I couldn't quite do what I wanted in one tweet, so I used two (heresy!)
function r(a) return flr(rnd(a)) end function n(a,b) return {a,b,(r(4)+1)*(2*r(2)-1),(r(4)+1)*(2*r(2)-1),r(15)+2} end a={n(9,9)} function _draw() cls() for b in all(a) do b[1]+=b[3] b[2]+=b[4] if (b[1]>120 or b[1]<8) b[3]*=-1 if (b[2]>120 or b[2]<8) b[4]*=-1 circfill(b[1],b[2],3,b[5]) end add(a,n(a[1][1],a[1][2])) end |
edit: tweets are 140 not 160 chars. Failure on all accounts :)
function _draw() cls() if rnd(7)<1 then x2=rnd(128) for j=0,4 do x=x2 for i=0,15 do l=x x+=rnd(30)-15 line(x,i*9+9,l,i*9,10) end end end end |
A classic C64 oneliner, now with LINEs
while 1 do for x=0,22 do a=flr(rnd(2)) line((x+a)*6-a,122,(x+1-a)*6,128) end print("") end |
exactly 140 char long
a={"__","--","==","()","<>","()","{}","..","`'"} while 1 do for x=0,20 do c=flr(rnd(999)) print(a[c%#a+1],x*8,122,c) end if(c<1)print"" end |
memcpy(0,24591,336)cls()sset(0,5)t=0::_::for i=0,15 do for j=0,15 do for k=8,15 do pal(k,i+j+k+t)end spr(0,8*i,8*j)end end t+=1 flip()goto _ |
137/140
If I only had two more characters I'd be able to fit in a cls() and fill the entire screen.
Edit: was able to squeeze in a cls() by using goto
@Alberton: oh man, that's genius. If it wasn't for the character limit you could probably do something nice with this by combining it with the secret wide characters (\130,\140 etc).
Just had to try and extend Alberton's tileset maker with some of the extra-wide characters. 325/140 (lol)
@qbicfeet I like it!
Here is a screenshot from my second attempt, exceeding the 140 char limit.
There are frogs, buckets, rings, cakes, rockets/darts and a lot of exciting being.
for a,b in pairs({1,5,13,6,7}) do pal(a,b) end while 1 do x=rnd(128)-64 y=rnd(128)-64 c=max(0,5-(x*x+y*y)/600+rnd()) circ(x+64,y+64,4,c) end |
I stole kometbomb's method and made a tribute to my home city:
function _draw()cls(1)srand()for i=0,296 do z=i/99+11 x=(rnd(128)-time()*z*z)%133 y=(rnd(128)-x)%128line(x,y-z,x-z,y+z,z-6)end end |
130 chars
a={7,6,13,5,1,0} cls() t=0 while 1 do x=rnd() j=x+t/1000 y=rnd(60) c=flr(x*x*5+y*y*.0015+1) circ(cos(j)*y+64,sin(j)*y+64,4,a[c]) t+=0.05 end |
@NuSan: You could probably make a pretty good fire with that method if you change the math and the palette a little.
s=0 o=1 while 1 do o-=.001 if(o<1) then o=99 cls() print(s,9,4,7) end if(btn(4)) then if(o<9 and o>2) s+=1 o=1 end print("^",9,o,8) end |
140 characters on the button. I wanted to make a game that involved reflexes and scoring. It ended up being very, very simple.
uuuuhhhh these are all absolutely incredible and i personally love each of you
o={">","z","/"} c=0 ::z:: b=-8 c+=1 p=o[c%3+1] ::s:: for y=0,26 do for i=0,13 do print(p,b+i*12,y*5,i+c) end end b+=.04 if(b>4)goto z goto s |
x=64w=128 cls()circfill(x,x,32,8)circfill(x,x,16,0)circfill(x-16,x-16,8,7) for i=0,w do j=sin(i/255)*28line(i,0,i,x+j,5)line(i,x-j,i,w,5)end |
cls()b=128 x=b y=b d=0 while 1 do x+=cos(d) y+=sin(d) if pget(x,y)==0then d=rnd(1)end if d%(b*b)>.87then x=70 y=b end pset(x,y,d*4+7) end |
137 chars.
I wanted to make a self-playing breakout at first but couldn't fit it below 200 chars, so here's a stripped version :)
well after last night's experiement I had to make a proper one <140 chars - got it to 138 in the end :)
a=9 b=40 c=1 e=1 f=2 function _draw() for i=1,c do a+=e b+=f if(a>128 or a<0)e*=-1 if(b>128 or b<0)f*=-1 circfill(a,b,6,c%15) end c+=1 end |
Warning: flashing colours!
just made a simple noise thing, not using any random
r,m,b,p = 1,127,bxor,pget while 1 do for x=0,m do for y=0,m do pset(x,0,c) c = b(p(x,y)) c = b(c+p(x, y-1)) pset(x, y, c%3) end end end |
p={0x77,0x65,0x56,0x05,0x50,0x00} while 1 do x=rnd(64) y=rnd(127) c=p[flr(rnd(3)+((x-32)^2+(y/2-32)^2)/190)] poke((0x6000+x+(y*0x40)),c) end |
finally figured out how to put in this 'fading' effect on my static screen
I wish there was a way that I could fav carts through the bbs. Maybe there is, and I just don't know :9
t=0 function _draw()cls()for i=-70,15 do circ(64+cos(t*.5)*(i^2)*.015,64+sin(t*.7)*(i^2)*.01,(i+70),(i+t*100)%8+8)end t-=.01 end |
Edit, don't know how to insert a cart. i tried insert button, but it didn't work :(
s={} function _draw() cls() local o={} o.x=rnd(150) o.y=0 add(s,o) foreach(s, function(s) s.y+=1 s.x-=rnd(1) print('*',s.x,s.y,7) end) end |
139 character snow storm.
use the submit cart option from the forum main area, then insert that tag in a normal post!
Thanks Adam Atomic!
Tunnel thing like:
t=0 function _draw()cls()for i=-70,15 do circ(64+cos(t*.5)*(i^2)*.015,64+sin(t*.7)*(i^2)*.01,(i+70),(i+t*100)%8+8)end t-=.01 end |
Hello there, I ended up with this. I wanted first to play with sound but it took way too much characters...
t=0 while 1 do for y=16,128,32 do for x=0,128,16 do c=x/69+y/9+t rectfill(x,y+sin(t*2)*9,x+16*sin(c),y+21*cos(c),c)end end flip() t-=.04 end |
building on the snow from @jefferycampbell, I did a little parallax scrolling starfield.
exactly 140
t={}function _draw()cls()add(t,{s=rnd()*3.1,x=0,y=rnd(127)}) foreach(t,function(s)s.x+=s.s n=s.x>127 and del(t,s)pset(s.x,s.y,s.s+5) end)end |
edited to save a few characters and get better colors.
?"[music]" j=6::s::if stat(20)==-1 or j==6 then j+=1 n={0,3,5,7,10,12,15}for i=0,63 do poke(12868+i,n[1+(j+i^3)%7]+12*7)end sfx(1)end goto s |
what is this!?! Is that something specific to pico-8, or are you using the lua : operator?
j=6::s::if |
[Please log in to post a comment]