-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpoints.py
40 lines (30 loc) · 1.01 KB
/
points.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import pygame, sys
from pygame.locals import *
class Points():
"""
Points objects on which the player moves
"""
def draw_point(self,display,cords,color,size):
point = pygame.draw.circle(display,color,(cords[0],cords[1]),size)
def __init__(self,cords=(0,0),checked=False,point_pos=pygame.Rect,pointradius=pygame.Rect,p1_goal=False,p2_goal=False):
self.cords = cords
self.checked = checked
self.point_pos = point_pos
self.point_radius = pointradius
self.p1_goal=p1_goal
self.p2_goal=p2_goal
def __repr__(self):
return(str(self.cords))
class Node():
def __init__(self,parent=None, position=None):
self.parent = parent
self.position = position
self.g = 0
self.h = 0
self.f = 0
def __eq__(self, other):
return self.position == other.position
def __repr__(self):
return str((self.position))
def __hash__(self):
return hash(self.position)