Posted: 1st Sep 2011 21:31
been trying to figure out whats the best way to have a sprite go from one location to another but avoid objects in there path, go around.. without waiting to bump into it..... any ideas?
Posted: 1st Sep 2011 23:14
Have a Google for A* pathfinding. There's loads of examples in all sorts of languages, so you'll probably be able to find one that you can both understand and convert to AGK.
Posted: 2nd Sep 2011 2:55
well, ive got one sort, and i have code in c++ already that will do this, problem is i dont know this version of basic language well enough. not very much in the way of documntation. is nothing like visual basic, so thats not the problem at all... ive tried converting my c++ code to this and thats were my problems are..
Posted: 5th Sep 2011 5:02
Coding this from scratch is not that easy, and it entirely depends on the complexity of the obstacle. If for example you know the obstacle is only ever a single circle, then you can do something quick and cool like detecting when the object is within the radius of the circle, then plotting a new path to skim the edge of that circle and then a second point to the original destination (using a simple state machine). I am sure a fellow AppGameKit user can knock up a simple example of this to get you started thinking about the intricate world of path-finding!