JamieR

Members
  • Content count

    18
  • Joined

  • Last visited

About JamieR

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. JamieR

    How to unpause

    Is there any way of achieving this without having to upgrade from Kore Springs as it breaks when I do and obviously I'd rather not have to update all my code if possible?
  2. JamieR

    How to unpause

    It appears to be working on there. I wonder if I should attempt to upgrade my version of Phaser and hope it doesn't break!?
  3. JamieR

    How to unpause

    Chrome (most recent version) and mouse
  4. JamieR

    How to unpause

    So - I have two buttons - one for pausing the other for unpausing pauseButton = this.game.add.button(this.game.world.centerX, 500, 'restartButtonimg', pauseButtonAciononClick, this, 2, 1, 0); pauseButton.anchor.setTo(0.5, 0.5) unpauseButton = this.game.add.button(this.game.world.centerX, 300, 'restartButtonimg', unpauseButtonAciononClick, this, 2, 1, 0); When clicked, they call - function pauseButtonAciononClick () { this.game.paused = true; } function unpauseButtonAciononClick () { this.game.paused = false; } The pause button works fine in that the game is paused. However, the unpause does not work in that it doesn't unpause, but I coded it to do a console.log which it did do, so I am unsure what is wrong? It seems that the button for unpause does not respond, as I guess input is paused, but if you are saying that it shouldn't disrupt the update process then I'm unsure how to fix it? Using Kore Springs. Thanks
  5. JamieR

    How to unpause

    Hi - thanks for the reply. So far, being a complete amateur, I have only been using this.game.paused = true; which does achieve the pausing but without the ability to unpause - not sure if this is the best way or not. I am using the Kore Springs version as the tutorial I am following is based on that - would that be the issue?
  6. JamieR

    How to unpause

    Hi, I have set up the pausing function of my game, but it seems to be disabling all input when it is set to true. How do I fix this?
  7. JamieR

    OOP for this or not?

    So, I want to create a menu for displaying the controls to my game - I will be using multiple variables, inevitably, for each control explanation. This will likely take the form of at least 5-7 variables, so instead of writing a variable out multiple times to achieve this, would constructing a new object per "explanation" be more efficient as I will have to pass this.game.world.CenterX for each one, as well as its position and its font colour, so I didn't know if it would be more efficient using OOP or not? If it would be, how could I achieve this? The heading.anchor.set part will remain the same for all "explanations", hence why I am considering implementing a more efficient way of achieving this. If I have misunderstood/misconstrued the usefulness of OOP in this, then please just say as I am still learning Phaser and OOP so I am unsure as to whether what I want to do could be done more efficiently or not. Thanks. ControlMenuState = {}; x = 480; y = 300; ControlMenuState.create = function () { this.game.stage.backgroundColor = '#6d94b5'; var heading = this.game.add.text(this.game.world.centerX, 100, 'Controls...', {fill: 'white'}); heading.anchor.set(0.5, 0.5); }
  8. JamieR

    Prototypes and OOP

    Hi, I am new to both JavaScript and Phaser, and am following this tutorial: https://mozdevs.github.io/html5-games-workshop/en/guides/platformer/start-here/ I am confused by the difference between prototypes and objects in Phaser - are they both implementations of OOP or what? I am attempting to create a UML class diagram, but I am struggling to put it together as I don't know if prototypes are objects or not! Also, if i have something.prototype.move = function (), is that an example of using the prototype's/object's methods? And how does this. work? Thanks so much!