Log In  
Page:
1
2
3
4
5
6
7
8


Cart #23842 | 2016-06-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
60

better etchasketch! ~118 characters (110 w/o clear-screen or random color)

cls()
x=0 y=0
while 1 do
if(btn(0)) x-=1
if(btn(1)) x+=1
if(btn(2)) y-=1
if(btn(3)) y+=1
pset(x,y,7+rnd(9))
flip()
end
60


random circles might be fun too :)


9

Cart #23833 | 2016-06-29 | Code ▽ | Embed ▽ | No License
9

t=0 while true do t+=1 cls(1) for x=0,63 do for y=0,63 do
pset(x*2+y%2,y*2,8+(t/16+((x-32)/(y-32)))%8)  
end end flip() end

Cool!

You can just do "if(btn(0))x-=2", btw!
I'll have to try making something like this too, haha.
Also, thanks for retweeting my thing the other day!


1

ok here's a weird version of the etchasketch that makes a fat worm thing

Cart #23843 | 2016-06-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

cls()
x=0 y=0
while 1 do
if(btn(0)) x-=1
if(btn(1)) x+=1
if(btn(2)) y-=1
if(btn(3)) y+=1
circ(x,y,rnd(6),7+rnd(9))
flip()
end

You can save 4 chars by getting rid of spaces in lines 4-7.


0 chars left.

cls()
x=0y=0
while 1 do
if(btn(0))x-=1
if(btn(1))x+=1
if(btn(2))y-=1
if(btn(3))y+=1
circfill(x,y,sin(time())*3+5,7+sin(time())*5)
flip()
end

Alternatively:

cls()
x=0y=0t=0
while 1 do
t+=.03
if(btn(0))x-=1
if(btn(1))x+=1
if(btn(2))y-=1
if(btn(3))y+=1
circfill(x,y,sin(t)*3+5,7+sin(t)*5)
flip()
end

whoa thats fuckin righteous :D love it! creates freaky noby noodles <3 so good

uploaded a cart of it!



Aww, thanks!
But it's still mostly your code, haha.


What is the benefit of calling flip() here?


im trying to shave 70 characters off of this:

p={0x00,0x50,0x05,0x56,0x65,0x66,0x76,0x77}
t=0
t+=0
cls()
for x=0,64 do
for y=0,120 do
   c=p[flr((rnd(4)+4-(((x - 32)^2+(y/2 - 28)^2))/(abs((64-t%128))+192))+1)]
   poke((0x6000+x+(y*0x40)), c)
end
end
flip()

also, it seems to run only once then quit, so I might not understand how the first program in this thread works :P

edit - aaah I have to put the "while" to keep it going :P
edit edit - I also dont need to flip because im poking


11

Cart #23852 | 2016-06-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
11

t=0
function _draw()
cls()x=64 y=64 r=1 a=0
for i=0,150 do
 circfill(x,y,r/2,6+i%3)
 x+=cos(a)*r y+=sin(a)*r
 r+=1/4 a+=t/5
end
t+=0.001
end

flip() is being called inside a while loop to draw the backbuffer to the screen. i havent actually counted characters to see if "while 1 do // flip() end" is less than the more proper "function _draw() // end" - they're pretty close so probably not saving much at this point?

ok i just counted and function _draw() saves 1 character!

trust zep to do it right <3

UPDATE - if you don't have to call flip() (because poke, memset, etc) then its def less space to just do "while 1 do /**/ end"


This is a great idea!
Here is a weird static thing. I think it fits in 140 characters?

Cart #23855 | 2016-06-29 | Code ▽ | Embed ▽ | No License

cls()
while 1 do
memset(0,rnd(3)+5,16)
spr(0,rnd(256),rnd(256))
memset(0x3200,rnd(3)+5,128)
sfx(1)
end

whoa thats awesome :D


2

Cart #23858 | 2016-06-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2


haha static all over today :p

p={0x00,0x50,0x05,0x56,0x65,0x66,0x76}t=0
while 1 do t+=0
for x=0,63 do for y=0,127 do
poke((0x6000+x+(y*0x40)),p[flr(rnd(7))])end end end

A slightly different one, sounds like a broken computer :D

Cart #23859 | 2016-06-29 | Code ▽ | Embed ▽ | No License

cls()
while 1 do
memset(0,rnd(16),16)
spr(0,rnd(128),rnd(128))
memset(0x3200,rnd(256),128)
sfx(1)
end

Oh, Mozz yours looks much more authentically static than mine!


I really like how "smooth" that effect looks in yours though!


yea im expecting a lot of rnd based screensavers for this, button input just dominates your code otherwise. i wanna try some one-button stuff tho, thats at least interactive and still leaves lots of code space...

