Play game
Etch A Sketch (Pico-1k Jam)'s itch.io pageCompressed Bytes used
385
Source Code (OPTIONAL)
function _init()
e={x=4,y=16,w=120,h=100}
n={x=e.x+e.w/2,y=e.y+e.h/2}
i=0
d=true
end
function _update()
if(btn(0))n.x-=1
if(btn(1))n.x+=1
if(btn(2))n.y-=1
if(btn(3))n.y+=1
n.x=mid(e.x,n.x,e.x+e.w)
n.y=mid(e.y,n.y,e.y+e.h)
if(btnp(5))i=15f()
if(i>0)i-=1
end
function _draw()
if i>0then
camera(rnd(5)-2,rnd(5)-2)
g()
else
camera(0,0)
if d then
g()
d=false
end
pset(n.x,n.y,1)
end
end
function f()
rectfill(e.x,e.y,e.x+e.w,e.y+e.h,0)
d=true
end
function g()
rectfill(0,0,127,127,8)
rectfill(e.x,e.y,e.x+e.w,e.y+e.h,6)
rect(e.x-1,e.y-1,e.x+e.w+1,e.y+e.h+1,5)
?"\^wetch a sketch",13,2,10
?"by:potatopasty",37,9,10
?"⬅️➡️⬆️⬇️: draw ❎: clear",5,120,10
end
Leave a comment
Log in with itch.io to leave a comment.
Comments
Love the shake effect!
I think you could make this even smaller. Hope you don't mind, but I fiddled around with the code a bit, and got the core drawing area to ~260-chars.
I think with some bitmasking fun, the btn calls could be compressed even further, if you wanted to try to turn this into a Pico-1/4k demo :)
Absolutely, fiddle away! I don't mind at all. I'm sure it's possible to make this much smaller, and I'll learn more too. ☺️
Was looking at some of the other entries, and saw the btn-parsing code in WeeblBull's1k-dailhex. Using that, and adding back in the label text, it still Shinko-8s into 264 characters, a tweetcart!
Switched to the "o" button instead of the "x" button for the clear input, since its place in the btn() bitfield is 16, just one off from the number of frames for the shake, so I didn't need a separate constant for that.
Other big difference between this and yours, is that I'm use modular arithmetic instead of mid to constrain things to the field. Saves a few characters.
That's fantastic! And shake animation is even better.
Ah.. the memories... 😊
This was a lot of fun - great recreation (esp. in such small size).
The "shake" effect is simply... 😚👌
Great entry 👍
P.S. - I tried to represent the Jam in in etch and... kinda failed 😅
Thank you for your kind words. And fantastic drawing, it made my day!😊
Always loved an Etch-A-Sketch. I only wish there was a way to go really slow, like pixel by pixel or something. I found it pretty hard to stop my lines where I wanted.
I also kind of wish it replicated the x and y separation aspect of the original, I remember a lot of frustration trying to get a nice diagonal line. Though I guess this is tough given the pico-8s limited input.
Was very happy to see the shake on clear!
Overall a lovely entry!
Thank you so much for the nice and kind comment. 😊
Making the drawing speed slower is a good point. And something I didn't even considered. I was never good with real etch a sketch, no matter how slow or fast I tried to draw.
But I agree about the controls. This would be very nice project for example with Arduino, nice display and two potentiometers... And movement sensor for clearing!