Members - Reputation: 136
Posted 12 November 2012 - 03:50 AM
Iwe been having couple of problems i want it to be top down shooter...
Now i have no idea how to make my character follow and turn where the mouse is and bullet animition fire in direction of the mouse.
If i could get any tips from you guys i would be really glad i just dont know where to start with this one.
Members - Reputation: 735
Posted 12 November 2012 - 05:03 PM
http://www.policyalmanac.org/games/aStarTutorial.htm:this will explain pathfinding
I recomend python/pygame over c/c++/SDL for begginers.
Crossbones+ - Reputation: 779
Posted 14 November 2012 - 06:53 PM
Suppose your cursor is currently at and your character sprite is located at the point .
Then the vector from the character pointing towards the cursor is . This is the direction your character needs to walk in and it has length . If you want to scale it down to a unit vector so his walk speed is only impacted by direction and not distance, just divide by so your ideal direction vector is just