Dev Monster

Members
  • Content Count

    16
  • Joined

  • Last visited

  1. Very strange...but this may have happened because of an iOS software update. The software update rebooted my devices as usual, but I had to reboot my ipad and iphone again after the update and then sound started working on Safari.
  2. I am unable to play audio on Safari for iPhone 4 or iPad 2/3 on iOS7 (7.1.2 new release) or the previous version of iOS7. I am using Phaser.js 2.0.5. The sound plays normally on Safari for iPhone 5s and on the desktop browser. I included the following formats for audio to try and get it working: - aac - m4a - mp3 - ogg I made sure that the MP3 files are small enough for the devices to load: Sample Rate: 44Hz Mono Bit Depth: 32 Format: MP3 64 Kbps CBR OFL It works fine on Safari on desktop but not on mobile/tablet. The sound plays no problem when playing the game in Chrome on iPhone 4/5 and iPad 2/3. All desktop browsers play sound no problem. I also cannot play sound on Safari from any of the Phaser example pages (see examples below): http://examples.phaser.io/_site/view_full.html?d=audio&f=play+music.js&t=play%20music http://examples.phaser.io/_site/view_full.html?d=audio&f=audio+sprite.js&t=audio%20sprite Is this a bug in the code? If so, is there a work around? Thanks
  3. Hi Rich, I cant get this to work in Phaser 2.0.5. Where does the code go? I put it inside my Boot.js create function and it didnt work...I also tried to put it inside my Preloader.js create function and in the Main.js file right after I created the game. But that didnt work either. I get no console log when I change to another tab or window away from the game. I need to pause the music that is playing in my game when a user leaves the screen to another window but cant figure it out. Thanks!
  4. We fixed the issue and the problem was exclusively with the TileSprite. TileSprite works great on most browsers...but for some reason, iPad Chrome gets killed when a lot of animations are running at the same time. Lewster32, you were absolutely correct when you said Chrome's rendering engine is exactly the same as Safari. One thing I discovered was that its the same engine, but Safari is actually using a different JS library for performance. "When iOS 7 launched, developers discovered that their apps with built-in web browsers were unable to achieve the same level of JavaScript performance as the stock Safari app. This was because Apple restricted use of its improved Nitro JavaScript engine to its own app, leaving third-parties with a slower version." http://9to5mac.com/2014/06/03/ios-8-webkit-changes-finally-allow-all-apps-to-have-the-same-performance-as-safari/ We wont have to worry about this performance hit as of iOS8 because Apple released their restrictions so other browsers can use the Nitro JavaScript engine. Im sure Chrome will benefit greatly from this. Instead of using a TileSprite in the game, we opted to use a sprite instead. this.gameBg = this.add.sprite(0, 500, 'playing-game-bg');// and then in the update function we did this:// for ipad, we use the 2048 width as a modulus to move the backgroundthis.gameBg.x = (this.gameBg.x - 10])%2048;This simple code above changed the entire game play in Chrome. Performance jumped from <10 FPS to over 30. The game is playable now on Chrome on ipad 2/3 and on iphone 4/5. I hope this helps somebody else that is experiencing the same issues.
  5. We did combine most of the sprites into single spritesheets in the smaller versions for web and mobile, but the ipad version, since its HD, has very huge images. We tried combining but exceeded the spritesheet limit size and generated errors. We attempted removing the background animation completely and putting it in HTML/JS. We scrolled the background using JS outside of the canvas but still experienced the terrible slow down. We only had the bird and characters moving on screen and no TileSprite in that scenario. So I think its more than just a TileSprite problem. The game works well on the menu and instructions pages in Chrome for iPad and there are alot of transition animations for those pages. But it seems that having a scrolling background is killing the game no matter what we try. We tried the TileSprite which is the easiest, we tried TimelineLite in Phaser, we tried extracting the code and doing it outside of the canvas but we still cant make it work. If anyone has any ideas or has run into this same issue on Chrome for iPad, please let me know how you fixed it. We will keep trying to find a solution and post anything we find. =) Thanks again for the feedback and help as always!
  6. @Lewster32 We are using texture atlases for almost all of our on screen animations. I dont think that has anything to do with the Chrome iPad issue. We completely removed every item on stage and only added a TileSprite. The performance hit is exactly the same...the game drops to under 10 FPS. I think there is some type of problem with TileSprite and Chrome on iPad. We dont experience the issue with any other browsers/platforms. It works completely fine on Chrome on PC and Mac and all other browsers. The only effected browser is Chrome on iPad.
  7. I have a game that is almost complete and I have been testing on a number of different devices. There is a TileSprite in the game for the background to give it a parallax effect and its working on all devices and all browsers except Chrome on iPad. Here is a list of browsers and devices we tested on: Firefox Mac and PCChrome Mac, PC, iPhone 4, iPhone 5, iPad 2 and iPad 3 (not working on iPad)Safari on Mac, iPhone 4, iPhone 5, iPad 2 and iPad 3IE 9, 10, 11Safari on iPhone 4/5 and iPad 2/3 works perfectly. Chrome on Mac and PC and all other browsers are working perfectly. I have narrowed down MOST of the problem to the TileSprite after removing all animations and adding them back in one by one. The problem in Chrome occurs even if we do not animate the TileSprite at all. I have also found that the size of the TileSprite doesnt matter at all. Even if we add a super small TileSprite to the screen (no animation or anything), the game drops to under 10 FPS sometimes even 5 FPS. If we dont add the TileSprite to the screen the performance on Chrome is still super slow but at least the game is playable. I have optimized all images and spritesheets using TinyPNG, minified the JSON files and a ton of other things to optimize the game but it just wont work on Chrome on iPad. This TileSprite we are using in the game is 512x512 and only 46kb: Does anyone have any ideas how to fix this issue? Thanks!
  8. Thanks for your help! This is our first project with Phaser and we love working with it so far.
  9. Ok...thats good to know. I have been creating alot of vars like that and maybe thats why I cannot access them. I have also done it like this: BasicGame.Boot = function (game) { this.idleBallTween = null; }; That would also scope the idleBallTween to the state and not globally right?
  10. @wayfinder I tried stop() and but the tween did not stop...I am also trying to remove it completley from the project. I did a version on top of your jsfiddle example (Im not using TypeScript so I had to change it). Its located here: http://jsfiddle.net/3Sx5h/9/ It works fine in 2.0.4 the way you described and with my modified code how Im using it (non TypeScript). There is no cdnjs.cloudflare source for 2.0.5 so I am not able to test using 2.0.5 but in my project, it no longer works to stop the tween using the methods that we put in jsfiddle. It would be interesting to see a test in 2.0.5 to see if its broken.
  11. I have been trying to remove a single tween from a game after adding it but cannot seem to remove it no matter what I do. I add my tween like this: // yoyo tween for ball movement this.idleBallTween = this.game.add.tween(ball).to({y: -50}, 500 , Phaser.Easing.Sinusoidal.InOut, true, 0, 9999, true); Then I tried to remove it with all the methods below but it never gets removed and generates an error: ------------------------------------------------------------------------------------------------------ this.game.remove(this.idleBallTween); (from http://docs.phaser.io/Phaser.TweenManager.html#remove) TypeError: this.game.remove is not a function ------------------------------------------------------------------------------------------------------ this.game.removeTween(this.idleBallTween); TypeError: this.game.removeTween is not a function (from previous versions of Phaser) ------------------------------------------------------------------------------------------------------ this.idleBallTween.isRunning = false; this.idleBallTween.pendingDelete = true; // always force pendingDelete this.tweens.remove(this.idleBallTween); NO ERROR but tween is not removed ------------------------------------------------------------------------------------------------------ this.idleBallTween.isRunning = false; this.idleBallTween.pendingDelete = true; // always force pendingDelete this.tweens.remove(this.idleBallTween); this.idleBallTween = null; this.tweens = []; (tried to empty the entire tweens array and it worked, showed no tweens at all in the console, but the tween is still running) NO ERROR but tween is not removed and still plays ------------------------------------------------------------------------------------------------------ this.game.tweens.remove(this.idleBallTween); NO ERROR but tween is not removed Can somebody please help with this? What am I doing wrong? Thanks
  12. Thats a good question. I also need this same functionality but from the other posts I've read, it doesnt seem to be available yet.
  13. I was finally able to solve the issue by doing the following in my shutDown function: this.tweens = []; I just reset the array to an empty array and all Objects disappeared in the console.log. The game no longer chugs and everything is running smoothly. I tried everything else and no other methods worked. Here is my shutDown function: shutDown: function () { // emptys out the tweens array so Objects dont build up this.tweens = []; // after cleaning, go to next state this.loadHowToScreen();},
  14. Hi j0hnskot, Im getting the same thing only all of the object information is showing. What should I look for inside the object? Thanks for the help! game.tweens getALL before: [Object { _object={...}, game={...}, _manager={...}, more...}, Object { _object=[{Point (x=0.5 y=0.5)}], game={...}, _manager={...}, more...}, Object { _object={...}, game={...}, _manager={...}, more...}, Object { _object={...}, game={...}, _manager={...}, more...}] game.tweens getALL before: [Object { _object={...}, game={...}, _manager={...}, more...}, Object { _object=[{Point (x=0.5 y=0.5)}], game={...}, _manager={...}, more...}, Object { _object={...}, game={...}, _manager={...}, more...}, Object { _object={...}, game={...}, _manager={...}, more...}, Object { _object={...}, game={...}, _manager={...}, more...}, Object { _object={...}, game={...}, _manager={...}, more...}, Object { _object={...}, game={...}, _manager={...}, more...}, Object { _object={...}, game={...}, _manager={...}, more...}, Object { _object={...}, game={...}, _manager={...}, more...}, Object { _object={...}, game={...}, _manager={...}, more...}, Object { _object={...}, game={...}, _manager={...}, more...}]
  15. I have been trying to remove the tweens that were added in the states of my game but they do not get removed and cause the game to start chugging after a few plays. When the user replays the game, old tweens are still hanging around and are doubling each time a new game is played. I have tried every method on this forum but nothing is working. I add several tweens during each state to animate in objects to the screen like so: playButtonTween = this.game.add.tween(playButton).to({x: 390, alpha:1}, 1500, Phaser.Easing.Quintic.Out, true, 0, false); I have a function called shutdown (reserved function in Phaser) that I call before my game transitions from one state to another (i.e. Menu ==> Instructions). In this function I have tried to remove the tweens but when I console.log the this.tweens on shutdown, I am still seeing the tween objects listed. I am able to get all the tweens by calling game.tweens.getAll().I try to remove all the tweens in the state by calling game.tweens.removeAll(), but after console.logging game.tweens they are still there. shutDown: function () { console.log("game.tweens getALL before: "+ game.tweens.getAll()); game.tweens.removeAll(); console.log("game.tweens getALL after: "+ game.tweens.getAll()); } This is logged when I leave the Menu state the first time: game.tweens getALL before: [object Object],[object Object],[object Object],[object Object] game.tweens getALL after: [object Object],[object Object],[object Object],[object Object] This is logged when I leave the Menu state the second time: game.tweens getALL before: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] game.tweens getALL after: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] This is logged when I leave the Menu state the third time: game.tweens getALL before: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] game.tweens getALL after: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] As you can see, the tween objects never get deleted and keep getting added. // I have tried other suggestions on this forum using methods from the previous builds of Phaser but none of them work either: this.game.tweens.remove(tweenName); this.tweens.remove(tweenName); this.tweens.removeAll(); // I tried using the code below but it does nothing: playButtonTween.isRunning = false; playButtonTween.pendingDelete = true; // always force pendingDelete this.game.tweens.remove(playButtonTween); // I've tried to destroy tween (this works to stop the tween and set it to null, but its still in the this.tweens list) if (this.playButtonTween) { this.playButtonTween.onComplete.removeAll(); this.playButtonTween.stop(); this.playButtonTween = null; } Rich suggested: “Keep a reference to the tweens you create and then game.tween.remove() them.” I do that and have no problem accessing the tween list. But game.tweens.remove(tweenName) and game.tweens.removeAll() do not work for me. Please help! This is slowing down and eventually killing my game play because nothing is getting cleared out. Thanks!