implementing a high level function in a script to call a low level function in the game engine
- by eat_a_lemon
In my 2d game engine I have a function that does pathfinding, find_shortest_path.
It executes for each time step in the game loop and calculates the next coordinate pair in the series of coordinates to reach the destination object.
Now I want to call this function in a scripting language and have it only return the last coordinate pair result. I want the game engine to go about the business of rendering the incremental steps but I don't want the high level script to care about the rendering. The high level script is only for ai game logic.
Now I know how to bind a method from C to python but how can I signal and coordinate the wait time between the incremental steps without the high level function returning until its time for the last step?