Jump to content

Search the Community

Showing results for tags 'sink'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. I have a phaser game. My aim now is to make the group 'question' appear to sink in the sea. If the user clicks on the correct option, the ship should come back up. If the user clicks on the wrong option, the ship should sink completely. The JS: create: function() { game.physics.startSystem(Phaser.Physics.ARCADE); this.bgMusic = this.game.add.audio('bgMusic'); this.bgMusic.loop = true; this.bgMusic.play(); //background this.background = this.game.add.sprite(0,0,'bg'); this.sea = this.game.add.sprite(0,0,'sea'); //this.ship = this.game.add.sprite(this.game.world.centerX,340,'ship'); question = this.game.add.group(); var ship = question.create(this.game.world.centerX,340,'ship'); ship.anchor.setTo(0.5); var text = question.create(this.game.world.centerX,420, 'question'); text.anchor.setTo(0.5); this.seafg = this.game.add.sprite(0,400,'seafg'); this.hasB = this.game.add.sprite(30, 40, 'has'); this.hasB.inputEnabled = true; this.hasB.events.onInputDown.add(this.answer,this); this.haveB = this.game.add.sprite(150,40,'have'); this.haveB.inputEnabled = true; this.haveB.events.onInputDown.add(this.answer,this); this.amhasB = this.game.add.sprite(270,40,'amhas'); this.amhasB.inputEnabled = true; this.amhasB.events.onInputDown.add(this.answer,this); this.ishavingB = this.game.add.sprite(390,40,'ishaving'); this.ishavingB.inputEnabled = true; this.ishavingB.events.onInputDown.add(this.answer,this);}In the update function, I tried question.body.velocity.y=-5;But this stopped rendering the game. I also added constructs to check which sprite is being clicked in the function 'answer', but that too stopped the game from rendering. How do I achieve what I want?
×
×
  • Create New...