Skip to content

Instantly share code, notes, and snippets.

View mmajewsk's full-sized avatar
🏠
Working from home

mwmajewsk mmajewsk

🏠
Working from home
View GitHub Profile
@mmajewsk
mmajewsk / node.py
Created June 21, 2015 09:23
A-star python pathfinding algorithm
__author__ = 'hawker'
import math
class Node:
xPos = 0 # x position
yPos = 0 # y position
distance = 0 # total distance already travelled to reach the node
priority = 0 # priority = distance + remaining distance estimate
def __init__(self, xPos, yPos, distance, priority):
self.xPos = xPos
self.yPos = yPos