jasper1990 Posted May 18, 2018 Share Posted May 18, 2018 I am trying to get some ideas on designing enemy movement patterns in phaser 3. First, I am trying to separate everything into discrete files such as custom game objects, scene, then the actual game file. I thought about using state machines and ran across this https://github.com/jakesgordon/javascript-state-machine. I kind of want something modular yet extandable. Should, I just put the path for each NPC and Enemy in a JSON or XML file? thanks! Quote Link to comment Share on other sites More sharing options...
mattstyles Posted May 18, 2018 Share Posted May 18, 2018 You might want to look into javascript modules, or es6 modules, or commonJS modules. There are many different articles out there about JS modules. In some ways it ramps up the complexity as you'll need a build system of some sort (modern browsers do all understand es6 modules, but, well, its still tricky) but its easily the cleanest way of modularising a project and the benefits outweigh the costs if you're building anything non-trivial (it is a bit of a ramp up at first, or, at least, it can be, depending on your experience). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.