erronius

Members
  • Content Count

    4
  • Joined

  • Last visited

  1. erronius

    Phaser AudioContext/Resources Problem

    Anyone have any insights on this? Still a bit stuck. Thanks!
  2. Hello! I am a student working on a project (a 4x game) for school. I am using Phaser in some areas of the project but not others, and I think that's where I am getting into trouble. I'm using AngularJS routing to move back and forth between multiple partial HTML views. Every time I'm going to one of the partials that uses Phaser, I'm creating a new "game" like so: var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-canvas-container', { preload: preload, create: create, update: update }); When I move back and forth between Phaser pages enough (6 times) I get this error: "Uncaught DOMException: Failed to construct 'AudioContext': The number of hardware contexts provided (6) is greater than or equal to the maximum bound (6)." Here is a link to my repo: https://github.com/pauldennis2/Simplicity-Webapp The pertinent code is going to be here: https://github.com/pauldennis2/Simplicity-Webapp/blob/master/src/main/resources/static/js/main.js I think I understand the basic issue here (though feel free to correct me, I'm not too confident). I'm not using Phaser in the way it was intended to be used. Every time I create a new game, Phaser is doing stuff in the background to create resources (such as an AudioContext) and I'm never cleaning up those resources. The main approach I've tried was variations of (if game == null) { new game ...}. Also tried storing the game in $rootScope. The problem is then the game doesn't show up at all. Tried messing around with manually calling create; similarly no dice. Solution Metrics I'm not currently using sound effects/audio. If AudioContext is the only problem here (i.e. if there aren't a bunch of similar resources being created that will cause me problems down the road) then somehow disabling the creation of the AudioContext would be a reasonable solution I am *not* prepared to restructure my entire game to run through one instance of Phaser - if that were the only solution I would have to remove Phaser from my project, which I really hope I don't have to do because Phaser is awesome! A way to reliably clean up these resources would be the best solution! Thanks in advance for any help/feedback P.S.: Please keep in mind if you are reviewing my code that 1) I'm not really a JavaScript programmer and 2) this is very much a work in progress.
  3. erronius

    Phaser Assets Licensing

    I recently discovered that site and you're right, it is awesome! Thanks. (Some of the files in the Phaser examples/demos are from there).
  4. erronius

    Phaser Assets Licensing

    Hi, first time posting here. I am working on a final project for a code school and I'm looking at using Phaser in my project. I understand Phaser itself is free and open source - my question is about the assets (pngs, textures, backgrounds, etc) that come with the examples. I am really not much of an artist, so I was wondering if it is permitted to use them in my project? I am happy to give credit. The project is not for commercial development - I'm not planning to sell it, if that matters. If this is against the license and that's not what those resources were provided for I totally understand. In that case, if anyone has suggestions for either an open-source "asset pack" that I could use, or a suggestion of a tutorial in a quick and dirty way to create some stuff on my own. Again, I am not very artistic and mainly want to focus on the coding aspects of the project I have taken on rather than spending a lot of time in mspaint making stuff that looks terrible (which would be my current fallback!). Thanks in advance for any advice!