yltang Posted September 4, 2015 Share Posted September 4, 2015 I am new to Phaser and I am going to teach a "game programming" course in a college. I noticed that there are two programming patterns as follows: /* Pattern A ------------- */var game = new Phaser.Game(..., {preload: preload, create: create, update: update});function preload() {}function create() {}function update() {}/* Pattern B ------------- */var game = new Phaser.Game(...);var mainState = { preload: function() { }, create: function() { }, update: function() { },};game.state.add('mainState', mainState);game.state.start('mainState'); /* ------------- */ I wonder which one is better? Also, I have three strategies:a. Always use Pattern A.b. Start from Pattern A, and then switch to Pattern B as the game becomes more complex.c. Always use Pattern B. Any suggestion? Especially, for the purpose of teaching/education. BTW, is it possible to always use Pattern A; no matter how complex the game is? Link to comment Share on other sites More sharing options...
demisephi Posted September 4, 2015 Share Posted September 4, 2015 If you want your game to have preloader, menu, play and maybe other states then its best to use B yltang 1 Link to comment Share on other sites More sharing options...
Recommended Posts