Jump to content

Search the Community

Showing results for tags 'astar-plugin'.

  • 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. Hi! I was having a little trouble trying to use AStar + Phaser. I debugged it a bit and discovered a little bug. The X and Y of the astarNode property are wrong, when I set my AStar map, the x and y of all tiles are the same, so the findPath() doesn't work. I'm still trying to fix it, but you guys maybe help me to find the problem faster. Phaser v2.1.1AStar Plugin ( https://github.com/photonstorm/phaser-plugins/blob/master/AStar/AStar.js )tilemap.json ( http://pastebin.com/bQJBxMm7 ) Code:preload: function() { this.game.load.tilemap('map', 'assets/tilemap.json', null, Phaser.Tilemap.TILED_JSON); this.game.load.image('RPGPackSheet', 'assets/sprites/RPGPackSheet.png');},create: function() { this.map = this.game.add.tilemap('map'); this.map.addTilesetImage('RPGPackSheet'); this.layer = this.map.createLayer('LayerName'); this.astar = this.game.plugins.add(Phaser.Plugin.AStar); this.astar.setAStarMap(this.map, 'LayerName', 'RPGPackSheet'); console.log(this.map.layers[0].data[4][6].properties.astarNode);}, The output on the console should be:f: 0,g: 0,h: 0,walkable: false,x: 6, // equals to the second index of layers[0].datay: 4 // equals to the first index of layers[0].data But is giving me in every index the output above:f: 0,g: 0,h: 0,walkable: false, // the walkable changes accordinglyx: 24,y: 13NOTE: It may be related to the height and width of my layer or tilemap ( width: 25, height: 14), but I can't find why its doing that.
×
×
  • Create New...