• Content Count

  • Joined

  • Last visited

Reputation Activity

  1. Like
    erikwittern got a reaction from tackle in How to use the new pauseUpdate function of Phaser 2.0.4 to resume games?   
    Hi *,
    I am very excited about the new pauseUpdate function, which runs while game.paused = true. However, I am unsure how to use it. While it constantly runs once the game is paused, it does not allow to react to input on priorly defined sprites (i.e., pause menu elements that I defined before pausing the game). For example, checks for menuTextButton.input.isDown stop to work in pauseUpdate once the game is paused.
    So, how do I use pauseUpdate to react to user input, for example, to resume the game?
  2. Like
    erikwittern got a reaction from valueerror in Collision of arcade and ninja bodies   
    Thanks for the advise! I actually went that way and created a corresponding accelerateToObject function that I now use with P2 physics. Here is my code, if anybody is interested (it is inspired by the same method in the arcade physics system):
    accelerateToObject: function (obj1, obj2, speed) { if (typeof speed === 'undefined') { speed = 60; } var angle = Math.atan2(obj2.y - obj1.y, obj2.x - obj1.x); obj1.body.force.x = Math.cos(angle) * speed; obj1.body.force.y = Math.sin(angle) * speed;}