Software Archive
Read-only legacy content
17060 讨论

Update Phaser version

Emanuele_S_
初学者
1,155 次查看

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 项奖励
4 回复数
Elroy_A_Intel
员工
1,155 次查看

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 项奖励
ELVIS_T_1
初学者
1,155 次查看

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 项奖励
PaulF_IntelCorp
1,155 次查看
0 项奖励
ELVIS_T_1
初学者
1,155 次查看

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 项奖励
回复