like these programs that just go straight to the front buffer too :D LIVIN LIFE ON THE EDGE

hmmm

how close can i get to canabalt-esque runner


Oh good idea with one button


here's a little jumping circle hmmmm

x=-4y=0j=0
function _draw()
cls()
if(btnp(2))j=-10
j+=1
y+=j
y=min(99,y)
circfill(10,y,4,11)
x-=2
if(x<-4)x=99
circfill(x,99,4,12)
end

updated to add a little obstacle hrrmmm

would be more efficient to make it run upside down haha


A kind of controllable one

Cart #23868 | 2016-06-29 | Code ▽ | Embed ▽ | No License

x=2
while 1 do
if(btnp(4))x+=0.01
if(btnp(5))x-=0.01
y=rnd(abs(x))
memset(0,y,y)
spr(0,rnd(128),rnd(128))
memset(0x3200,y,128)
sfx(1)
end

Whoops, makes more sense if it's btn instead of btnp :P


kind of a proto-Helicopter in 139c

x=-4y=64r=0
function _draw()
cls()
y+=1
if(btn(2))y-=2
circfill(10,y,3,11)
x-=2
if(x<-4) then x=123r=10+rnd(108) end
circfill(x,r,9,12)
end

4

Cart #23872 | 2016-06-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

while 1 do
print("")
for i=0,3 do
z=time()
t=sin(z-i*.25)*4
camera(0,sin(t/180)*50)
circfill(64+sin(z+i*.15)*55,100,t+7,10+t)
end
flip()
end

7

Cart #23875 | 2016-06-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
7

while 1 do 	
for x=8127,0,-1 do
o=0x6000+x
v=peek(o)
if(v!=0)then
if(peek(o+64)=0)then
poke(o+64,v)
poke(o,0)
end
end
end
end

Oh my god that's really great


NIIIIICE!!



s=-9
function _update()
c1=flr(rnd(16))
if btn(4) and c1==8 then
s+=1
end
end
function _draw()
cls()
print("<3",60,s,8)
circ(64,64,9,c1)
end

Taking a stab at this with something super simple. When the circle and heart are the same color, press the button(4) and they come together... or just hold the button down.


2

Cart #23889 | 2016-06-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

This thread is absolutely lovely so I made this.

function _draw()
for x=0,127 do
for y=0,127 do
c=pget(x-2,y-2)
if c>0 then
 c+=flr(rnd(9)/8)
 pset(x+rnd(3)-1,y+rnd(3)-1,c)
end
end
end
end

1

Cart #23891 | 2016-06-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

a=64
camera(-a,-a)b=1
c=1
t=0
function _draw() for i=0,16 do
d=(t/4+i*8)%128
line(a*b,a*b-d*b,a*c-d*c,-a*c,i)b=-b
if(b<0)c=-c
end
t+=1
end

138/140
nothing fancy


3

Cart #23894 | 2016-06-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3


pretty cool thread

t=0 bt=1 c=0 l=127
while 1 do
bt+= (btn(4) and 2 or -1)
for t=1,l do
c=1+(bt+t/5)%15
line(t,0,l-t,l,c)
line(0,l-t,l,t,c)
end
flip()
end

hold <z> to reverse the rotation
135/140


Cart #23897 | 2016-06-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

while 1 do
t=time()
s=(sin(t/5)+1)/2*40
memcpy(24576,24643,8128)
memset(32704,0,64)
line(s,127,128-s,127,s+sin(t*(t*.001))*6)
flip()
end

1

Cart #23906 | 2016-06-30 | Code ▽ | Embed ▽ | No License
1

Here's another:

