Phaser 3


  • Jammer

    Geoff mentioned on lostcast how he thought they were dropping pixi. He is correct on that, they’re writing their own thing. They’re also using ES6 and are making it more modular. So features & functionality are opt-in: https://twitter.com/photonstorm/status/660882148279328768 I find this pretty exciting. Could pull me away from being a melonjs dev if im not careful ;)


  • Tiger Hat

    Yeah pretty exciting. Everything about ES6/ES7 is so awesome. It seems like we’re on the cusp of a new era of JavaScript application. Modular and succinct code all around. I think with the language standardizing more it’ll help with the “code stink” issues. No more having to deal with 8 different ways to use “classes” or 4 different module loaders.

    Of course maybe there’ll just be new problems…

    I’m glad they’re doing their own renderer, it bothered me that Pixi (while still an amazing piece of software) was so flash-like (they have classes called MovieClip).


  • Jammer

    The downside of using ES6 over ES5 is the extra weight. If you want to ship web games, keeping them light is a good goal to have. Babel adds a number of polyfills and js code to your repo. ES5 even with some simple class implementations remains pretty light. We’re not likely to switch to ES6 any time soon in MelonJS. Though i’ve been re-thinking a lot of the architecture, starting to lean towards doing a proper ECS setup & scene graph. Maybe ;)


  • Patron

    Well… it has been a while since I last coded anything seriously, let alone searched about coding, but…

    What’s the deal about ES6? I mean, what do we need that Ecmascript doesn’t offer already?


  • Jammer

    ES6 classes are pretty nice to have. Static properties as well. Built in promises and standardized modules are super handy. There’s going to be more powerful iterators that you can do as well. Decorators are ES7 targeted, but will also become quite powerful. Redux, which is a unidirectional application state library is starting to use them. You can do quite a lot with ES5 obviously, but having worked with ES6 for some months now, it’s a little hard to go back ;)



  • I’ve been using ES6 now for almost 2 years, exclusively for all my JS programming.
    (I was compiling with Traceur before switching to Babel.)
    In general, I’m writing less code, prettier code, and easier-to-maintain code than I was with ES5/3
    Babel’s transpiler writes extremely clean ES5, which has no perceptible impact on performance.
    The source maps also make it extremely easy to debug.
    ES6’s killer features: arrow functions, let scope, and the fact that I don’t have to use the self = this trick to maintain scope.

    So, in general, I would in highly recommend that anyone writing ES5 today switch to ES6 - it’s an extremely enjoyable experience.

    But!
    I think the days of needing to write JS for web apps and HTML5 games are numbered.
    JS transpilers (like Babel and Google Closure compiler) can already write much better code than we humans can.
    And with WebAssembly on the horizon any programming language will be able to compile to more optimized code for the web than JavaScript will ever likely be able to. (JavaScript’s dynamic nature and operator overloading make it very difficult to compile to assembly efficiently).
    So I think we’re now entering an era where you can write web apps and HTML5 games use any programming language you like.


  • Jammer

    That probably won’t invalidate Javascript for a very very long time though. As processors continue to improve, especially in mobile, and js features keep getting added, more will be fine with writing JS as well. I am all for ES6, much like yourself. I’m just not 100% convinced it should be in a library. An es5 library is completely compatible with es6 code. So users can use es6 if they wish with melonjs. Though due to the fact it’s a flat library, it cant be pulled in as separate modules unfortunately. Also worth mentioning while you probably can use es6 classes with our own, it would probably take some work to get right. We use the old style extend({}) pattern.


  • Patron

    Hmmm… not having to do scope tricks sure sounds nice…

    IDK… a lot of times I feel as if ES5 already had way too many features?
    It might be because I’ve never had to maintain a big project for a long period of time, but one of the things that I find really attractive about C and that makes me want to learn it so badly is not having objects.

    In my head, it just makes much more sense to have custom binary structures for storing data, at least for gamedev.

    P.S: Also, about the WebAssembly stuff, I guess you’re already able to compile any language into Javascript?
    I think that will result in less people learning Javascript, but not necessarily in less people coding in Javascript (well, at least until the current Javascript programmers die).



  • @Josue said:

    IDK… a lot of times I feel as if ES5 already had way too many features?

    I agree!
    I only use about a quarter of the JS language features.
    At least with ES6 you can use more of the good, new, features and less of the bad, old ones.

    one of the things that I find really attractive about C and that makes me want to learn it so badly is not having objects. In my head, it just makes much more sense to have custom binary structures for storing data, at least for gamedev.

    Yes, C is basically just human-readable assembly.
    It’s really easy to learn - it’s even easier than JavaScript.
    But, you might prefer some of the modern functional languages like Haskell or Elm.
    No objects or classes, just functions without side effects.
    Elm in particular is like stepping into the future.


  • LDG

    @d13 said:

    It’s really easy to learn - it’s even easier than JavaScript.

    what is this madness!!


  • Jammer

    You can definitely have side effects in C. No different than you can in javascript. I do like C’s simplicity, but i think to have enough flexibility, i’d rather use “C with classes”, which is basically using the C++ compiler to provide a class system. But still keeping your memory management fairly straight forward, and avoiding to use templating. That said, I’ve used a fair bit of vector<> when i did use C++ :P.

    I’m probably most comfortable right now with javascript, but I really do miss using ruby when it comes to this stuff. It at least catches missing arguments, and you can’t dynamically assign properties, unless you use metaprogramming directly. This is where I also like doing my gamedev with java. Still has the downside of GC, but the static typing is pretty helpful. We’re starting to look at using flowtype at work, I’m interested to see how this turns out.



  • @agmcleod said:

    i’d rather use “C with classes”, which is basically using the C++ compiler to provide a class system. But still keeping your memory management fairly straight forward, and avoiding to use templating.

    Yup, good old “C+”
    ;)


  • Jammer

    Mhmm. Problem is, you definitely need to refer to a number of C materials if you’re skipping STL. There’s a lot of great C++ info out there, but all using the STL or new C++11 features. I find it a confusing world, where some people praise the new stuff, boost, etc. Then some just out right hate it. It’s why i’m sticking javascript & java. Well that, and productivity.


Log in to reply