Published
Edited
Jun 6, 2021
Fork of Kaboom 0.5.1
Insert cell
Insert cell
Insert cell
<canvas id="kb"></canvas>

Insert cell
Insert cell
{
let K= KABOOM({
width: 480, // width of canvas
height: 480, // height of canvas
canvas: document.getElementById("kb"),
crisp: true,
clearColor: [Math.random(), Math.random(), Math.random(),1]
});

K.scene("main", () => {
// ...
// const birdy = K.add([
// K.sprite("birdy"),
// ]);
for(let i = 0; i< 112; i++){
K.add([
K.sprite("rpgtiles", {
frame: i
}),
K.scale(4),
K.pos(K.rand(0,420), K.rand(0,420))
])
}
});

K.loadSprite("birdy", await FileAttachment("kaboom.png").url());
const tiles = K.loadSprite("rpgtiles",
await FileAttachment("basictiles (4).png").url(),
{
sliceX: 8,
sliceY: 14
})
console.log("tiles", await tiles)
K.start("main");
}
Insert cell
FileAttachment("kaboom.png").image()
Insert cell
FileAttachment("kaboom.png").url()
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more