Author Topic: Help with A* (path finding)  (Read 568 times)

Offline mobeamer

  • Level 13
  • *
  • Posts: 93
  • Reputation: +0/-0
    • View Profile
    • Untouchable Games
Help with A* (path finding)
« on: October 03, 2008, 08:18:30 AM »
Hello All,

This is kind of lazy of me, but it does not hurt to ask....

I need too write a path finding algorithm in javascript. Anyone out there want to take a shot at it for me? Just for fits and giggles???

I've got the following functions that you can use:

getMapWidth() --returns map width
getMapHeight() -- returns map height
isWalkable(x,y) -- returns Y if the tile can be walked upon
movementCost(x,y) -- returns a decimal value of how much it cost to move _through_ that "tile"

//should return a string delimit set of locations, which make up the path.
// if the path can not be found, return a blank string
//for example: getShortestPath(0,0,3,3) => "0,0:1,1:2,2:3,3"
//for example: getShortestPath(0,0,1000,1000) => ""

function getShortestPath(startX, startY, destX, destY)
{
...your code here
}

Again....I'm trying to save myself time here...eventually I will get to this. (I swear!)

FYI: The Isometric Game Engine is coming along very nicely!!



I build games
My Blog

Offline mobeamer

  • Level 13
  • *
  • Posts: 93
  • Reputation: +0/-0
    • View Profile
    • Untouchable Games
Re: Help with A* (path finding)
« Reply #1 on: October 30, 2008, 02:56:06 PM »
For those interesting, I ended up writing my own...

http://mobeamer.blogspot.com/2008/10/path-finding-in-javascript.html

I build games
My Blog

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal