Jump to content

Search the Community

Showing results for tags 'physics tilemap'.

  • 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 trying to make a physics sprite collide with a Dynamic TileMap but I cannot get it collide. There is a github with my code here: https://github.com/nahkranoth/FactorySimulator/tree/tilemap-creator I took this as an example: https://labs.phaser.io/edit.html?src=src\game objects\tilemap\collision\tile callbacks.js I setup the tilemap like this (in tileMap.js) note that tileset is a tileset I created by generating a texture out of a graphic but I don't think that should matter: this.layer = this.map.createDynamicLayer(0, tileset, 0, 0); this.layer.setCollision(1); Then in game.js I make a physics sprite and add it to the collider: this.sprite1 = this.physics.add.sprite(120, 420, "tiles"); this.tilemap.layer.setTileIndexCallback(1, this.hitCoin, this); this.physics.add.collider(this.sprite1, this.tilemap.layer); >> The callback hitCoin is called when the sprite is colliding with a tile, but the sprite wont stop on a tile. While I took this from earlier code and it did stop. I know this explanation is missing a lot of details that matter - but if you look at those two files in the github project you should be able to find out those details. edit: Does the fact that I set the index of the tiles like tile.index = 1? IS there another method I'm not aware of?
×
×
  • Create New...