SPARKY892

Members
  • Content Count

    2
  • Joined

  • Last visited

About SPARKY892

  • Rank
    Newbie

Contact Methods

  • Website URL
    http://www.nightshiftgames.co.uk
  • Twitter
    MarkSmellie

Profile Information

  • Gender
    Male
  1. The button is created here: SwingB = this.game.add.button(1400, 830, "SwingButton", this.Swing, this, 0, 0, 0, 0); The property is changed here: Swing: function() { if (Started == true){ //this.game.camera.follow(Ball, Phaser.Camera.FOLLOW_TOPDOWN); var VelocityX = (Power * Math.cos((Arrow.angle -90) * Radian) * 10); var VelocityY = (Power * Math.sin((Arrow.angle -90) * Radian) * 10); Ball.body.velocity.x += VelocityX; Ball.body.velocity.y += VelocityY; Started = false; this.PowerF.visible = false; this.PowerB.visible = false; this.SwingB.visible = false; } if (Started == false) { this.PowerB = this.game.add.sprite(1400, 830, "PowerBar"); this.PowerF = this.game.add.sprite(1649, 1080, "PowerFill"); this.PowerF.anchor.setTo(0.5, 1); this.PowerB.fixedToCamera = true; this.PowerF.fixedToCamera = true; this.PowerF.rotation = 181 * Radian; Power = 0; Started = true; } Block.body.onBeginContact.add(this.StartEmitter, this); }, PowerF and PowerB both disappear fine though they are sprites if that makes a difference.
  2. Hi I am currently working on a game using phaser but having problems where I want to display a button that you click once to start charging a power bar and then click again to set the power but once you do this the button should hide until the item being launched comes to rest for you to then repeat the process as needed. I have tried using button.visible = false, but nothing appears to change and outputting the value to the console shows it is false. Thanks in advance for any help