This repository was 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
Uh oh!
There was an error while loading. Please reload this page.
-
What is the "proper" way to extract various methods to other files?
Take
loadSpriteAtlasfor 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
setupis defined elsewhere, imported, and passed in like above.So what is the proper way to lighten the load on the overburdened
main.jsfile?Beta Was this translation helpful? Give feedback.
All reactions