Tag Info

New answers tagged

0

By using continuous agent positions on a tiled map, the translation from a tile-list path to a points-list path is best served by a Funnel Algorithm. Basically doing what you have been, but only checking intermediate tile-vertices on the path that are next to an obstacle (which will naturally be where the tile-path has a bend). I see ray-tracing as ...


-2

This one looks interesting: http://www.codeproject.com/Articles/455 I wonder is it better than A*?


0

I would do something like this: int pixelPerFPS; // pixel per FPS void move(int x, int y); void update(int time) { character.currentX += (character.goalX - character.currentX) / abs(character.goalX - character.currentX) * pixelPerFPS; character.currentY += (character.goalY - character.currentY) / abs(character.goalY - character.currentY) * ...


1

You need to “parse” the string of positions using a state, the orientation of your plane/car/bomberman/boat/... Let say you represent direction by unitary vector in the direction; e.g. north is [0,1], east is [1,0], south is [0,-1], west is [-1,0] Now you have the direction of the car as a state during parsing, which is initialize to the current direction ...


1

If you are talking about move horizontally and vertically at a same time, the problem is not here. You are doing fine. Maybe problem belong to input module. About A*, it's a path finding algorithm, it return series of point present the path you ask for. Movement is another problem, don't stick it with A*. The easiest way to implement moving system are ...


5

Scenario It seems your pathfinding and collision detection have different ideas of what's OK, when it comes to walking around corners. Say your pathfinding plans out this path (brown squares are walls, yellows are empty space, green is an enemy character, arrows are the planned path): The enemy character then moves directly toward each point from the ...


0

I would not call this a that simple but here is now you can do it: Let's first have some notations (given the picture you provided): A = green dot; B = pink; C = Purple; D = Red Q = blue; P = the polygon defined by a set of segments or lines. So basically you want to know if any line QA , QB , QC , or QD intersects your polygon P The naive ...


1

You can create an algorithm based of edge intersection. The idea is to draw a line between the two points called a ray. This then acts as a line to test whether the polygons lines intersect. You can do this in pseudo-code: // Method in point: bool IsPointBehindPolygon( testPoint, polygon) { originPoint = this; ray = new Line(originPoint, ...



Top 50 recent answers are included