rich

Phaser 3 Beta 4 Released

Recommended Posts

I'm glad to announce that Phaser 3 Beta 4 is now available.

You can download it from GitHub: https://github.com/photonstorm/phaser/releases/tag/v3.0.0-beta.4

Or use the webpack project template: https://github.com/photonstorm/phaser3-project-template

Once you've got it running I'd urge you to check out the Phaser 3 Examples. Click 'Edit' on any demo to see the code and learn from it! If you find one that doesn't work, please report it.

Any questions? Post them here.

Cheers,

Rich

Share this post


Link to post
Share on other sites

ok, so it doesn't work at all on my iphone 4 with beta4 (white blank screen) whereas it works with latest CE
but it works better on the galaxy s4 with beta4 than with CE (because it triggers WEBGL instead of CANVAS)

yeah egde cases on old hardware ;)

Share this post


Link to post
Share on other sites

@richLove the "3D" engine capacity. You could very easily convert this to stereo view if linked to LCD glasses. Simply by shifting camera offset a little to the left and then back a little to the right would give the changes in retinal correspondence that the visual cortex would detect as depth, aka 3D stereo. A fps of 60 would be acceptable but obviously the higher the better. It would be soooo amazing!  So all 2D games can become "3D" with minimal change in coding! I am a newbie when it comes to coding and don't even have LCD glasses. BUT I am a retired optometrist and would be happy to help if you need advice on what to do. It would create an entire new genre of games with little to no coding once the basic set up is integrated into Phaser 3. A bit like how you can now choose your style of Physics (Arcade vs other options).

So i would not be apologetic that it is not true 3D because you now have the mechanics built in to be a leader in this area. Go Phaser 3! Need API's and other stuff that I have no idea about to talk to the LED glasses but would think that is available somewhere.

Wow just thought about training software for students, mechanics, company demos where people have to see it to understand it. A fricking huge potential market on top of true 3D stereo games! I would also love to be involved to use this concept for therapeutic purposes for treatment of lazy eyes.

Here to help if I can.

Share this post


Link to post
Share on other sites
On 9/25/2017 at 6:11 PM, rich said:

What exactly doesn't work? I just ran a few tests fine on an iPhone 5, which isn't far off the 4.

nothing. the game can't initialize, i traced it to

//  Phaser.Cache.BaseCache

var BaseCache = new Class({

    initialize:

    function BaseCache ()
    {
        this.entries = new Map(); ////////////// jumps out back to game = new phaser.Game(config);
                                  /////////////  then game over ;)
        this.events = new EventDispatcher();
    },

i suspect the safari mobile too old on this phone to get the subtleties of es6. If it works on iphone 5, it"s cool.

Share this post


Link to post
Share on other sites

of course, it is set to CANVAS, it just don't go to the init phase at all :

var config = {
type: Phaser.CANVAS,
width: 320,
height: 480
};

window.onload = function(){
console.log("onload");
game = new Phaser.Game(config);
console.log("created");

}

normal console ouput :
onload
phaser version x.y.z type ; canvas or webgl with fancy colors
created

my output :
onload

when i trace it steps in up to Phaser.Cache.BaseCache then pops out

Share this post


Link to post
Share on other sites

ok, after further investigation the problem is in :

phaser.js

var Game = new Class({

initialize:

function Game (config)
{
this.config = new Config(config);

this.renderer = null;
this.canvas = null;
this.context = null;

this.isBooted = false;
this.isRunning = false;

this.events = new EventDispatcher();

this.anims = new AnimationManager(this);

this.textures = new TextureManager(this);

//this.cache = new GlobalCache(this);

if you remove this line, it (almost) works.
the init completes, you have the console.log that prints the good version of phaser (3.0.0 - canvas) and it runs
but in the console you now have

default - BaseLoader start. Files to load: 1
project.bundle.js:29649 Fallback TODO
project.bundle.js:40729 default - Loader Complete. Loaded: 0 Failed: 1

and the bouncing logo bounces but displays a green transparent square made of two triangles, clearly the bitmap has not been loaded! ;)

Share this post


Link to post
Share on other sites

better but another (similar) problem with the set function maybe :

the baseloader exits at :

processLoadQueue: function ()
{
console.log('======== BaseLoader processLoadQueue');
console.log('List size', this.list.size);
console.log(this.inflight.size, 'items still in flight. Can load another', (this.maxParallelDownloads - this.inflight.size));

var _this = this; //////////////////// up to here it"s ok

this.list.each(function (file) ///////////////////// This part is not evaluated
{

//cut for clarity

});

the function exits and the console outputs :

PlayGame - BaseLoader start. Files to load: 2
phaser.min.js:41986 ======== BaseLoader updateProgress
phaser.min.js:41991 ======== BaseLoader processLoadQueue
phaser.min.js:41992 List size 2
phaser.min.js:41993 0 "items still in flight. Can load another" 4
phaser.min.js:42135 PlayGame - Loader Complete. Loaded: 0 Failed: 2

so the app works but does not display the bitmaps

Share this post


Link to post
Share on other sites

Hmm, Set is definitely imported properly in BaseLoader. It's possible it doesn't like it having the same name as a native data-type, so I have renamed it to CustomSet in the attached build.

Also, how come your log says phaser.min in it, but I provided a file called phaser.js? Did you rename it to test it locally?

phaser-dev-2316.js

Share this post


Link to post
Share on other sites

yeah, twas faster to add .min to the filename, lazy me :)

so further i traced upto the loading process of the images wich return CONST.FILE_ERRORED in the logs (i uncommented the logs in phaser.js and added a few)
all is good until we reach :

var ImageFile = new Class({

Extends: File,

initialize:


function ImageFile (key, url, path, xhrSettings, config)
{
//// cut for clarity
},

onProcess: function (callback)
{
this.state = CONST.FILE_PROCESSING;
console.log('CONST.FILE_PROCESSING'); ////////////////////// ok it logs
this.data = new Image();

this.data.crossOrigin = this.crossOrigin;

var _this = this;

this.data.onload = function () /////////////////////// we never go in
{
console.log('data onload begin'); /////////////////////// we never go here

URL.revokeObjectURL(_this.data.src);


_this.onComplete();


callback(_this);
};

this.data.onerror = function (){

                           //// cut for clarity                                                   

                          //////////////////// logs ok
};


console.log('endof CONST.FILE_PROCESSING'); //////////////////// logs ok

this.data.src = URL.createObjectURL(this.xhrLoader.response);
}

});

Share this post


Link to post
Share on other sites

Did something text-related change with Beta 6? I updated from Beta 5 and there are no error messages but the texts are invisible (or non-existent), everything else seems to work fine.

class BootMenu extends Phaser.Scene {
  constructor () {
    super({
      key: 'BootMenu'
    })
  }

  create () {
    let config = {
      x: 100,
      y: 100,
      text: 'Phaser 3 - Examples',
      style: {
        font: '64px Arial',
        fill: '#ff00ff',
        align: 'center',
        stroke: '#ffffff',
        strokeThickness: '4'
      }
    }
    this.make.text(config)
  }

  update () {
  }
}

export default BootMenu

 

Share this post


Link to post
Share on other sites
On 10/11/2017 at 11:15 AM, rich said:

Pretty sure I know what this is now. Please try the Beta 7 release next week.

the problem remains the same, i'm not sure it"s worth worrying though, that phone is old and phaserCE works ok with it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.