prompt
The title of the game, telling player what they should do. (Usually just a simple verb!)
author
Your name
hue
Hue of the background of the game (0.0 - 1.0).
onLoad
Load assets of your mini-game
onStart
Main entry point of your mini-game gameplay. Should return a Kaboom game object that contains the entire scene and behavior.
const squeezeGame = {
prompt: "Squeeze!",
author: "tga",
hue: 0.46,
onLoad: (k) => {
k.loadSound("fly", "sounds/fly.mp3")
k.loadSprite("hand", "sprites/hand.png")
},
onStart: (k) => {
const scene = k.make()
const hand = scene.add([
k.pos(420, 240),
k.sprite("hand"),
])
k.onButtonPress("action", () => {
hand.squeeze()
if (gotIt) {
k.win()
}
})
return scene
},
}