pathfinding_tutorial icon indicating copy to clipboard operation
pathfinding_tutorial copied to clipboard

Performance

Open Maeggi opened this issue 6 years ago • 3 comments

Hello, if you click the mouse more often, the character lags. Have any idea for this problem?

And Thanks for the nice Tutorials

Maeggi avatar Apr 11 '18 11:04 Maeggi

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.

Jerenaux avatar Apr 11 '18 12:04 Jerenaux

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 :)

Maeggi avatar Apr 11 '18 16:04 Maeggi

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. :)

Jerenaux avatar Apr 11 '18 19:04 Jerenaux