瀏覽代碼

(Oct 2021) Update for BL Cricket 96

Display should be looked at, I did horriblwe things but it looks okay in
for 12 teams now
oct-2021
bertieb 3 年之前
父節點
當前提交
373529565b
共有 3 個文件被更改,包括 42 次插入63 次删除
  1. +2
    -3
      subs.txt
  2. +28
    -26
      teampicker.py
  3. +12
    -34
      teams.txt

+ 2
- 3
subs.txt 查看文件

@@ -1,9 +1,8 @@
rarestmonkey
costello_
missgingeramy
pandacat42
mattgamerguy666
ksyme99
etho8282
idiotictendencies
maothecat
burgiuk
idiotictendencies

+ 28
- 26
teampicker.py 查看文件

@@ -31,8 +31,8 @@ SIZE = WIDTH, HEIGHT = 1920, 1080

BGIMG = pygame.image.load("sub_crown_bg_2.png")

FONT = pygame.font.SysFont("Fetamont", 45)
SUBFONTHEIGHT = 35
FONT = pygame.font.SysFont("Fetamont", 65)
SUBFONTHEIGHT = 45
SUBFONT = pygame.font.SysFont("Fetamont", SUBFONTHEIGHT)
OFFWHITE = (224, 224, 224)
HIGHLIGHT = (255, 209, 0)
@@ -41,7 +41,7 @@ RED = (186, 20, 31)
PURPLE = (121, 35, 158)

screen = pygame.display.set_mode(SIZE)
pygame.display.set_caption("Sub Crown September 2021 Team Picker")
pygame.display.set_caption("Sub Crown October 2021 Team Picker")

# Set up team text positioning references
#
@@ -49,14 +49,16 @@ pygame.display.set_caption("Sub Crown September 2021 Team Picker")

TEAMSFILE = "teams.txt"

TEAMNUMCOLS = 3
TEAMNUMCOLS = 2
TEAMNUMROWS = 12

COLSTART = int(WIDTH/TEAMNUMCOLS)
# COLSTART = int(WIDTH/TEAMNUMCOLS)
COLSTART = int(WIDTH/(TEAMNUMCOLS+1))
COLWIDTH = int((WIDTH-COLSTART)/TEAMNUMCOLS)

ROWSTART = int(HEIGHT/(TEAMNUMROWS+2))
ROWHEIGHT = int((HEIGHT-ROWSTART)/TEAMNUMROWS)
# ROWHEIGHT = int((HEIGHT-ROWSTART)/TEAMNUMROWS)
ROWHEIGHT = int((HEIGHT-ROWSTART)/(TEAMNUMROWS-5))

TEAMCOLS = []
TEAMROWS = []
@@ -139,22 +141,22 @@ class Highlighter(object):
# Choosing time
self.lastchoice = -1
# # ** Name-specific choices! ** # #
for tsub in SUBS:
if tsub.team == "":
choosing_sub = tsub
break
for j in range(len(TEAMS)):
if "amy" not in choosing_sub.sub:
if TEAMS[j].team.lower(
).startswith(choosing_sub.sub[0].lower()):
TEAMS[j].choose()
break
else:
if TEAMS[j].team.lower().startswith("a"):
TEAMS[j].choose()
break
# for tsub in SUBS:
# if tsub.team == "":
# choosing_sub = tsub
# break
# for j in range(len(TEAMS)):
# if "amy" not in choosing_sub.sub:
# if TEAMS[j].team.lower(
# ).startswith(choosing_sub.sub[0].lower()):
# TEAMS[j].choose()
# break
# else:
# if TEAMS[j].team.lower().startswith("a"):
# TEAMS[j].choose()
# break
# # End Name-specific stuff # #
# TEAMS[-1].choose()
TEAMS[-1].choose()
pygame.time.set_timer(HIGHLIGHTEVENT, 0) # Disable highlight
pygame.time.set_timer(CHOOSEEVENT, 5000, True) # make choice
self.iterations = 0
@@ -246,12 +248,12 @@ while True:
for sub in SUBS:
if sub.team == "":
# # Name-specific again # #
for k in range(len(TEAMS)):
if TEAMS[k].colour == RED:
sub.team = TEAMS.pop(k).team
break
# for k in range(len(TEAMS)):
# if TEAMS[k].colour == RED:
# sub.team = TEAMS.pop(k).team
# break
# # End name-specific # #
# sub.team = TEAMS.pop().team
sub.team = TEAMS.pop().team
pygame.time.set_timer(CLEAREVENT, 100, True)
break



+ 12
- 34
teams.txt 查看文件

@@ -1,34 +1,12 @@
Avengers
Adepts
Awesomes
Admirables
Bashers
Bruisers
Bouncers
Ballers
Cannoneers
Cavaliers
Chargers
Conquerors
Elites
Eagles
Eliminators
Equalisers
Ionisers
Icers
Imps
Iridescents
Killers
Kings
Knights
Knockouts
Manglers
Militants
Majestics
Mighties
Marauders
Macerators
Ravagers
Redoubtables
Reavers
Rampagers
Australia
England
Holland
India
Kenya
New Zealand
Pakistan
South Africa
Sri Lanka
UAE
Zimbabwe
West Indies

Loading…
取消
儲存