• Content Count

  • Joined

  • Last visited

  • Days Won


spencerTL last won the day on January 2 2015

spencerTL had the most liked content!

About spencerTL

  • Rank
    Advanced Member

Contact Methods

  • Website URL

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

1794 profile views
  1. I haven't used Phaser3 hands on yet, but I remember Rich saying that states could be used for much of what groups were used for as multiple states can be on screen at the same time.
  2. There's a general guide that may be useful on Emanuele Feronato's site: http://www.emanueleferonato.com/2018/02/16/how-to-scale-your-html5-games-if-your-framework-does-not-feature-a-scale-manager-or-if-you-do-not-use-any-framework/
  3. Look at the templates included with Phaser. One of them, I forget which, shows one way to do this. It is in the boot state and essentially involves declaring Basicgame.highscore or whatever. That variable is global. It doesn't have to be declared in boot but that makes it available right from the offset so is a good place.
  4. Tom Atom is right. I had the same problem. I was zipping with Windows send to archive. For some reason this does not work with cocoon. Get winrar and zip the folder with that.
  5. I've just made my first builds using Cocoon by Ludei. I've used Phaser/javascript to make the app. I started making some notes to aid me in the future as I don't make many app build builds and I'll have forgotten by the next time I do. I decided to put it here as it may help others. There isn't anything here that isn't available on Cocoon's docs, forums, and a few other places on the web but they are snippets that I wish had been in big red letters when I was working through it. Follow Cocoon's docs. What's written here is essentially the solutions/extra clarity to each sticking point I had. Include this line between the head tags of your index.html. (Code taken from Cocoon's docs) <script src="cordova.js"></script> include this in your body tags. <script type="text/javascript"> document.addEventListener('deviceready', function() console.log("Cordova is initialized and ready!"); }, false); </script> I start my game using the following code in index.html. I tried using the anonymous function as shown in a Phaser Cocoon template but this caused subtle changes to my game. I could not find what the cause was as it seemed utterly unconnected and, although I presume it must be to do with scope, impacted things that were scoped only to a single state. Essentially a Phaser group was no longer updating its children as it was expected to. Be sure to check your game carefully using the developer build as these new bugs can be subtle. I used the following. Uncommenting the first and last lines as in the template still seems to work but introduces those subtle bugs. <script type="text/javascript"> //(function(){ var game = new Phaser.Game(2048, 1536, Phaser.AUTO, 'game'); game.state.add('Boot', BasicGame.Boot); game.state.add('Preloader', BasicGame.Preloader); game.state.add('Game', BasicGame.Game); game.state.add('OtherState', BasicGame.OtherState); game.state.start('Boot'); //})(); </script> Create file structure of js assets src css index.html Zip these files *not* the folder they are in. See zip gotcha below. The bundle id you use in the cocoon builder must not have uppercase letters even though you may have already created a bundleid with apple that you cannot change. Fortunately, if you were stupid enough (me) to have done this a long time ago, it does not seem to matter that they do not match, Apparently Apple, at least, is case insensitive for bundle ids. FOr iOS, if you wish to test the resulting ipa on a device, build it using a development certificate and an adhoc provisioning profile. (Not a development provisioning profile/ensure your devices are added to your dev account before generating the provisioning profile). Just copy the ipa to iTunes and then to the device. Quirks that may be resolved in future updates: The zip file that you create of your project won't work if you use the the native Windows 'send to archive' using winrar results in a zip that does work. The help links accompanying each section are very useful. A minority, however, open in the current window so losing any changes you've made. Best to 'open as new window' just in case. Conclusions I have to say, the service was very good. Aside from the few issues mentioned above it went very smoothly. Uploading a single icon and having the service sort it into the myriad that Apple demands was a bonus time saver. For me, it was a much nicer process than when I used xcode and cordova alone. I've used the free service with a very small app (less than 5mb). I've had to use the webview+ as one section of my app uses the DOM but the performance is still very good. My app has a lot of sprites on screen but they don't update much. Only the zip issue was nearly a showstopper. Whether this is an issue with Microsoft's archiver or Cocoon's reading of the zip I don't know but it was the only problem I found that really needs to be addressed with urgency. The value of Cocoon's service will vary for you, but I'll definitely be considering the paid for version when I'm ready for its extra features.
  6. spencerTL


    Phaser2 can't have simultaneous states so you need to save the character coordinates etc to a global variable and reconstruct it when you change back to the original state. Alternatively, you could bring in the other state's functions to the original state. If your volume state is just, say, a volume slider, then create that as a group and control its visibility instead of switching states. Save the volume variable to global to access across other states. Phaser 3 is reported to have simultaneous states but it's a way off yet.
  7. You can change the coordinate around which the world rotates by setting world.pivot. Would this help?
  8. It's worth mentioning: http://slick-ui.com/ If for whatever reason you don't want to use the DOM, it works well. It may not have everything you want, though.
  9. I think you can. The first parameter is the callback, the second the context, the third the signal priority (usually set as 0), next is your own parameter. Pretty sure this is the order but I'm on my phone so haven't looked at the docs.
  10. Normal is really what you are used to. I could never get on with cocos2d because it used the coordinate system that the op wants. I believe that the reason is just a hangover from publishing which always used the top left as 0,0. Mathematically it doesn't matter either way. Still, the fact remains, you have to live with it. Some frameworks do have it as a definable option but it must have some impact on performance as it adds another conditional into a frequently accessed part of the engine. Best to get used to it now so that you're not always fighting against it when you consider other frameworks.
  11. Personally, I think the goodwill and reputation you have earned through Phaser would allow you to go either way. People will adapt to Phaser 3 or recognise Lazer as the next step. One thing that struck me, though, was that in your history you didn't mention the time you spent trying to trademark Phaser and hence the switch to the Lazer name. I remember you going into reasons etc on Twitter. People will adapt to whatever you choose but we all win if you and your business benefit. If fully controlling the name of the product would benefit you, then this should be a big consideration.
  12. I think the body rotation is in radians. I can't check exactly what at the moment as I hate browsing on my phone, but in Phaser maths utils there are methods for switching between rads and degs and also normalising angles which will do what you want but maybe only in rads. Using these methods and switching to the units you need at the end should do what you want.
  13. spencerTL

    Game states

    I think you might get more help if you put the code somewhere that doesn't need a zip file. People are, quite rightly, concerned about the possible contents of a zip. Either post the relevant code here or use jsfiddle.net to show the full thing. As a possible suggestion, are you using scope correctly? When you use states you need to use 'this' to refer to the current state. Eg this.add.group() This can mean that some examples, including Phaser's own, need adapting to be used in states.
  14. This is great. Really nice presentation and a nice alternative to the normal sliding blocks puzzle. It must be really difficult to come up with each level, ensure that there is a solution and then grade them in difficulty. Nicely done, though.
  15. This example should help you draw lines and rectangles without using debug. To change them dynamically you just clear and then redraw them. http://phaser.io/examples/v2/display/graphics