Published
Edited
Jun 6, 2021
Fork of Kaboom 0.5.1
Insert cell
Insert cell
Insert cell
Insert cell
viewof query = Inputs.text({label: "Game Text", placeholder: "Input Game Text", submit: true, value: "Hi Kaboom"})
Insert cell
{
let K= KABOOM({
width: 480, // width of canvas
height: 480, // height of canvas
canvas: document.getElementById("kb"),
});

K.scene("main", () => {
// ...
const birdy = K.add([
K.sprite("birdy"),
K.pos(240,240),
K.rotate(0),
K.origin("center"),
]);
// add a text at position (50, 100)
const theText = K.add([
K.text(viewof query.value, 32),
K.pos(50, 100),
]);

birdy.action(() => {
birdy.scale = Math.sin(K.time()) * 10;
birdy.angle += K.dt() +.2;
});
theText.action(() =>{
theText.text = viewof query.value
})
});

K.loadSprite("birdy", await FileAttachment("kaboom.png").url());
K.start("main");
}
Insert cell
FileAttachment("kaboom.png").image()
Insert cell
FileAttachment("kaboom.png").url()
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more