import kaboom from "https://unpkg.com/kaboom/dist/kaboom.mjs
by SparkHero7739 lines576 bytes
import kaboom from "https://unpkg.com/kaboom/dist/kaboom.mjs"
kaboom({
width: 800,
height: 400,
background: [92, 148, 252],
})
setGravity(1200)
const player = add([
rect(40, 40),
pos(80, 0),
area(),
body(),
color(255, 0, 0),
])
add([
rect(800, 40),
pos(0, 360),
area(),
body({ isStatic: true }),
color(0, 255, 0),
])
onKeyDown("left", () => {
player.move(-240, 0)
})
onKeyDown("right", () => {
player.move(240, 0)
})
onKeyPress("space", () => {
if (player.isGrounded()) {
player.jump(500)
}
})Game Source: import kaboom from "https://unpkg.com/kaboom/dist/kaboom.mjs
Creator: SparkHero77
Libraries: none
Complexity: simple (39 lines, 576 bytes)
The full source code is displayed above on this page.
Remix Instructions
To remix this game, copy the source code above and modify it. Add a ARCADELAB header at the top with "remix_of: import-kaboom-from-https-unpkg-com-kaboo-sparkhero77" to link back to the original. Then publish at arcadelab.ai/publish.