Question:
Kaboom.js playground code is outdated, gives a bunch of errors like “grid width and height need to be defined” and stuff. I’ve got it to run without errors but the level isn’t showing up. I really don’t want to make my own level system, but I’ll have to if this just isn’t gonna work.
Repl link:
https://replit.com/@QwertyQwerty88/Mario#code/game.js
const LEVELS = [
[
"=====",
"=====",
"=====",
"=====",
"====="
]
]
const levelConfig = {
width: 32,
height: 32,
tiles: {
"=": () => [
sprite("gold block"),
area(),
solid()
]
}
}
scene("game", ({ levelId, coins } = { levelId: 0, coins: 0 }) => {
const level = addLevel(LEVELS[levelId ?? 0], levelConfig)
onKeyPress("f", () => fullscreen(!isFullscreen()))
})
go("game")