Jump to content

AndreasWienes

Members
  • Content Count

    9
  • Joined

  • Last visited

About AndreasWienes

  • Rank
    Newbie

Contact Methods

  • Twitter
    andreaswienes
  1. RT @GoogleFacts: The cost of college textbooks has risen 812% in the past 30 years – More than healthcare, housing prices, and college tuit…

  2. I tried to play it on my iPad, but didn't work. I hear sounds and music but see nothing.
  3. Thanks Heppell08 your advice helped me. As you said, I declare a global variable "paused" and before checking if a key is pressed, I test if "paused" is true or "false". Problem solved. :-)
  4. Hello Heppell08, This is what I'm doing: myGame.Game = function(game) { var paused = false;};myGame.Game.prototype = { create: function() { pauseKey = this.game.input.keyboard.addKey(Phaser.Keyboard.P); pauseKey.onDown.add(this.pauseGame, this); }, pauseGame: function() { pauseSound.play(); this.paused = !this.paused; if (this.paused) { level.pause(); player.pause(); } else { level.resume(); player.resume(); } }}And inside Player.js: pause: function() { // thi
  5. Thank you Richard. Till now I used the createCursorKeys() function and checked if one of those keys is pressed inside the update function. So no event handlers have been used. After your hint I changed my code as follows: create: function() { this.cursors = this.game.input.keyboard.createCursorKeys(); this.cursors.left.onDown.add(this.moveLeft, this); }, moveLeft: function() { this.jumpSound.play(); this.sprite.body.velocity.x = -150; }But from my point of view, the movement of the sprite is not happening in the update fu
  6. Thanks for your help but both attempts unfortunately don't work for me. Maybe game.input.keyboard.removeKey(Phaser.Keyboard.UP);game.input.keyboard.addKey(Phaser.Keyboard.UP);is only working inside the create function? removeKey performs correctly, but adding shows no reaction. Disabling the whole keyboard, won't work, just because I need the "P"-key to reactivate the game.
  7. Thanks for the cool list of Phaser Games. A way to vote for the games would be a nice feature.
  8. Hey guys, I'm trying to code a pause function into my little game. I already read the other treads about this topic. I found no way to disable only particular keys, like the cursors, while game is paused. My code: pauseGame: function() { pauseSound.play(); this.paused = !this.paused; if (this.paused) { level.pause(); player.pause(); } else { level.resume(); player.resume(); } }And inside Player.js: pause: function() { this.game.input.keyboard.removeKey(Phaser.Keyboard.UP); }, resume:
×
×
  • Create New...