Skip to content

Commit

Permalink
fix(scenes): eval script on game load
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed May 28, 2024
1 parent 55adf02 commit af61549
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/scenes/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ export function initGameScene() {
function run() {
initGame()
level.prescript()
const script = editorView.state.doc.toString()
eval(script)
level.postscript()
onLoad(() => {
const script = editorView.state.doc.toString()
eval(script)
level.postscript()
})
}

run()
Expand Down

0 comments on commit af61549

Please sign in to comment.