• Content Count

  • Joined

  • Last visited

Posts posted by tokumaru

  1. You could simply update the arc's angle and color based on the current health value and it would change instantaneously to that configuration, but if you plan on animating the changes you'll have to modify the color and the angle gradually over time. Tweening is one way to do it (and was probably used in the example for simplicity's sake), but you could just as well use your own logic every frame to make the arc's angle "catch up" with the current health value.

  2. There should be a comma after the } that precedes the "update" identifier. Your "GameState" object has a bunch of properties (functions, in this case) that must be separated by commas, and there's no comma separating the create function from the update function.

  3. Hey, guys! The other day I was making a bunch of animations using tweens and noticed how inconsistent the timing was regarding the onComplete callback... Sometimes it'd take over a second after the tween was visually finished for the callback function to be called, sometimes it'd happen right away, but it was generally very inconsistent.

    Is there any reason for this? Is there anything I can do to make tweens more reliable?

    My overall experience with tweens in Phaser has been a little frustrating so far... Reusing a tween has proven to be nearly impossible due to the timing inconsistencies, so I've been mostly creating new tweens whenever necessary, but I'm also not sure how to dispose of them properly when they're done so I don't end up with thousands of tween instances in memory.

    How do you guys usually work with tweens in Phaser?

  4. Thanks for the reply. It looks like sound on iOS is still very inconsistent, then. Unfortunately, I don't own any other iOS devices I can test on, so I guess I'll have to keep coding, trying to play sounds off of Tap events whenever possible, and hope for the best.

    I did try playing audio via <audio> elements before and it worked, as long as the load() or play() methods were first called from within an input event listeners. From that point on, I had full control over the <audio> element, which could be played from anywhere in the code, not only from input event listeners. Using Phaser's disableWebAudio: true doesn't work as well though... the sound plays, but it's very choppy and laggy.

  5. Hey guys, I'm having lots of trouble on an iPad 2 running iOS 9. None of the audio examples on Phaser's website work, including the one that was posted in this thread: music.html - When I touch the screen, the debug info says the audio is not locked, but the iPad still doesn't output any sounds.

    Also, out of all the games I tried, only one was able to output sounds flawlessly: Salazar the Alchemist. Weirdly enough, however, it only works when run from this specific website: - Running the game from anywhere else resulted in total silence... even opening the game's iframe from this same website in a new tab (meaning that all the game files are exactly the same) silences the game. It only works on that website, when running from inside an iframe. Really weird.

    During my own experiments, using Phaser 2.9.4, I was able to play sounds from inside a DragStart event handler. Sounds would then work for a while, but just a few seconds later they'd mysteriously stop for no apparent reason. The time it takes for the sounds to stop varies, but it's always less than 1 minute, and there are no other sound commands in the program besides the call to .play() in the DragStart event handler.

    This is just on the iPad, everything works fine on Android and PC. Does anyone have any idea of what I could do to make sounds work on this iPad 2? Is this device simply too old to work properly with Phaser? Are newer iPads and iPhones known to work OK? Thanks!