• Content count

  • Joined

  • Last visited

  1. Sound muteOnPause problem

    Okay, i don't know who is fixing bugs on phaser. But that was definately bug. I add code of checking boolean "muteOnPause", cause that checking was only in Stage Visability handler, not in game pause setter. I think that there's can be another variable like "muteOnDomPause" and "muteOnPause". set: function (value) { if (value === true) { if (this._paused === false) { this._paused = true; if (this.sound.muteOnPause) { this.sound.setMute(); } this.time.gamePaused(); this.onPause.dispatch(this); } this._codePaused = true; } else { if (this._paused) { this._paused = false; if (this.sound.muteOnPause) { this.sound.unsetMute(); } this.input.reset(); this.time.gameResumed(); this.onResume.dispatch(this); } this._codePaused = false; } } P.S In my game i did the next thing: i create 2 variables: muteOnDOMPause and muteOnPause. and every usage of previous of muteOnPause i change as muteOnDOMPause, and in setter of game pause and only there i use muteOnPause; In game i can actually choose what kind of mute i need
  2. Sound muteOnPause problem

    It doesn't mute when the game window is unfocused, but when game paused it does.
  3. Sound muteOnPause problem

    Hi, i have music in my game, but i don't want to stop it when game paused. I found "this.game.muteOnPause = false" but it doesn't work. What am i doing wrong? Thanks. Phaser v2.10.0
  4. Body mass problem

    No, body with high mass just walking through, but if mass like 9999 the body collide with bounds..that's problem with static body collision i think. But i don;t know how to solve it
  5. Body mass problem

    Hi, i need help. I tried to make Dynamic body without influence of other bodies, just like kinematic body, but with collision detection. So i decided to set body.mass = 99999999 and that worked perfectly, but when i'm setting collideWorldBounds = true player just walking through world Bounds...Is there an answer to do this right? I've tried sensors but they don't working...
  6. Sprite pool reusing bug(?)

    20 hours fighting with this "bug"...but fixed. Problem was in this line this.bullet = this.bullets.getFirstExists(false); That is correct version: this.bullet = this.bullets.getFirstExists(false, false, this.player.x -14+(28*i), this.player.y - this.player.height/2); i don't know why, but if i don't set position in this method, and set it up later this "bug" shows up.
  7. Sprite pool reusing bug(?)

    That's not object pool bug, i've found that bug appears when i use bullet.kill() right at the moment when collision is started (OR i'm wrong, cause hard to recreate bug when i slowly move the ship that fires bullets). But i don't know how to fix this and why it appears in that way...Can i somehow clear colliding forces when i use bullet.kill() function? Does someone know? (Plz help, my brain is literally blowing up) Thanks)
  8. Sprite pool reusing bug(?)

    Hi, i'm going to create phaser runner game, but i stuck with one problem. I create a bullets like this: this.bullets = this.game.add.group(); this.bullets.name = 'bullets'; this.bullets.enableBody = true; this.bullets.physicsBodyType = Phaser.Physics.P2JS; this.bullets.createMultiple(100, 'playerBullet', 0, false); this.bullets.forEach(function(child){ child.body.setRectangle(25, 35, 0, 0); child.name = "bullet"; child.anchor.set(0.5, 0.5); child.body.motionState = Phaser.Physics.P2.Body.KINEMATIC; //child.body.debug = true; child.body.onBeginContact.add(SimpleGame.prototype.onBulletBeginContact, this); }, this); this.bullets.setAll('outOfBoundsKill', true); this.bullets.setAll('checkWorldBounds', true); and creating them 5 times at second this.shotTime.loop(200, SimpleGame.prototype.shotTheEnemies, this); shotTheEnemies(e:Phaser.TimerEvent) { let bullet: Phaser.Sprite; for (var i = 0; i < 2; i++) { bullet = this.bullets.getFirstExists(false); if (bullet) { bullet.reset(this.player.x -14+(28*i), this.player.y - this.player.height/2-20); bullet.body.moveUp(900); //console.log(bullet.body.) } } } But in time when bullets hit enemy and i use bullet.kill() some of pool bullets don't have speed(And i can't manipulate them till i use bullet.kill again, BUT i don't know which bullets are lag). That's not happening when bullets hit the world bounce. Please help)
  9. Phaser poor performance on mobile

    debug.text is really slow method. How many fps without whis method? On my mobile game with this method runs 45-55 fps(Meizu m3) also you should use bitmap texts, they improve performance but require a lot of memory
  10. Phaser resizeChange

    Thank you for the answer, but my problem was pretty easier than i thought. i've just changed the path to function. Somehow it didn't see it; this.game.scale.setResizeCallback(this.resizeCallBack, this); That's work: this.game.scale.setResizeCallback(SimpleGame.prototype.resizeCallBack, this);
  11. Phaser resizeChange

    i found solution, but it can be not right one.. i've removed setResizeCallback and replaced onSizeChanged to time.event.loop with checking the changing of window size...But i still hope there is an event(Signal) to detect changing window size.
  12. Phaser resizeChange

    Hi(sorry for my English), i've just started using Phaser, but i stucked with one problem. I have a problem with resizeChange of my game. onSizeChange and setResizeCallback just don't work. When i resizing my browser they don't generate signals. I know there is many themes like that but i've seen every of them and didn't find a solution. Please help) P.S: Phaser 2.9.1. May be trouble in this version of Phaser? In that version even state.callbackContext.resize() was removed. My typescript code(code for resizeCallback i've took from another theme): this.game.scale.setResizeCallback(this.resizeCallback, this); this.game.scale.onSizeChange.add(()=> { let scale_x: number = window.innerWidth / this.game.width; let scale_y: number = window.innerHeight / this.game.height; this.game.scale.setUserScale(scale_y, scale_y); this.game.scale.align(true,true); this.game.scale.scaleMode = Phaser.ScaleManager.USER_SCALE; this.game.scale.refresh(); alert("huh"); }, this) resizeCallback(manager) { var userRatio = 1; if(this.game.device.pixelRatio>1) { userRatio = this.game.device.pixelRatio * 1; } if(manager.width !== window.innerWidth*userRatio || manager.height !== window.innerHeight*userRatio) { manager.setGameSize(window.innerWidth*userRatio,window.innerHeight*userRatio); manager.setUserScale(1/userRatio, 1/userRatio); } }