Duck to the RescueBUBBLE BATH PATROL
Unicorns: 0 / 0

Duck to the Rescue

Tiny unicorns are trapped in soap bubbles! Steer your rubber duck into each bubble to pop it and set them free.

Arrow keys / WASD to swim  •  or just drag with your finger
startBtn.addEventListener('click', start); // keyboard const map={ArrowLeft:'left',a:'left',A:'left',ArrowRight:'right',d:'right',D:'right',ArrowUp:'up',w:'up',W:'up',ArrowDown:'down',s:'down',S:'down'}; addEventListener('keydown',e=>{ if(map[e.key]){keys[map[e.key]]=true; pointer=null; e.preventDefault();}}); addEventListener('keyup',e=>{ if(map[e.key])keys[map[e.key]]=false; }); // pointer / touch drag function setPointer(e){ const r=canvas.getBoundingClientRect(); const t=e.touches?e.touches[0]:e; pointer={x:t.clientX-r.left, y:t.clientY-r.top}; } canvas.addEventListener('pointerdown',e=>{setPointer(e);}); canvas.addEventListener('pointermove',e=>{ if(e.pressure>0||e.buttons>0||e.pointerType==='touch') setPointer(e);}); canvas.addEventListener('pointerup',()=>{pointer=null;}); canvas.addEventListener('pointercancel',()=>{pointer=null;}); resize(); reset(); frame();