forked from Jev353/A-Stars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassets.py
25 lines (19 loc) · 871 Bytes
/
assets.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
import pygame
# Get images
mapADAImage = pygame.image.load("assets\\mapADA.png")
mapNoADAImage = pygame.image.load("assets\\mapNoADA.png")
## UI Object representing a node that can be clicked
class ClickableNode:
def __init__(self, ID: str, x: int, y: int):
self.ID = ID
self.x = x
self.y = y
self.radius = 25
surfaceWidth = self.radius * 2
surfaceHeight = self.radius * 2
# Create transparent surface
self.surface = pygame.Surface((surfaceWidth, surfaceHeight), pygame.SRCALPHA)
# Draw a circle on the surface
pygame.draw.circle(self.surface, "red", (self.radius, self.radius), self.radius)
# Move the rect to the actual location
self.clickRect = pygame.Rect(self.x - self.radius, self.y - self.radius, self.radius*2, self.radius*2)