|
|
@@ -41,6 +41,7 @@ RED = (186, 20, 31) |
|
|
|
PURPLE = (121, 35, 158) |
|
|
|
|
|
|
|
screen = pygame.display.set_mode(SIZE) |
|
|
|
pygame.display.set_caption("Sub Crown Nov 2020 Team Picker") |
|
|
|
|
|
|
|
# Set up team text positioning references |
|
|
|
# |
|
|
@@ -108,12 +109,14 @@ class Sub(object): |
|
|
|
|
|
|
|
def __init__(self, sub): |
|
|
|
self.sub = sub |
|
|
|
self._sub = "" |
|
|
|
self.team = "" |
|
|
|
self.x = 20 |
|
|
|
self.y = 0 |
|
|
|
|
|
|
|
def draw(self): |
|
|
|
draw_text(self.sub, SUBFONT, BLUE, self.x, self.y) |
|
|
|
if self._sub != "": |
|
|
|
draw_text(self.sub, SUBFONT, BLUE, self.x, self.y) |
|
|
|
if self.team != "": |
|
|
|
draw_text(self.team, SUBFONT, PURPLE, |
|
|
|
self.x, int(self.y+SUBFONTHEIGHT)) |
|
|
@@ -200,6 +203,12 @@ while True: |
|
|
|
if sub.team == "": |
|
|
|
sub.team = TEAMS.pop().team |
|
|
|
elif event.key == 32: |
|
|
|
# Display who we're choosing for |
|
|
|
for sub in SUBS: |
|
|
|
if sub._sub == "": |
|
|
|
sub._sub = sub.sub |
|
|
|
break |
|
|
|
# Start the "who's it going to pick?" animation |
|
|
|
pygame.time.set_timer(HIGHLIGHTEVENT, 100) # every 100ms |
|
|
|
print(event.key) |
|
|
|
elif event.type == HIGHLIGHTEVENT: |
|
|
|