Log In  


Cart #dredds_billabong_ttj9-0 | 2024-05-17 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
6

This is my entry to TweetTweetJam 9, a game jam where games had to be written with at most 500 characters of code. I ended up using 484 characters.

Billabong is a two player strategy game. Players take turns to flood the maze with coloured liquid. One player fills the maze with red liquid, the other with blue. The player who fills the most of the screen with their colour wins.

To start flooding a channel, tap the screen if playing on a mobile device, or click with the mouse if playing on a desktop machine. The game works best on a mobile device so that the players don't have to share a single mouse.

The stats display at the bottom of the screen shows the players' scores and who has the next turn.

When a game is complete, reset the cart to play again with another random maze.

Because this was written for TweetTweetJam, some niceties had to be dropped to fit into 500 characters. There's no title screen, music or sound, and the game doesn't detect the end of the game and display the winner. Also, there wasn't room for a safety check to ensure that the flood-fill algorithm doesn't exhaust Pico-8's available memory, but this doesn't seem to cause a problem in practice.

Tip: you don't have to wait for the flooding to stop to take your turn. If you're quick (and don't get confused by the maze) you can use your liquid to block your opponent's flood.

The entire source code of the game is:

a=add
k=poke
t=stat
g=sget
k(24365,3)k(24405)cls(13)for y=1,122,5do
for x=1,122,6do?rnd{"◜","◝"},x,y,2
end
end
rect(0,0,127,121,6)k(24405,96)f={}s={0,0}p=1::_::px=t(32)py=t(33)if(btnp(5)and py<120and g(px,py)==13)a(f,{p,px,py})p=3-p
n={}while#f>0do
q,x,y=unpack(deli(f))if g(x,y)==13then
sset(x,y,4+4*q)s[q]+=1a(n,{q,x,y+1})a(n,{q,x,y-1})a(n,{q,x+1,y})a(n,{q,x-1,y})end
end
f=n
cls()spr(0,0,0,16,15.3)circ(px,py,1,7)x=?s[1],1,123,8
x=?chr(21+p),x+1,123,7
?s[2],x+1,123,12
flip()goto _
6


Pretty fun! Kind of reminds me of Blokus strategy. Good job!



[Please log in to post a comment]