Sign in to follow this  
jasper1990

simple enemy gameobject in phaser 3

Recommended Posts

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!

Share this post


Link to post
Share on other sites

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).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.