toto88x Posted December 24, 2013 Share Posted December 24, 2013 Hello, I recently discovered Phaser, and I really want to start using it. But before, I have a few questions: 1) Is it really working fine on all major browsers and operating systems? Sound is working, no lag, etc.? 2) I've read the "Phaser and Typescript" tutorial, but I have a hard time figuring out what exactly is Typescript and why should I use it. Can anyone explain me this? 3) I've downloaded the last version of Phaser, and when I test the examples, a lot of the images are shaking on OSX with Chrome. Is this a bug or a... feature? Thanks a lot for your help! :-) Link to comment Share on other sites More sharing options...
toto88x Posted December 25, 2013 Author Share Posted December 25, 2013 Hi again, I've started coding a small game in Phaser. So far I really love how it works! I've spent a lot of time in the examples, but I still have a few more questions: 4) If I want to spawn an enemy every X amount of time, I know I can do this by using if(game.time.now > timer). But isn't there a better way? Something like spawnMonster().delay(x).loop() for example? 5) Is there a way to have by default a loading bar during the preloading of the game at the beginning? Or does this have to be done manually? 6) How can I make the particles of an emitter fadOut before they disappear? Thanks a lot! Link to comment Share on other sites More sharing options...
rich Posted December 25, 2013 Share Posted December 25, 2013 1) Is it really working fine on all major browsers and operating systems? Sound is working, no lag, etc.? 2) I've read the "Phaser and Typescript" tutorial, but I have a hard time figuring out what exactly is Typescript and why should I use it. Can anyone explain me this? 3) I've downloaded the last version of Phaser, and when I test the examples, a lot of the images are shaking on OSX with Chrome. Is this a bug or a... feature? 1) We do test as much as we can, but there are so many browser / os / gpu combinations that it's hard to get them all. Plus we're iterating quite quickly at the moment on features, and that always introduces a little instability. I think the most important thing of all though is that we re-act to issues quickly, and if it's a pretty straight forward one (or easy to reproduce) there is a high chance it'll be fixed in dev within a week or two, and in master within a month. 2) I would suggest you read the TypeScript site to get an understanding what it's all about, and if it's right for you or not. 3) Could you elaborate a little more? I'm on OS X right now but don't witness this, so some more details would be handy. Link to comment Share on other sites More sharing options...
rich Posted December 25, 2013 Share Posted December 25, 2013 4) If I want to spawn an enemy every X amount of time, I know I can do this by using if(game.time.now > timer). But isn't there a better way? Something like spawnMonster().delay(x).loop() for example? 5) Is there a way to have by default a loading bar during the preloading of the game at the beginning? Or does this have to be done manually? 6) How can I make the particles of an emitter fadOut before they disappear? 4) I would have a look at the Timer class for this, have a search on the forum as I recently posted a full code example showing how to use it, and it'd be perfect for this. 5) There is a preload sprite option, but you still need to provide the sprite / texture. You could always do a 'standard' one using a filled rectangle I guess, but we've not done it for you, sorry. 6) Ah again have a quick search in the forum, someone posted some code for this very recently Arlefreak 1 Link to comment Share on other sites More sharing options...
toto88x Posted December 25, 2013 Author Share Posted December 25, 2013 Thanks a lot for your quick answers! About the shaking problem.When I look at this example, the background is constantly shaking (moving a few pixels in every direction).I'm on OSX.7, with the last version of Chrome Link to comment Share on other sites More sharing options...
rich Posted December 26, 2013 Share Posted December 26, 2013 Yeah a few people are reporting an issue with Tiling Sprites, which is what the Breakout background uses, but it only seems to happen under WebGL, and only since we upgraded to the latest Pixi version internally, and even then it appears to be very GPU specific - I don't see it on my Macbook Pro for example, but it has a nice high-end GPU in it. We'll investigate further, but it doesn't effect all images, just tiled sprites. Link to comment Share on other sites More sharing options...
tackle Posted December 26, 2013 Share Posted December 26, 2013 I'll tag along a misc question here about Typescript for you Rich: Do you ever work with source Typescript files when developing this library or is it always javascript source?I read the note here: http://www.photonstorm.com/phaser/how-to-use-phaser-with-typescript but I didn't realize if you write TS or JS when developing. Also - which do you personally prefer, when actually using Phaser? And what IDE? VS? Link to comment Share on other sites More sharing options...
toto88x Posted December 26, 2013 Author Share Posted December 26, 2013 Hello, I have a new question!I'm building my first game in Phaser. So far it works great, but I want to add different states to my game (a menu, the game, a endgame, etc.) I know how to do this in typescript thanks to this tutorial, but I struggling to make it work in plain javascript. Here's what I'm doing so far with a dumb example:var game = new Phaser.Game(300, 500, Phaser.AUTO);game.state.add('mainMenu', Menu, true);this.game.state.start('mainMenu');var Menu = { var a; preload: function () { console.log("this is the mainMenu state"); }, create: function () { }, update: function () { }};Can you tell me how to make this work? Thanks! :-) Link to comment Share on other sites More sharing options...
rich Posted December 26, 2013 Share Posted December 26, 2013 I'll tag along a misc question here about Typescript for you Rich: Do you ever work with source Typescript files when developing this library or is it always javascript source?I read the note here: http://www.photonstorm.com/phaser/how-to-use-phaser-with-typescript but I didn't realize if you write TS or JS when developing. Also - which do you personally prefer, when actually using Phaser? And what IDE? VS? Phaser itself is written in JavaScript. It was originally built in TypeScript (back in the pre 1.0 days) but we dropped it as TypeScript was too unstable and buggy at the time. It's gotten a lot better since, so I would be happy to make a game using it - but Phaser itself will remain pure JavaScript under the hood. When I do build with TS I always use Visual Studio. When using JS I always use Sublime Text. Link to comment Share on other sites More sharing options...
rich Posted December 26, 2013 Share Posted December 26, 2013 Hello, I have a new question!I'm building my first game in Phaser. So far it works great, but I want to add different states to my game (a menu, the game, a endgame, etc.) I know how to do this in typescript thanks to this tutorial, but I struggling to make it work in plain javascript. Here's what I'm doing so far with a dumb example:var game = new Phaser.Game(300, 500, Phaser.AUTO);game.state.add('mainMenu', Menu, true);this.game.state.start('mainMenu');var Menu = { var a; preload: function () { console.log("this is the mainMenu state"); }, create: function () { }, update: function () { }};Can you tell me how to make this work? Thanks! :-) There is an example of this in the resources/Project Templates/Basic folder in the repository, but we'll publish a proper tutorial soon. Link to comment Share on other sites More sharing options...
toto88x Posted December 26, 2013 Author Share Posted December 26, 2013 There is an example of this in the resources/Project Templates/Basic folder in the repository, but we'll publish a proper tutorial soon. Awesome, that's exactly what I was looking for. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts