I made long 2d game JavaScript file. I would like to divide it to multiple js file for each level so it will be easier to understand it and maintain it.
Is it possible to trigger a function from a js file that lies in another file? My thought is just to link to level_one script in html, and once the level_one is done, it will call the function in level_two script. Like a chain reaction/link.
I'm starting the game by
<body onload="startGame()">