Software Archive
Read-only legacy content
17060 Discussions

Update Phaser version

Emanuele_S_
Beginner
433 Views

Hi,

I was wondering how you upgrade Phaser (and other frameworks) version in XDK.

Since XDK includes all sources when creating a new project, how do you make XDK create new Phaser projects with a newer version ?

 

Thank you.

0 Kudos
4 Replies
Elroy_A_Intel
Employee
433 Views

Currently, Intel XDK "Game" samples and templates are set to only the provided version included with the project, but you can update the necessary files as you would like. 

0 Kudos
ELVIS_T_1
Beginner
433 Views

Hi there,

could I simply replace the file phaser.js with the new version?

I tried this but my project stopped running.

Could you give me more specific instructions?

Thanks

Elvis

0 Kudos
PaulF_IntelCorp
Employee
433 Views
0 Kudos
ELVIS_T_1
Beginner
433 Views

Thank you Paul,

I tried the workaround presented in that post:

//initiate the Phaser framework
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'divgame');

game.state.add('GameState', GameState);
game.state.start('GameState');

//--BEGIN-- WORKAROUND
    function onPause() {
        if(!game.paused) {
            game.gamePaused();
        }
    }
  
    function onResume() {
        setTimeout(function() {
            if(game.paused) {
                game.gameResumed();
            }
        }, 0);
    }
    document.addEventListener('pause', onPause, false);
    document.addEventListener('resume', onResume, false);
//--END--   

 

My main.js file has the same structure of the "phaser+ cordova pet tutorial". I'm working with that files of the tutorial.

If I change from Phaser 2.1.2 to 2.5 it stops rendering the game.

If you have a different approach, please let me know.

Thanks in advance,

Elvis

 

 

0 Kudos
Reply