b=0 l=99 a={7,6,5,0}
function _draw()
b+=.5
for t=1,l do
c=flr(1+(b+t/4)%#a)
p=(b+t)/30
circfill(63+4*sin(p),63+4*cos(p),l-t,a[c])
end
end

138/140


2

Cart #23909 | 2016-06-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2


This is an awesome thread so I thought I'd join in. This is just drawing a line between points on two circles rotating at different speeds. 134/140 chars.

cls()
t=0
c=1
while 1 do
m=64
x=30*cos(t)
y=30*sin(t)
z=60*cos(1.5*t)
w=60*sin(1.5*t)
line(m+x,m+y,m+z,m+w,c)
t+=0.00003
c+=0.0003
end

4

Cart #23919 | 2016-06-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4


Having fun with lissajous. Had to really cut it down to make it work.

t=0k=64
function _draw()cls()t+=.05
for i=1,k do
x=k+cos(i/10+t)*k/2
y=k+sin(i/20+t)*k
d=sin(i/10+t)
circ(x,y,4+d,12)circ(x,y,2+d,7)
end
end

5

Cart #23921 | 2016-06-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

i=0
function _draw()
i+=.01
y=24576
memcpy(y,y+(sin(i/3)+sin(i))*4,7200)
for t=y+7296,y+8190,2 do
memset(t,rnd(2)+i,2)
end
end

127 characters


I've been loving going through these experiments! I started fooling around with drawing circles of different sizes and colours with small random offsets and ended up with a thing that looks like a cartoon smoke trail for fireworks or something. :)

Cart #23930 | 2016-06-30 | Code ▽ | Embed ▽ | No License

cls() x=64 y=64 c=7 s=7
function _draw()
x=(x+rnd(6)-3)%128
y=(y+rnd(6)-3)%128
c=(c+rnd(2)-1)%16
s=(s+rnd(2)-1)%12
circfill(x,y,s,c)
end

136 chars


4

Cart #23933 | 2016-06-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

i=0
function _draw()
i-=1
for x=0,37,.5 do
for y=0,11,.1+x%1 do
pset((i+x*3)%128,23+y*8+sin((x+i)/50)*5,pget(x,y))
end
end
end

127 characters.


@solar:

Great idea using the system logo. :)

I played around a bit to see if I could get the character count down. I had to change the look a bit, but technically you can get a similar effect in 99 chars if you use this and don't hit enter. :)

i=0 function _draw()i+=1 for a=0,6559 do poke(a+25698,pget((a+i)%64,sin((a-i)/64)+a/512)*17)end end

If you wanna be a stickler for formatting, the prettified code is 106 chars. :)

All credit to you for the idea, though. I'm just a relentless approximating optimizer.


Cart #23937 | 2016-06-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

i=0
n=12800
m={221,210,3,0,0,151,200,0}
function _draw()
i+=1
if i%4==0 then
a=i/4%8+1
if(btn(4))m[a]=rnd(n)
memset(n,m[a],n)
sfx(1)
end
end

140 characters.

WARNING, if you download this: This code has the absolute nerve to go overwriting a heap of RAM that it doesn't need to, and usually makes PICO-8 unusable afterwards. If you do run it... once you've hit escape, you can blindly type "reboot" and hit enter to reset.

This one extends on the idea above where we generate SFX on the fly. This loops over an array of 8 SFX setups, on loop. If you press Z during the moment an SFX starts to play, the setup for it will be randomised. So basically you build up a whacky beat by pressing Z at appropriate moments.

@Felice:

That's some impressive looking optimisation!


6

Cart #23942 | 2016-06-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

poke(24364,5)while 1 do t=time()line(63,0,63,128,8+sin(t)*sin(t/10)*7)for a=0,63 do for b=0,128 do pset(a-rnd(2),b,pget(a,b)/.67)end end end

3

Cart #23945 | 2016-06-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

i=0
function _update()
cls()for y=0,128,6 do
for x=0,128,1 do
line(x+(cos(i)),y,x+sin(x/y+i)*3,y+cos(y/x+i)*3,9)
i+=x*y/20000
end
end
end

6

Cart #23947 | 2016-06-30 | Code ▽ | Embed ▽ | No License
6

t=0 function _draw()cls(2)t+=0.01 for k=0,16 do for n=1,9 do h=k/16+t circ(64+cos(h+t/3)*n*8,64+sin(h)*(n*n+cos(t)*16),n,11-n/3)end end end

All of those are f'n rad


1

Cart #23950 | 2016-06-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1


129/140

poke(24364,7)
t=0
while 1 do
x=20*cos(t)
y=20*sin(t)
z=50*cos(0.3*t)
w=50*sin(0.3*t)
line(30+x,30+y,30+z,30+w,t*2)
t+=0.00003
end

8

Cart #23953 | 2016-06-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
8

function _draw()p={1,1,13,12,14,15,7}cls()srand(0) for i=0,256 do z=flr(i/40+1)circfill((rnd(128)-time()*z*z)%140-8,rnd(128),z,p[z])end end

A bit lame but I thought I'll join you!


2

Cart #23956 | 2016-06-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

t=0
while 1 do
t+=.2
for y=0,32 do
for x=0,32 do
o=x*y*.1+t
c=cos(o)*4
s=sin(o)*4
x=x*4
d=y*4
line(x+c,d+s,x-c,d-s,8+(o/3)%7)
end
end
end

8

Cart #23960 | 2016-06-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
8

for i=12868,12935 do
poke(i,i)end
sfx(1)c=0	poke(24364,7)function _draw()cls()for i=49,95 do
circ(cos(c+i/43)*i,c^4,i,i%8+8)end
c-=0.003
end

Page:

[Please log in to post a comment]