How do you code game with HaxeFlixel?



  • I'm asking this because in the past I have worked on small projects in HaxeFlixel and always ended up in a mess of code making it hard to continue to work on.

    Now I've been implementing a lot of things like an Entity Component System, scripting, event system and maybe unit testing... all just to make coding easier and it seems like too much.

    Am I over-engineering?
    In the near future I just wanna make some small games for mobile and web market. And then bigger games for PC someday.



  • I just write a prototype quick (of a new feature, new game whatever), if it works, I then refactor messes of code starting with the most messy and critical. If it doesn't, then I throw away the feature (like start a new project or remove the files away and let them stay only in git history). The refactor/throwaway approach also applies to code I didn't write (engine, lib, addon class, etc): if I use the code, it's now my code.

    The "I will write a feature-rich general-purpose game engine first, and then will make games with it" mindset is self-deception. The goal is not making an engine, the engine is just a tool (including the wrapper systems you write).

    It is important to clearly state what is your current (mini-)goal. Like - to make a build for playtesting with all core mechanics working, to add enemy behaviour, to make managing new assets faster, etc. And if, for example, you already manage assets kind of fast (takes tiny percent of development time) - just don't bother about it.

    Hope this helps :-)



  • How do you write prototype then? Just code in anyway and make it work even if it's a mess?



  • Yes. Prototype is about getting results as fast as possible, and then test and decide its future.
    Moreover, it's not only code, there are UI prototypes, plot prototypes, graphics prototypes and what not.




Log in to reply