This repository was archived by the owner on Nov 12, 2024. It is now read-only.
Migration from version 0.5/0.6 to latest : Error level symbol def must be a function returning a component list #541
Answered
by
slmjkdbtl
loicdescotte
asked this question in
Q&A
|
Hi, I am trying to make a little game with kaboom, In my version I am trying to use a newer version of kaboom, I have managed to use kaboom 0.6 but when I am trying to use the new version , ie if I'm replacing : <script src="https://kaboomjs.com/lib/0.6.0/kaboom.js"></script>by I have this error when the game is launching : Error level symbol def must be a function returning a component list Thanks ! |
Answered by
slmjkdbtl
Feb 23, 2022
Replies: 1 comment 1 reply
|
Instead of 'x': [
sprite(),
pos(),
// other components..
]you should pass a function that returns the list of components 'x': () => [
sprite(),
pos(),
// other components..
]which is a shorthand for 'x': () => {
return [
sprite(),
pos(),
// other components..
]
} |
1 reply
Answer selected by
loicdescotte
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instead of
you should pass a function that returns the list of components
which is a shorthand for