Features:

  • Move ♞.
  • Collect♥.
  • Avoid ✖.

Controls:

WASD to move.

This game was written in 558 characters for Tweet Tweet Jam. The challenge was to build a game that would fit in the length of two tweets (560 characters).

You can mess with this JavaScript code at https://codepen.io/rmkubik/pen/qQaJjJ.

k='\u265E'
l='\u2665'
n='\u2716'
y='\u25A1'
d=document
c=e=>d.createElement(e)
b=c('p')
d.body.append(b)
s=b.style
s.display='grid'
s['grid-template-columns']='20px '.repeat(8)
h='innerHTML'
r=b.children
for(i=0;i<64;i++){t=c('i')
t[h]=y
b.append(t)}
z=c('p')
b.append(z)
p=23
m=a=>{v=Math.random()*64|0
return v!=a?v:m(a)}
r[m(p)][h]=n
r[m(p)][h]=l
r[p][h]=k
d.addEventListener('keydown',e=>{
x=p+{a:-1,d:1,w:-8,s:8}[e.key]
r[p][h]=y
if(r[x][h]==l){z[h]+=l
r[m(x)][h]=n
r[m(x)][h]=l}
if(r[x][h]==n)z[h]=z[h].slice(3)
p=x
r[x][h]=k})

Comments

Log in with itch.io to leave a comment.

(+1)

Fun! I love how you can go around the edges of the screen, really adds an element of strategy to it. Great job!