[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
164
S
49
G
138
Posts: 7,951
Reputation: 91,868

Post » Sun May 10, 2015 10:56 am

very nice behaviour,no lag at all on my phones
B
162
S
39
G
13
Posts: 231
Reputation: 18,255

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
61
G
41
Posts: 2,577
Reputation: 34,314

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
58
S
23
G
22
Posts: 890
Reputation: 16,790

Post » Fri Sep 25, 2015 2:39 pm

Thank you for the info and your time!
ImageImageImageImage
B
155
S
61
G
41
Posts: 2,577
Reputation: 34,314

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
58
S
23
G
22
Posts: 890
Reputation: 16,790

Post » Fri Sep 25, 2015 4:53 pm

So far so good, thanks again!
ImageImageImageImage
B
155
S
61
G
41
Posts: 2,577
Reputation: 34,314

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
58
S
23
G
22
Posts: 890
Reputation: 16,790

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest