Jump to content

fariazz

Members
  • Content Count

    120
  • Joined

  • Last visited

About fariazz

  • Rank
    Advanced Member

Profile Information

  • Gender
    Not Telling

Contact Methods

  • Twitter
    ZenvaTweets

Recent Profile Visitors

1865 profile views
  1. Thanks that worked! If it helps anyone, this is how you can then retrieve the loaded object: // in preload() this.load.json('levelData', 'assets/level.json'); // in create() let data = this.cache.json.get('levelData');
  2. I'm using multiple scenes on a game, I'm using a scene (each one in it's own file) for the following: - Game itself - home screen - loading screen - a "boot" scene where I load the logo that I want to show in the loading screen I'm using mainly in ES5 and loading the files in this manner: <!-- index.html --> <script src="js/scenes/bootScene.js"></script> <script src="js/scenes/loadingScene.js"></script> <script src="js/scenes/homeScene.js"></script> <script src="js/scenes/gameScene.js"></script> <scri
  3. I think both are good options. Phaser 2 is a production-ready, mature frameworks that's been used professionally in all platforms. Phaser 3 on the other hand is just getting started, and as @blade2xs pointed out, the doc and examples are a bit behind. However, Phaser 3 is definitely mature enough to be used in production, you'll just have to do more work when it comes to finding answers. Phaser 3 offers significant performance improvements over Phaser 2. Also lots of new features which might be relevant to your game, more clean code and the option to code in ES6 all along the way.
  4. All the assets are cached between scenes. If you load an asset in Scene A, you can then create say sprites from it in Scene B.
  5. Never mind! Found the answer in the Phaser newsletter:
  6. I'm looking at creating a loading screen, followed by a home screen, and the game screen. For that, I was thinking of using a Scene for each. My question is, if I do the preloading of the assets in the first scene (loading screen), and then move to the home scene, will the assets be available and cached between scenes? or does each scene need to load it's own assets?
  7. Does anyone know how to load a json file in the preload method in Phaser 3? The JSON folder of the examples in the Loader class are empty so I'm a bit stuck: http://labs.phaser.io/index.html?dir=loader/json/&q=
  8. I was wondering if it's expected behavior that camera effects are not reset when a scene is restarted. The following code will fade out, and the screen will remain black after the scene is restarted: gameScene.create = function() { // create a sprite let bg = this.add.sprite(100, 100, 'treasure'); // fade out this.cameras.main.fade(1000); // restart the scene this.time.delayedCall(2000, function() { this.scene.restart(); }, [], this); What I'm adding at the moment is `this.cameras.main.resetFX();` when initiating a scene in order to have the view back, b
  9. this.scene.restart(); works in Phaser 3.4
  10. I can confirm this is fixed on my end when using Phaser 3.4 for the `restart` method, however not when using the `rebootScene` method. The following code works fine on my end (sprites get cleared after scene restarting): // called once after the preload ends gameScene.create = function() { // create sprites at random let sprite1 = this.add.sprite(Math.random() * 400, Math.random() * 400, 'treasure'); let sprite2 = this.add.sprite(Math.random() * 400, Math.random() * 400, 'treasure'); let sprite3 = this.add.sprite(Math.random() * 400, Math.random() * 400, 'treasure'); let sprite4
  11. Using this.scene.restart() unfortunately still doesn't solve the issue. Sprites are still not cleaned from the scene. Just tested building from the latest master branch commit:
  12. There is a new Scene manager restart() method coming in Phaser 3.4: https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md#new-features Will give this a try tomorrow
  13. I'm with you. The main thing I want to know is if we are doing it right but there is a bug in how scenes are being rebooted, or if we are doing it wrong and missing something important.
×
×
  • Create New...