This repository has been archived by the owner on Nov 12, 2024. It is now read-only.
Replies: 1 comment
-
export const function loadRuin() {
return loadSpriteAtlas('/assets/Ruins/Ruins.png', {. . .});
}
import kaboom from "kaboom";
import { loadRuin } from "./loeader.js";
kaboom();
// load all after kaboom
loadRuin(); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is the "proper" way to extract various methods to other files?
Take
loadSpriteAtlas
for example. If I put it in an external file likeit doesn't work as expected if I then import and run
ruins()
Similarly,
does not work if the function
setup
is defined elsewhere, imported, and passed in like above.So what is the proper way to lighten the load on the overburdened
main.js
file?Beta Was this translation helpful? Give feedback.
All reactions