• Content count

  • Joined

  • Last visited

  • Days Won


mattstyles last won the day on March 4

mattstyles had the most liked content!


About mattstyles

  • Rank
    Advanced Member

Contact Methods

  • Website URL
  • Twitter

Profile Information

  • Gender
    Not Telling
  • Location

Recent Profile Visitors

2,344 profile views
  1. It's simple enough that you don't need a framework at all but Phaser isn't designed for this sort of this, React (and other application libraries, Vue, Ember, Angular etc) are. You might want to check-out a stream library (most, rxjs etc), most have good examples of pinging off events as the user is typing and having that update some state somewhere and triggering a re-draw so you can display the X or Tick for fail/success. You don't need the stream though, React (and reactlikes, or which there are many) is particularly good at this behaviour of syncing user operations, state updates and re-draws.
  2. Naming things is tough, for example, framework for some means a coding library, for others it means tooling like Construct or Game Maker that scaffold your game and provide a GUI to 'write code for you' in certain places. For me, those products are tooling that allows you to create games, they aren't engines, nor are they frameworks. A framework is a suite of libraries that you use to create an application (i.e. Phaser, Angular, Ember), a library is a smaller module or a set of modules with a very tight scope i.e. they do one part of the puzzle very well (i.e. React, Hammerjs, Howler, Axios, Lodash) and a module is an even smaller abstraction that has a very tight scope (i.e. Redux, raf-loop, left-pad). The term engine doesn't tend to get used very much in the JS world (nor should it) as its typically a lower-level sort of thing i.e. you could create an 'engine' for something like rendering but you'd probably want to bolt on an API of some sort on top to make it easier to consume, its somewhere between a framework and a library as it would typically have a fairly tight scope but also be reasonably complex. As always, as much as you try and create regular conventions for nomenclature people's definition of these words does differ. How much coding do you want to do? Stuff like Construct and Game Maker can be very powerful but they shield you from the code, I'm sure you still have to do plenty of coding but the nuts and bolts you'll be blind to, which means less flexibility and if you run in to problems then identifying where those problems lie can be impossible. Stuff like Phaser is a framework, its a collection of libraries that solve common game application problems (rendering, user input, sound, structure etc) and some glue. You'll still have to do lots and lots of coding but it'll help you into a structure that allows you to be productive and its saves you the worry of solving some common problems during development. The only issue with frameworks (as a coder) is that it sometimes feels like they run the show and they occasionally let you write some code. You can go more barebones and use lots of modules and glue them together yourself. Taking the library route lets you be in charge of writing your code, with the responsibility of solving most of the issues yourself. Libraries let the coder be in charge, you employ them for certain tasks, a framework is more pervasive and lets you write codes in little windows, but, either approach (or the tooling approach of stuff like Construct which is almost like an uber-framework, much much more prescriptive) is very valid and its up to you how dirty you want to get your hands. In contrast to Jammy I'd say that if you're in this to learn coding then get your hands as dirty as possible. If you start shielded then you tend to stay that way, if you want to learn to code then learn to code, don't hide behind frameworks and tooling, you can do that later when you know enough about coding that you know how to employ all these libraries, modules, frameworks, engines and tooling.
  3. Pretty sure there is no legal obligation to include change notes although some platforms (such as the App Store) may look more favourably upon you if you do include them, dont think any of them enforce it though and even if they did it would be hard for them to check content so you could blank it if you so chose. There are a few tools out there that will generate a change log from source control commits but this requires you to be really vigilant with versioning (which you should be anyway) and with your commit messages (which you might well be doing but you'd need a formal commit message style and stick to it for a tool to be useful). They are probably configurable so that they look for a specific format of a commit message (i.e. prefixing the commit with [change], for example) or so that they only look for messages relating to merges but these are all conventions and as each project typically has its own commit message format its hard to generalise a tool to do so (plenty of open source projects do use commit history to generate change logs though).
  4. Check out touchdown, touchup and touchmove events, they'll fire when you want although the event structure is slightly different to using mouse events. They're both pointers so there is a newer pointer spec but I don't think its really implemented everywhere yet.
  5. Chrome device mode (the other modern browsers have similar functionality) can emulate various different device sizes and even changes various other bits and bobs to try and get as close as an approximation to the actual device as possible, you can test different resolutions (and even dpi for different levels of retina/non-retina I think) using this tool. Day to day I'm developing only targeting mobile browsers and it really is a good emulation (of course we still test and dev against real devices and its necessary for stuff like multi-touch which the emulation says it kind-of handles but does not). I've got more serious problems starting your link now though (see attached image). Its probable (likely) that the 'includes' error I mentioned earlier was actually this one. The sound plays for a second or so, no visuals, then the sound cuts out too.
  6. I got all sorts of problems trying to play via my desktop (using Chrome), the playing field was huge, much larger than the browser viewport (about twice as long, possibly longer) so it was totally unplayable. Switching to mobile emulation (via Chrome) fixed the viewport but not for long, after a couple of clicks it totally failed to resize properly. My screen is retina and it looked like it was trying to push it to 4x the size (2x in each direction), maybe the problem is there somewhere? After I failed to keep the salesman awake I also got an error in the console, one of your arrays isn't where it should be, error was `can not call 'includes' or null` I think.
  7. In what way does not work? Does the browser hang in an infinite loop? I'm assuming that everything is fine until you get up to your conditional which decides whether to call the function with the adjacent tnt brick, it looks like you're going to get stuck in a loop there and it'll never get to the brick.kill() function. If you have two TNT bricks next to each, say, brick A and brick B, the ball hits A so you call explode(A), the function executes and grabs all of its neighbours and starts killing them, until it gets to brick B, whereby it calls explode(B), now, immediately, explode(B) executes which does the same thing, but, brick A is still alive at this point so it calls explode(A), which goes again, finds brick B (which is still alive) and calls explode(B) and the cycle repeats indefinitely. Try killing the brick before calling explode(adjBrick) again. There are quite a few different ways to achieve this though and iterating over your entire search space all the time is not efficient, but thats a separate issue.
  8. According to it should work with windows phone (they use Edge or older ones use IE 10/11 right?) but its quite possible that if its an older phone then compatibility isn't what it should be and Windows Phone isn't well supported as user stats are tiny, particularly for older phones. How are you currently testing it? Is it via the browser or in a wrapper like cordova? Which browser version is it? You could try checking MSDN to see if anyone has come across the issue for your specific device/browser combination?
  9. What platform are you trying to support? It's works almost everywhere and I've used it a few times without issue.
  10. I'm on the train so internet is very sketchy, it won't load the game link at the moment. MDN have a few good articles on using app cache to store assets, it works by flagging which assets the browser should cache and tells it to use those cached assets if they are found or in the event of non-connectivity. It can be a pain to work with as its very aggressive caching and its implementation is sketchy or non-existent across all platforms you might want to support but conceptually its very simple, its just a list of assets that should be cached, once the user has visited your site and downloaded those assets initially they'll be able to used the cached local versions on subsequent visits. Many years ago when Financial Times piled a load of cash in to the web they worked on offline support for assets and use various combinations of local storage and more advanced browser db storage, they got it working but its not for the faint-of-heart, it involved all sorts of trickier involving what gets stored where and compressing those assets to fit within browser limits for offline storage. You might find some good articles detailing their approach with the good news that most of these apis are now more advanced and stable in browsers. edit: MDN finally loaded on my poor connection, appCache is officially deprecated (not that it was ever properly supported anyway), so check out Service Workers instead.
  11. I remember someone once posted a great old-school racing game that mucked with transforms on containers, although in that case it was with DOM and a transform on the main container, which then also transformed all child elements using the same projection change, I'd imagine this is very similar conceptually to megmuts solution but with DOM rather than canvas elements.
  12. Yeah I wonder what publishers make of desktop-only games, or games that don't work very well on mobile. Certainly for an RTS I imagine its a non-trivial task to scale it down for mobile and touch to work nicely. Let me know when I can play the game, I enjoy an RTS but have very little time to play a big RTS game so something with smaller missions (10-20 mins sounds great) sounds like a great spin on a big RTS.
  13. The click event has associated <x, y> coordinates in its payload, you can use those to work out where in the screen the user clicked, where in the DOM they clicked, where in the canvas they clicked and then where in your world where they clicked. After that you'll need some pathfinding to move from A->B and thats a more involved subject.
  14. Hi, I can't speak for publishers but those graphics look great, I love that style and you've absolutely nailed it. That short clip shows the game is really responsive, and looks great. If I'm being cynical then I'd say publishers don't actually care about quality, they'd rather a game made them money (which means that, at least as a by-product, some level of quality is required). You could make a terrific game, better than 99% of others out there, but if its niche, or if the publishers don't think it'll get too many plays (i.e. make them money) then you'll have to shop around for someone to publish it for you or publish it yourself. Personally I love that style and I wish there were more games out there like this. Some other things though that strike me re. RTS genre: how long are your missions? can they be completed in five mins? if so you need quite a few more of them, if no then have you got offline/online support for saving progress? I imagine games for your average publisher need to be consumed in very small chunks and that doesn't really lend it to the RTS genre so I wonder, have you tackled that issue?
  15. Try looking in to app cache and progressive web apps. App cache, in theory (and when it works), stores all assets offline. It obviously only works on the one browser at a time. You could also look at Electron or Node-Webkit for a way to bundle all your JS into a native wrapper to give you more offline support.