Jump to content

Search the Community

Showing results for tags 'group.visible'.

  • 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'm making a game similar to the traditional magic tower,and now I have a problem when dealing with the battles between the monster and the braver. here's my code in update(): function update(){ ... game.physics.arcade.collide(braver, monsters, battle, null, this); ... } and here's my battle(): function battle(player, monster) { var x = (player.attack > monster.defence ? player.attack - monster.defence : 0); var y = (monster.attack > player.defence ? monster.attack - player.defence : 0); battleScene.visible = true; while (1) { if (Date.now() > battleTimer) { battleTimer = Date.now() + 1000; monster.health -= x; if (monster.health <= 0) { monster.kill(); player.gold += monster.gold; player.exp += monster.exp; break; } player.health -= y; if (player.health <= 0) { player.kill(); break; } } } battleScene.visible = false; } battleScene is a group,the battle box,What makes me crazy is that battleScene doesn't show on the screen at all(even with battleScene.visible = true),I've tried game.world.bringToTop(battleScene); but it doesn't work,too.So how can I fix that bug?
×
×
  • Create New...