Sign in to follow this  
Nassim's Lab

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

Recommended Posts

*Separating

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/phaser@3.15.1/dist/phaser-arcade-physics.min.js"></script>  to have access to phaser 3 within the index.html.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.