Browse Source

(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 years ago
parent
commit
373529565b
3 changed files with 42 additions and 63 deletions
  1. +2
    -3
      subs.txt
  2. +28
    -26
      teampicker.py
  3. +12
    -34
      teams.txt

+ 2
- 3
subs.txt View File

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

+ 28
- 26
teampicker.py View File

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


BGIMG = pygame.image.load("sub_crown_bg_2.png") 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) SUBFONT = pygame.font.SysFont("Fetamont", SUBFONTHEIGHT)
OFFWHITE = (224, 224, 224) OFFWHITE = (224, 224, 224)
HIGHLIGHT = (255, 209, 0) HIGHLIGHT = (255, 209, 0)
@@ -41,7 +41,7 @@ RED = (186, 20, 31)
PURPLE = (121, 35, 158) PURPLE = (121, 35, 158)


screen = pygame.display.set_mode(SIZE) 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 # Set up team text positioning references
# #
@@ -49,14 +49,16 @@ pygame.display.set_caption("Sub Crown September 2021 Team Picker")


TEAMSFILE = "teams.txt" TEAMSFILE = "teams.txt"


TEAMNUMCOLS = 3
TEAMNUMCOLS = 2
TEAMNUMROWS = 12 TEAMNUMROWS = 12


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


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


TEAMCOLS = [] TEAMCOLS = []
TEAMROWS = [] TEAMROWS = []
@@ -139,22 +141,22 @@ class Highlighter(object):
# Choosing time # Choosing time
self.lastchoice = -1 self.lastchoice = -1
# # ** Name-specific choices! ** # # # # ** 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 # # # # End Name-specific stuff # #
# TEAMS[-1].choose()
TEAMS[-1].choose()
pygame.time.set_timer(HIGHLIGHTEVENT, 0) # Disable highlight pygame.time.set_timer(HIGHLIGHTEVENT, 0) # Disable highlight
pygame.time.set_timer(CHOOSEEVENT, 5000, True) # make choice pygame.time.set_timer(CHOOSEEVENT, 5000, True) # make choice
self.iterations = 0 self.iterations = 0
@@ -246,12 +248,12 @@ while True:
for sub in SUBS: for sub in SUBS:
if sub.team == "": if sub.team == "":
# # Name-specific again # # # # 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 # # # # End name-specific # #
# sub.team = TEAMS.pop().team
sub.team = TEAMS.pop().team
pygame.time.set_timer(CLEAREVENT, 100, True) pygame.time.set_timer(CLEAREVENT, 100, True)
break break




+ 12
- 34
teams.txt View File

@@ -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…
Cancel
Save