Yarr! There be a treasure on these isles! Only the bravest triangulators can find!

Controls:

  • Arrow keys to move
  • Z or C to dig and find out how faraway the treasure is.

Goal:

  • Find the treasure (X mark the spot!) by digging around.
  • For added challenge, find the treasure in 3 or less digs!

Code

Game (549 chars):

n,r=circfill,rnd
cls(15)for i=0,30do
a=r()l=r(48)c=cos(a)*l+63s=sin(a)*l+63n(c,s,r(8)+8,9)end
for i=0,9999do
x=r(128)y=r(128)for e=0,.9,1/4do
j=pget(x+cos(e),y+sin(e))
if(j!=9)n(x,y,1,j>9and 15)end
end
memcpy(0,24576,7^5)g=9f=9d=9t=0q={}::_::p=btn()g+=(p&2)/2-(p&1)f+=(p&8)/8-(p&4)/4
if(btnp(4))d=sqrt((g-c)^2+(f-s)^2)+r(5)add(q,{g,f,d})
for z in all(q)do
circ(z[1],z[2],z[3],7)end
if(#q>3)deli(q,1)
if(t%3<1)sset(g,f,8)
flip()spr(0,0,0,16,16)t+=1
if(d>3)goto _
for j=-1,1do
for k=-1,1do
c+=j
s+=k
line(c-5,s-5,c+5,s+5,8)line(c-5,s+5,c+5,s-5)end
end::w::goto w

Original Tweetcart (274 chars):

cls(15)for i=0,30do
a=rnd()l=rnd(48)c=cos(a)*l+63s=sin(a)*l+63circfill(cos(a)*l+63,sin(a)*l+63,rnd(8)+8,9)end::_::if t()<.4then
x=rnd(128)y=rnd(128)o=flr(rnd()*4)/4for e=0,.9,1/4do
j=pget(x+cos(e+o),y+sin(e+o))
if(j!=9)circfill(x,y,1,j>9and 15)end
else
?"⁙",c,s,8
end
goto _

Difficulty

To modify the game's difficulty (Normal default), swap out this line of code:

EASY
if(btnp(4))d=sqrt((g-c)^2+(f-s)^2)+r(2)add(q,{g,f,d})
NORMAL
if(btnp(4))d=sqrt((g-c)^2+(f-s)^2)+r(4)add(q,{g,f,d})
HARD
if(btnp(4))d=sqrt((g-c)^2+(f-s)^2)+r(7)add(q,{g,f,d})
EXTREME
if(btnp(4))d=sqrt((g-c)^2+(f-s)^2)+r(9)add(q,{g,f,d})

Made for #TweetTweetJam5

StatusReleased
PlatformsHTML5
Rating
Rated 4.8 out of 5 stars
(14 total ratings)
AuthorMunro
GenrePuzzle
Made withPICO-8
Tags2D, PICO-8, Pirates, Pixel Art, Procedural Generation

Comments

Log in with itch.io to leave a comment.

Nice! Great concept, really well done visuals.

This is so fun for a small amount of code. Very nice work!

Thank you!

Map generation looks great. It'd be cool if the X wasn't always on the circle, it kind of makes it too easy to locate.

It seems like the X is always on land, which is pretty cool.

thanks for the feedback. I removed some vestigial code and was able to add a randomized amount to the radius and a limit of 3 beacons at once. should make the game much tricker!

Very cool! Now it feels a lot more like triangulating the treasure.

This is great (and fun to play!). Love the tattered map effect! 😉

Thanks! That actually was a happy accident when making the original!

Love this! Visuals are absolutely spot on, excellent entry!

Thanks!

(1 edit)

Wow, the visuals are great for a tweetcart!

Thanks! It's a surprisingly effective yet simple technique for generating coastlines.