Ask coding questions

← Back to all posts
Difficulties with updating kaboom.js repl
AnonymusPixel

So, I was working on a game (Kaboom.js) when I encountered something strange. One of the functions onClick() wasn't working. So I wondered if repl.it uses an outdated version of kaboom. I decided to create a new kaboom repl, copy all the code and assets, and try again.

After I copied all the code and tried to execute it, some parts of the UI in the menu scene disappeared. I can't find the problem.

Does anyone know what the error in my code is? Does anyone have further tips for migrating to a newer Kaboom version?

Thanks in advance

Old, working code: https://replit.com/@AnonymusPixel/GSG (Not working after update)
New, non-working code: https://replit.com/@AnonymusPixel/Space-Gaem

Things I have tried:
-Other browsers: Brave, Edge and Chrome
-Removing deprecated syntax
-Scouring the GitHub and documentation
-Banging my head against a wall and contemplating life choices
EDIT: I think that I have fixed all the deprecated syntax (In the 'new' version). I have checked and tested the 'game' scene. It seems that only the menu UI is broken.
EDIT: Fixed some spelling errors, it was late at night when I posted this.

The code of the 'menu' scene:

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
AnonymusPixel
Comments
hotnewtop
Coder100

repl.it uses an outdated version of repl.it

do you mean kaboom?
And yes, there was an outdated version in the template, go into the shell and type this: npm i [email protected]

AnonymusPixel

@Coder100 I ran the command in both projects, but the same error of disappearing UI has now also affected the previously working version.

(And yes, I meant kaboom)

AnonymusPixel

I have solved the problem! The error was this line of code : credits.onClick(go("credits")). The correct syntax was credits.onClick(()=>{go("credits")}). But thanks for the help anyway, @Coder100.

Coder100

oh yeah, that's a thing too, but the outdated kaboom is also a problem @AnonymusPixel

AnonymusPixel

@Coder100 This answer helped me alot, so here ya go.