Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Psychopathetica

Member Since 05 Apr 2011
Offline Last Active May 11 2013 03:17 PM
-----

#5013666 A-Star Path Following Questions

Posted by Psychopathetica on 23 December 2012 - 08:42 AM

Basically the player is you or anyone that plays the game. When you, the player, move and end up on the next tile, the entire A* Path of the monster changes by getting cleared, then it recalculates the A* Path for a new path for the monster to follow. That way the monster can goto the proper end destination, which is at the player itself. I never thought of using the tiles themselves but its probably gonna be hell changing it all to do that. But now that I think about it... it all makes sense. Heres why. I had the A* Path collect a series of coordinates based on the pixel location of every node. When the monster moves left towards the next tile, the first pixel from the top left of the monster being inside the left tile will recalculate the coordinates of the monster showing its inside the next tile.And since my path following code was having the monster move to the next tile being (-1) of the next path, this would make the monster try move to the tile after that! Its no wonder why the monster was draging on the walls in corners moving left / up, while right / down was normal.




PARTNERS