Skip to content

Basic

const basic = new headbreaker.Canvas('basic-canvas', {
width: 500, height: 300, pieceSize: 50, proximity: 10
});
basic.sketchPiece({
structure: { right: headbreaker.Tab, down: headbreaker.Tab, left: headbreaker.Slot },
metadata: { id: 'a', currentPosition: { x: 50, y: 50 }, color: '#B87D32' }
});
basic.sketchPiece({
structure: { up: headbreaker.Slot, right: headbreaker.Tab, down: headbreaker.Tab, left: headbreaker.Slot },
metadata: { id: 'b', currentPosition: { x: 100, y: 50 }, color: '#B83361' }
});
basic.sketchPiece({
structure: { up: headbreaker.Slot, right: headbreaker.Tab, down: headbreaker.Slot, left: headbreaker.Tab },
metadata: { id: 'g', currentPosition: { x: 100, y: 190 } }
});
// ... more pieces ...
basic.draw();