Game Development Using Python: Second Edition by James R. Parker

Game Development Using Python: Second Edition by James R. Parker

Author:James R. Parker [James R. Parker]
Language: eng
Format: epub
Publisher: Mercury Learning and Information
Published: 2021-01-14T16:00:00+00:00


FIGURE 5.7 Initialization for step 1 of A*.

Next: we take one of the nodes from the open list—the one with the smallest F value. Right now there’s only one node in the open list, S, so no problem. Now add all of the nodes that neighbor S to the open list and move S to the closed list. Compute F for all of the new open list entries.

Remember, left-right and up-down neighbors are a distance of 10 from S, and diagonal neighbors are a distance of 14. A sample calculation of F for the node at B7 is:

We do this for all eight neighbors in the open list to arrive at:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.