瀏覽代碼

Set title, only show sub name when picking team

master
bertieb 4 年之前
committed by Rob Hallam
父節點
當前提交
dc53f6cca7
共有 1 個文件被更改,包括 10 次插入1 次删除
  1. +10
    -1
      teampicker.py

+ 10
- 1
teampicker.py 查看文件

@@ -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:


Loading…
取消
儲存