S
Simulacron
Guest
I want to set up an enemy ai that moves to the player, when it sees the player. However, my game is grid based, so the enemy should move from gird position to grid position. My problem is to find a suiting method to calculate the path, that the enemy takes. I tried for 3 days to create an a* pathfinding algorithm, but it still doesn't work and now the game doesn't even give an error, but just freezes (It's probably an infinit while loop). Is there any other way to calculate the shortes path between two points, where I get a list of all grid coordiantes, that I then can use in my grid-moving-system? I also don't use the build in variables, like hspeed, etc. Because of that I don't want to use the normal path, because you need to input a speed value. This also wouldn't really work with my grid system. Does anybody has an idea what I can do, is there some build-in datastructur or grid system, that I missed and does the calculation for me?