pathfinding_tutorial
pathfinding_tutorial copied to clipboard
Performance
Hello, if you click the mouse more often, the character lags. Have any idea for this problem?
And Thanks for the nice Tutorials
If I correctly see what you mean, then it's not lag, but the fact that when you re-click, the current timeline is stopped and a new one is started. Since the targets of the tweens of the timeline are tiles and not pixels, if the character is in-between two tiles it will move erratically before finding a tile and then proceeding with the timeline. I don't know if I'm clear. :) I'll try to add a fix for that in the future.
okay, i understand... can u help me to implement pathfinding in this (pixel to pixel)
http://labs.phaser.io/view.html?src=src%5Cgame%20objects%5Ctilemap%5Ccollision%5Ccsv%20map%20arcade%20physics.js&v=beta18
thank you for your answer and sry for my english :)
The idea there would be similar: you need to have one 2D array where each cell correspond to a pixel of the map, and find a way to indicate which one are walkable or not. Then the rest of the approach is exactly the same. :)