Jump to content

Why does seperating the game logic into a different file doesn't work?

Nassim's Lab

Recommended Posts


I'm pretty new to phaser 3 and I've been playing around with the hello world example.

In this example you have the game logic javascript code within the <script> tag. When I try to put this game logic into its own file game.js and then reference it 

in index.html as <script src="game.js"></script> it simply doesn't work anymore.

I have my web server and everything set up. It would be nice if someone could tell me what went wrong. I have used this <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/phaser-arcade-physics.min.js"></script>  to have access to phaser 3 within the index.html.


Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...