[BEHAVIOR] EasyStar.js pathfinding for tilemap

Post your completed addons to share with the community

Post » Thu Apr 30, 2015 1:57 am

Thanks. Looks like its working.
Image ImageImage
B
165
S
49
G
146
Posts: 8,034
Reputation: 96,058

Post » Sun May 10, 2015 10:56 am

very nice behaviour,no lag at all on my phones
B
163
S
39
G
13
Posts: 234
Reputation: 18,286

Post » Fri Sep 25, 2015 12:39 pm

Hey, I'm having a small issue with this.

I have a layout "A", when you start the game for the first time Tilemap is already set in the layout "A".
But if you go to layout "B" and few second later go back to layout "A" (or just restart the layout) then same Tilemap object is set from JSON file from local storage (tilemap size, and tiles position).
In both cases pathfinding works fine except "SetTile" action.
After returning to layout "A" and trying tu run action SetTile it gives me an error
"Uncaught TypeError: Cannot read property 'call' of null. EasystarTilemap_behavior.js:177"
ImageImageImageImage
B
155
S
62
G
41
Posts: 2,586
Reputation: 34,412

Post » Fri Sep 25, 2015 2:35 pm

I figured as much... I did the Save and Load to JSON part without ever testing it. Blame me !

I had to override the setTileAt function for the purpose of my plugin, this override get botched on JSON loading. I'll try to find what's wrong and get back to you when I do.
B
59
S
24
G
23
Posts: 927
Reputation: 17,489

Post » Fri Sep 25, 2015 2:39 pm

Thank you for the info and your time!
ImageImageImageImage
B
155
S
62
G
41
Posts: 2,586
Reputation: 34,412

Post » Fri Sep 25, 2015 4:05 pm

Alright, I think I got it. I reuploaded the behavior file, here's a direct link for your conveniance : https://dl.dropboxusercontent.com/u/700 ... ilemap.zip

Please let me know if you find any new bugs!
B
59
S
24
G
23
Posts: 927
Reputation: 17,489

Post » Fri Sep 25, 2015 4:53 pm

So far so good, thanks again!
ImageImageImageImage
B
155
S
62
G
41
Posts: 2,586
Reputation: 34,412

Post » Fri Sep 25, 2015 8:45 pm

THis is great!!! Nice Work!!! please more exampler for beginners!!! this behavior is very interesting
B
4
Posts: 1
Reputation: 204

Post » Fri Oct 02, 2015 8:22 am

how do path on the map between 2 sprites, or even 2 instances of the same sprite?
B
4
Posts: 27
Reputation: 254

Post » Fri Oct 02, 2015 2:31 pm

This is covered in the demos. What you basically need to do is convert your starting point and ending point in tile coordinates. How you define these points is up to you, and once a path is found, it's also up to you to apply any movement.
B
59
S
24
G
23
Posts: 927
Reputation: 17,489

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: DeXVinogradov and 0 guests