Jump to content

Search the Community

Showing results for tags 'Phaser Routing'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Hi Guys, this is my first post here and I hope that I have been putting it under the right category So I am working with AngularJs to add some menus before my game starts. I am also using EZGUI to add some ingame menus. I really need the Angular part that I have already built cause I am doing more complex things like user authentication in there, which I don't wanna do in Phaser. To my problem: I am trying to switch views between my Angular part and the Phaser Game. I got something working that actually lets me change in and out of my game without any lags, but gives me the following error, when I loaded the game once, switched back into my Angular part and then switch back into my game: Uncaught TypeError: Cannot read property 'cache' of null Important to mention here is probably how I go about switching my views. In my game controller that loads my game into my div (canvas), I wrote a little function that lets me load scripts asynchronously and appends them to the head, when I switch out of my game into my Angular menu controller. I remove that script again from the DOM to be able to reload it later again. The script is fairly tiny so it doesn't take up much loading time. It only contains my game setup: (function() { var game = new Phaser.Game(screen.width, screen.height, Phaser.CANVAS, 'gameCanvas'); // add our game states game.state.add('boot', MMM.Boot); game.state.add('preload', MMM.Preload); game.state.add('main-game', MMM.MainGame); // start with the booting state game.state.start('boot');})(); I am also clearing the cache with this.game.cache.destroy(); and I am destroying the game with this.game.destroy(); in my main game file before I switch into the Angular menu controller again. I am basically trying to remove the game components completely right before I switch into my menu controller, because the user might reside there for a while (chatting, looking through the store, setting up a new password, etc...) and I don't want any game related components running in the back during that time. I have been searching through quite some forum articles trying to find what I am looking for. I read somewhere that Phaser attaches additional eventHandlers to the window object, which aren't removed when you call this.game.destroy() I hope somebody out there tried something similar and can help me out on this one. I am quite stuck here :S Any help is appreciated!
×
×
  • Create New...