Jump to content

Divide and keep my code clean


Recommended Posts

Hello everyone!


I'm a starter on Phaser, I did some small examples and now I'm working on a bigger game.


My code is growing and growing and it has become difficult to read.


I use 5 js files: load, boot, menu, game and main. Main is where I write most of the code. I was wondering if it's possible to create other files and attach them to the main state somehow. 


For example, write all the level creation code in one file and call it from the main.js file... Like an include on php.


I guess my question it's dumb for some of you, hehe, what can I say... I'm new!


Thank you very much.



Link to comment
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.

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.


  • Recently Browsing   0 members

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