Jump to content

Search the Community

Showing results for tags 'tilemap destroy'.

  • 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. Hello guys, i have a problem. I can't destroy one type of tile index. I make my tiles in the tile editor and export for json. My tile index are: 1 = grass -> destructible. 2 = ground -> destructible. 3 = rock -> not destructible. (function create) //carregamento de mapa//adiciona mapamap = game.add.tilemap('mapa');map.addTilesetImage('tiles');layer = map.createLayer('cenario'); //maps tile: 1 = grass : 2 = ground : 3 = stone//map.setCollisionBetween(1, 3, true, 'cenario'); // index of the tile //layer.debug = true;layer.resizeWorld(); function update(){game.physics.arcade.collide(player, layer, function(player, layer){//console.log('Colisão com bloco = ', layer.index);//console.log(player.body.blocked);if (tecla.down.isDown) {if(player.body.blocked.down){destroyBlock(layer.index);}};}, null, this); var indextileblock;function destroyBlock(indextileblock){switch (indextileblock){ case 1: //grass indextileblock.destroy(); break; case 2: //ground indextileblock.destroy(); break; case 3: //stone break;} Thanks
×
×
  • Create New...