gianthead

Members
  • Content Count

    11
  • Joined

  • Last visited

About gianthead

  • Rank
    Member

Profile Information

  • Gender
    Not Telling
  1. A sprite is just one representation of your game object. So instead of coupling it to the weapon itself, why not just create a brand new object for your weapon? and then add a sprite as one of its member variables to represent it? This would give you the flexibility of say using multiple sprites should you want to represent your weapon that way. Or maybe using text if you want to render your game in a console.
  2. You can simulate flipping in 1 dimension by tweening just the x or the y axis of your sprite's scale property like this: game.add.tween(sprite.scale).to( { x: -1, y: 1 }, 2000, Phaser.Easing.Linear.None, true, 0, 1000, true);
  3. I've done this before by overlaying some jquery UI controls on top of a Phaser game to save implementing ui. I don't have code for you but the game is here and you can use Chrome dev tools to see how I laid out and styled the elements to make it work. I do have this advice for you. While it saves some UI work, it also introduces a bunch of issues: 1. You cannot selectively show some sprites within the game above any UI elements. All your UI elements are above all Phaser sprites. 2. You lose the benefit of Phaser's scale manager. So you have to manually scale your overlays to match. 3. You lose the benefit of Phaser's state manager. So you have to manually show/hide your UI when you switch states. The gist of it is whatever you do in Phaser, you need to also do the extra work to keep your html elements synced.
  4. Phaser's own audio manager already supports the features you need: - multiple simultaneous effects - audio sprites In addition, it has most of the other features listed on howler's front page, e.g. webaudio, fading, global mute, etc. so it's more than good enough to replace howler. And you can depend on one less 3rd party library.
  5. You need to pass the callback context as a parameter to game.add.button: game.add.button(x, y, key, callback, callbackContext, overFrame, outFrame, downFrame, upFrame,group) → {Phaser.Button} so in your case: this.backMenu = this.game.add.button(this.game.world.centerX, 0 - this.game.world.centerY + this.menuBackground.height/4, 'resume', function() {this.backMenuClick(this)}, this);
  6. spinnerbox, have you tried using Crosswalk in Shared Mode? It will reduce the size of your APK to only your files, which should be a lot less than 20+ mb. The downside is users will need to have installed the Crosswalk runtime as a separate app.
  7. I'm wrapping my Phaser game using Crosswalk to deploy to Android. Ran into 2 issues that I haven't found any good ways to resolve through searching online. If you anyone has any advice, it would be greatly appreciated. Issues: 1. How do I disable "pull down to refresh"? There are some suggestions on stackoverflow for capturing touch events on the html page but these would have to go into every page and disrupt normal handling of other touch events. Is there a way to just disable it for the runtime period? 2. Orientation lock doesn't seem to work. I tried setting it via manifest.json, via commandline, and in code using window.screen.lockOrientation. Not sure if this is an Android 5.0 issue. Anyone else seen this?
  8. Thanks for the answers, fariazz and Deathspike! I tried both your ways and a 3rd using just crosswalk. It looks like crosswalk can wrap phaser directly. Do I need intel xdk and/or cordova? I guess what I'm asking is what's the advantage of using those to integrate crosswalk and phaser versus using crosswalk's own make_apk.py script?
  9. TLDR: What do people recommend for implementing FSMs in Phaser? Details: Since FSMs make it a lot easier to manage the complexity of game states, I try to use them in all my games. This is not the same as what Phaser calls states. That looks like it's more for screen management. This article explains the state pattern that I'm referring to pretty clearly. So I'm wondering how do people recommend implementing FSMs within a Phaser state? What patterns or plugins they use? Or do they roll their own? If roll your own, any advice on implementation? Or maybe my understanding of Phaser states is mistaken and they can be used for FSMs and I just don't know how?
  10. Thought I'd share my first couple of amateurish attempts at making a complete game with Phaser here. Feedback of any kind is welcomed. 1. Easy = Pie web android 2. SmugSlugs web android
  11. TLDR: Is there a step by step guide that walks through turning a Phaser game into a Crosswalk apk? Details: I've been using Cocoon's webview+ (essentially chrome) to wrap my Phaser games, which has been great. But Google Play has flagged my Cocoon apps for removal with an alert about unpatched SSL vulnerabilities that are part of the wrapper. The issue has been there since Jan this year but Ludei's response in a thread on their forums says they don't have time to fix it. So I'm re-wrapping my Phaser games with Crosswalk, which already updated their wrapper to not have the SSL vulnerability. Although the process seems straightforward, it would still be nice to have a tutorial that explains it. My search turned up lots of Cocoon tutorials but no Crosswalk ones. So I'm posting here to see if other people might know where to find one. For any newcomers planning on using Cocoon webview+ to wrap their Phaser games, I suggest you consider this problem you will run into. I'm not sure if canvas+ has the same problem.