diff --git a/README.md b/README.md index 75f7097..5dabe3a 100644 --- a/README.md +++ b/README.md @@ -32,4 +32,4 @@ This software is designed to be used with the Raspberry Pi. If you would like to Also, to use the X11 system from within a container, see this [Medium article](https://medium.com/geekculture/run-a-gui-software-inside-a-docker-container-dce61771f9). -WARNING!!! This repo is under rapid development as we move it to modern Python and put it into a container image to more easily be run and maintained. \ No newline at end of file +WARNING!!! This repo is under rapid development as we move it to modern Python and put it into a container image to more easily be run and maintained. diff --git a/button.py b/button.py index e6ddf0b..5f741ef 100644 --- a/button.py +++ b/button.py @@ -10,9 +10,13 @@ def __init__(self): #Setup pins and board gpio.setmode(gpio.BCM) + #Pin 22 is Team 2 gpio.setup(22, gpio.IN, pull_up_down=gpio.PUD_DOWN) + #Pin 4 is Team 3 gpio.setup(4, gpio.IN, pull_up_down=gpio.PUD_DOWN) + #Pin 17 is Team 1 gpio.setup(17, gpio.IN, pull_up_down=gpio.PUD_DOWN) + #GPIO Needs to be setup between 3.3v and pins above #Put pins in variables self.center_button = 22 diff --git a/docker-compose.yml b/docker-compose.yml index 64226d8..54175ad 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ services: - # Building and testing environment + # Developing and testing environment dev: build: context: . @@ -9,16 +9,17 @@ services: image: ghcr.io/btc-raspberrypiclub/jeopardy:latest stdin_open: true tty: true - command: ["/bin/bash"] volumes: #- ${PWD}:/app - /tmp/.X11-unix:/tmp/.X11-unix + # Bring the DISPLAY through from the host environment: - DISPLAY=${DISPLAY:-:0} privileged: true profiles: - build + # The actual application service for live app: image: ghcr.io/btc-raspberrypiclub/jeopardy:latest stdin_open: true diff --git a/games/Example/categories.txt b/games/Example/categories.txt deleted file mode 100644 index 6db3bbe..0000000 --- a/games/Example/categories.txt +++ /dev/null @@ -1,5 +0,0 @@ -SAMPLE CATEGORY -EXAMPLE CATEGORY -MODEL CATEGORY -TEST LONG CATEGORY NAME -PROTOTYPE CATEGORY diff --git a/games/Example/players.txt b/games/Example/players.txt deleted file mode 100644 index 6ac65fe..0000000 --- a/games/Example/players.txt +++ /dev/null @@ -1,3 +0,0 @@ -Team 1 -Team 2 -Team 3 diff --git a/games/Example/INSTRUCTIONS.txt b/games/Jeopardy/INSTRUCTIONS.txt similarity index 100% rename from games/Example/INSTRUCTIONS.txt rename to games/Jeopardy/INSTRUCTIONS.txt diff --git a/games/Example/amounts.txt b/games/Jeopardy/amounts.txt similarity index 100% rename from games/Example/amounts.txt rename to games/Jeopardy/amounts.txt diff --git a/games/Jeopardy/categories.txt b/games/Jeopardy/categories.txt new file mode 100644 index 0000000..bbacf23 --- /dev/null +++ b/games/Jeopardy/categories.txt @@ -0,0 +1,5 @@ +BEARS CATEGORY +BEETS CATEGORY +BATTLESTAR CATEGORY +GALACTICA LONG CATEGORY NAME +ALLURBASE CATEGORY diff --git a/games/Example/clues.txt b/games/Jeopardy/clues.txt similarity index 100% rename from games/Example/clues.txt rename to games/Jeopardy/clues.txt diff --git a/games/Jeopardy/players.txt b/games/Jeopardy/players.txt new file mode 100644 index 0000000..b5a7aa2 --- /dev/null +++ b/games/Jeopardy/players.txt @@ -0,0 +1,5 @@ +Team Alpha +Team Beta +Team Gamma +Team Delta +Team Epsilon diff --git a/games/Example/rules.txt b/games/Jeopardy/rules.txt similarity index 100% rename from games/Example/rules.txt rename to games/Jeopardy/rules.txt diff --git a/games/Prototype/INSTRUCTIONS.txt b/games/Prototype/INSTRUCTIONS.txt deleted file mode 100644 index 128dc47..0000000 --- a/games/Prototype/INSTRUCTIONS.txt +++ /dev/null @@ -1,118 +0,0 @@ -======================================================================== -THE FOLLOWING ARE INSTRUCTIONS TO CREATE YOUR OWN VALUES FOR GAME DATA | -======================================================================== -Please note that each respective file has sample data included to aid -you in writing your own data. - -======= -CLUES | -======= - * Clues must be written in 'clues.txt,' located in the folder containing - these instructions. - - * Clues must be separated in these files by one or more blank lines. - -This means there cannot be any blank lines within a single clue. - -For easiest viewing, separate clues in the same category by one line, - and categories by several. - - * There are sample clues already in 'clues.txt' to guide you. - To create your own clues, replace the sample data with your own text, - taking note of the following: - - - Clues are written starting from the top left clue box, then by column. - ~ Example: On a 5x5 board, the first 5 clues will be the clues for - the leftmost category, starting at the top. The next 5 will be for - the column to the right, starting at the top. - - - Clues can be any length, but abnormally long clues may be too small - to be easily read. - - - As can be seen in the sample clues, you may choose to write an - entire clue on a single line or dictate the line breaks - yourself. The simplest method is to write each clue on a single - line. - - -============ -CATEGORIES | -============ - * Categories must be written in 'categories.txt,' located in the folder - containing these instructions. - - * Each non-empty line in 'categories.txt' is treated as a category. - Replace the sample categories with your own. - - * The capitalization used in 'categories.txt' will be used in the game - (all caps is recommended). - - * Leading or trailing whitespace (spaces, tabs, returns) is ignored. - - * Category names can be any length/any number of words, but shorter - is better for readability. - - -============== -PLAYER NAMES | -============== - * Player names are defined in 'players.txt,' located in the folder - containing these instructions. - - * Each player/team name must be on a separate line. - - * There is a maximum of 3 players/teams at this time. If more names - are provided in the file, they will be ignored, and a warning message - printed. If there are fewer than 3 names provided, default names - (Player 1, etc...) will be used for missing names. - - * Leading or trailing whitespace (spaces, tabs, returns) is ignored. - - * Names can be any length and any number of words, but keep in mind very - long names may be drawn so small as to be essentially unreadable. - - -========= -AMOUNTS | -========= - * Clue amounts are defined in 'amounts.txt,' located in the folder - containing these instructions. - - * Each amount should be on a separate line, and must be only an integer - (ex: 200). - - * Do not include a dollar sign, decimal or any other non-numeric character. - - * Make sure the number of amounts matches the number of clues per category. - - * Amounts can be arbitrarily high, but note that scores of 10 million or higher - will not fit properly on the podia. There are no plans to change this behavior - as it is considered an extreme edge case. - - -======= -RULES | -======= - * Rules are defined in 'rules.txt,' located in the folder containing - these instructions. - - * Rules are displayed after the opening sequence, before the category - scroll. - - * Each rule should be on a separate line. - - * Leading or trailing whitespace (spaces, tabs, returns) is ignored. - - * It is recommended to start each rule with a bullet-like character, such as - an asterisk (*). - - -========== -SUBTITLE | -========== - * Subtitle must be written in 'subtitle.txt,' located in the folder - containing these instructions. - - * The first line in 'subtitle.txt' containing any non-whitespace text - is treated as the subtitle. - - * If no subtitle is desired, make 'subtitle.txt' empty (do not delete it, - however). diff --git a/games/Prototype/amounts.txt b/games/Prototype/amounts.txt deleted file mode 100644 index eb950e1..0000000 --- a/games/Prototype/amounts.txt +++ /dev/null @@ -1,5 +0,0 @@ -200 -400 -600 -800 -1000 diff --git a/games/Prototype/categories.txt b/games/Prototype/categories.txt deleted file mode 100644 index 6db3bbe..0000000 --- a/games/Prototype/categories.txt +++ /dev/null @@ -1,5 +0,0 @@ -SAMPLE CATEGORY -EXAMPLE CATEGORY -MODEL CATEGORY -TEST LONG CATEGORY NAME -PROTOTYPE CATEGORY diff --git a/games/Prototype/clues.txt b/games/Prototype/clues.txt deleted file mode 100644 index 31fc3f6..0000000 --- a/games/Prototype/clues.txt +++ /dev/null @@ -1,90 +0,0 @@ -THIS IS AN EXAMPLE OF A LONG CLUE WRITTEN ON A SINGLE LINE. ITS TEXT IS AUTOMATICALLY FIT TO THE CLUE SCREEN - -THIS IS AN EXAMPLE OF A CLUE -WITH MANUAL LINE BREAKS. -THE LINES OF CLUES LIKE THIS -MUST BE SEQUENTIAL IN THE -FILE, WITH NO BLANK LINES -BETWEEN THEM - -THIS IS AN EXAMPLE OF A CLUE WITH AN AUDIO READING. NOTE HOW PLAYERS ARE NOT ABLE TO RING-IN UNTIL THE AUDIO HAS FINISHED - -EXAMPLE PICTURE ANSWER - -THIS CLUE HAS AUDIO ATTACHED TO IT. PRESS "M" TO TRIGGER IT, WHICH WILL ALSO ALLOW PLAYERS TO BUZZ IN. - - - - - -THIS IS AN EXAMPLE OF A LONG CLUE WRITTEN ON A SINGLE LINE. ITS TEXT IS AUTOMATICALLY FIT TO THE CLUE SCREEN - -THIS IS AN EXAMPLE OF A CLUE -WITH MANUAL LINE BREAKS. -THE LINES OF CLUES LIKE THIS -MUST BE SEQUENTIAL IN THE -FILE, WITH NO BLANK LINES -BETWEEN THEM - -THIS IS AN EXAMPLE OF A CLUE WITH AN AUDIO READING. NOTE HOW PLAYERS ARE NOT ABLE TO RING-IN UNTIL THE AUDIO HAS FINISHED - -EXAMPLE PICTURE ANSWER - -THIS CLUE HAS AUDIO ATTACHED TO IT. PRESS "M" TO TRIGGER IT, WHICH WILL ALSO ALLOW PLAYERS TO BUZZ IN. - - - - - -THIS IS AN EXAMPLE OF A LONG CLUE WRITTEN ON A SINGLE LINE. ITS TEXT IS AUTOMATICALLY FIT TO THE CLUE SCREEN - -THIS IS AN EXAMPLE OF A CLUE -WITH MANUAL LINE BREAKS. -THE LINES OF CLUES LIKE THIS -MUST BE SEQUENTIAL IN THE -FILE, WITH NO BLANK LINES -BETWEEN THEM - -THIS IS AN EXAMPLE OF A CLUE WITH AN AUDIO READING. NOTE HOW PLAYERS ARE NOT ABLE TO RING-IN UNTIL THE AUDIO HAS FINISHED - -EXAMPLE PICTURE ANSWER - -THIS CLUE HAS AUDIO ATTACHED TO IT. PRESS "M" TO TRIGGER IT, WHICH WILL ALSO ALLOW PLAYERS TO BUZZ IN. - - - - - -THIS IS AN EXAMPLE OF A LONG CLUE WRITTEN ON A SINGLE LINE. ITS TEXT IS AUTOMATICALLY FIT TO THE CLUE SCREEN - -THIS IS AN EXAMPLE OF A CLUE -WITH MANUAL LINE BREAKS. -THE LINES OF CLUES LIKE THIS -MUST BE SEQUENTIAL IN THE -FILE, WITH NO BLANK LINES -BETWEEN THEM - -THIS IS AN EXAMPLE OF A CLUE WITH AN AUDIO READING. NOTE HOW PLAYERS ARE NOT ABLE TO RING-IN UNTIL THE AUDIO HAS FINISHED - -EXAMPLE PICTURE ANSWER - -THIS CLUE HAS AUDIO ATTACHED TO IT. PRESS "M" TO TRIGGER IT, WHICH WILL ALSO ALLOW PLAYERS TO BUZZ IN. - - - - - -THIS IS AN EXAMPLE OF A LONG CLUE WRITTEN ON A SINGLE LINE. ITS TEXT IS AUTOMATICALLY FIT TO THE CLUE SCREEN - -THIS IS AN EXAMPLE OF A CLUE -WITH MANUAL LINE BREAKS. -THE LINES OF CLUES LIKE THIS -MUST BE SEQUENTIAL IN THE -FILE, WITH NO BLANK LINES -BETWEEN THEM - -THIS IS AN EXAMPLE OF A CLUE WITH AN AUDIO READING. NOTE HOW PLAYERS ARE NOT ABLE TO RING-IN UNTIL THE AUDIO HAS FINISHED - -EXAMPLE PICTURE ANSWER - -THIS CLUE HAS AUDIO ATTACHED TO IT. PRESS "M" TO TRIGGER IT, WHICH WILL ALSO ALLOW PLAYERS TO BUZZ IN. diff --git a/games/Prototype/players.txt b/games/Prototype/players.txt deleted file mode 100644 index 6ac65fe..0000000 --- a/games/Prototype/players.txt +++ /dev/null @@ -1,3 +0,0 @@ -Team 1 -Team 2 -Team 3 diff --git a/games/Prototype/rules.txt b/games/Prototype/rules.txt deleted file mode 100644 index 3a8a485..0000000 --- a/games/Prototype/rules.txt +++ /dev/null @@ -1,4 +0,0 @@ -* One ring-in per team, per turn -* Answer must be read in full before ring-in -* Responses must be in form of a question -* No daily doubles diff --git a/games/Sample/INSTRUCTIONS.txt b/games/Sample/INSTRUCTIONS.txt deleted file mode 100644 index 128dc47..0000000 --- a/games/Sample/INSTRUCTIONS.txt +++ /dev/null @@ -1,118 +0,0 @@ -======================================================================== -THE FOLLOWING ARE INSTRUCTIONS TO CREATE YOUR OWN VALUES FOR GAME DATA | -======================================================================== -Please note that each respective file has sample data included to aid -you in writing your own data. - -======= -CLUES | -======= - * Clues must be written in 'clues.txt,' located in the folder containing - these instructions. - - * Clues must be separated in these files by one or more blank lines. - -This means there cannot be any blank lines within a single clue. - -For easiest viewing, separate clues in the same category by one line, - and categories by several. - - * There are sample clues already in 'clues.txt' to guide you. - To create your own clues, replace the sample data with your own text, - taking note of the following: - - - Clues are written starting from the top left clue box, then by column. - ~ Example: On a 5x5 board, the first 5 clues will be the clues for - the leftmost category, starting at the top. The next 5 will be for - the column to the right, starting at the top. - - - Clues can be any length, but abnormally long clues may be too small - to be easily read. - - - As can be seen in the sample clues, you may choose to write an - entire clue on a single line or dictate the line breaks - yourself. The simplest method is to write each clue on a single - line. - - -============ -CATEGORIES | -============ - * Categories must be written in 'categories.txt,' located in the folder - containing these instructions. - - * Each non-empty line in 'categories.txt' is treated as a category. - Replace the sample categories with your own. - - * The capitalization used in 'categories.txt' will be used in the game - (all caps is recommended). - - * Leading or trailing whitespace (spaces, tabs, returns) is ignored. - - * Category names can be any length/any number of words, but shorter - is better for readability. - - -============== -PLAYER NAMES | -============== - * Player names are defined in 'players.txt,' located in the folder - containing these instructions. - - * Each player/team name must be on a separate line. - - * There is a maximum of 3 players/teams at this time. If more names - are provided in the file, they will be ignored, and a warning message - printed. If there are fewer than 3 names provided, default names - (Player 1, etc...) will be used for missing names. - - * Leading or trailing whitespace (spaces, tabs, returns) is ignored. - - * Names can be any length and any number of words, but keep in mind very - long names may be drawn so small as to be essentially unreadable. - - -========= -AMOUNTS | -========= - * Clue amounts are defined in 'amounts.txt,' located in the folder - containing these instructions. - - * Each amount should be on a separate line, and must be only an integer - (ex: 200). - - * Do not include a dollar sign, decimal or any other non-numeric character. - - * Make sure the number of amounts matches the number of clues per category. - - * Amounts can be arbitrarily high, but note that scores of 10 million or higher - will not fit properly on the podia. There are no plans to change this behavior - as it is considered an extreme edge case. - - -======= -RULES | -======= - * Rules are defined in 'rules.txt,' located in the folder containing - these instructions. - - * Rules are displayed after the opening sequence, before the category - scroll. - - * Each rule should be on a separate line. - - * Leading or trailing whitespace (spaces, tabs, returns) is ignored. - - * It is recommended to start each rule with a bullet-like character, such as - an asterisk (*). - - -========== -SUBTITLE | -========== - * Subtitle must be written in 'subtitle.txt,' located in the folder - containing these instructions. - - * The first line in 'subtitle.txt' containing any non-whitespace text - is treated as the subtitle. - - * If no subtitle is desired, make 'subtitle.txt' empty (do not delete it, - however). diff --git a/games/Sample/amounts.txt b/games/Sample/amounts.txt deleted file mode 100644 index eb950e1..0000000 --- a/games/Sample/amounts.txt +++ /dev/null @@ -1,5 +0,0 @@ -200 -400 -600 -800 -1000 diff --git a/games/Sample/categories.txt b/games/Sample/categories.txt deleted file mode 100644 index 6db3bbe..0000000 --- a/games/Sample/categories.txt +++ /dev/null @@ -1,5 +0,0 @@ -SAMPLE CATEGORY -EXAMPLE CATEGORY -MODEL CATEGORY -TEST LONG CATEGORY NAME -PROTOTYPE CATEGORY diff --git a/games/Sample/clues.txt b/games/Sample/clues.txt deleted file mode 100644 index 31fc3f6..0000000 --- a/games/Sample/clues.txt +++ /dev/null @@ -1,90 +0,0 @@ -THIS IS AN EXAMPLE OF A LONG CLUE WRITTEN ON A SINGLE LINE. ITS TEXT IS AUTOMATICALLY FIT TO THE CLUE SCREEN - -THIS IS AN EXAMPLE OF A CLUE -WITH MANUAL LINE BREAKS. -THE LINES OF CLUES LIKE THIS -MUST BE SEQUENTIAL IN THE -FILE, WITH NO BLANK LINES -BETWEEN THEM - -THIS IS AN EXAMPLE OF A CLUE WITH AN AUDIO READING. NOTE HOW PLAYERS ARE NOT ABLE TO RING-IN UNTIL THE AUDIO HAS FINISHED - -EXAMPLE PICTURE ANSWER - -THIS CLUE HAS AUDIO ATTACHED TO IT. PRESS "M" TO TRIGGER IT, WHICH WILL ALSO ALLOW PLAYERS TO BUZZ IN. - - - - - -THIS IS AN EXAMPLE OF A LONG CLUE WRITTEN ON A SINGLE LINE. ITS TEXT IS AUTOMATICALLY FIT TO THE CLUE SCREEN - -THIS IS AN EXAMPLE OF A CLUE -WITH MANUAL LINE BREAKS. -THE LINES OF CLUES LIKE THIS -MUST BE SEQUENTIAL IN THE -FILE, WITH NO BLANK LINES -BETWEEN THEM - -THIS IS AN EXAMPLE OF A CLUE WITH AN AUDIO READING. NOTE HOW PLAYERS ARE NOT ABLE TO RING-IN UNTIL THE AUDIO HAS FINISHED - -EXAMPLE PICTURE ANSWER - -THIS CLUE HAS AUDIO ATTACHED TO IT. PRESS "M" TO TRIGGER IT, WHICH WILL ALSO ALLOW PLAYERS TO BUZZ IN. - - - - - -THIS IS AN EXAMPLE OF A LONG CLUE WRITTEN ON A SINGLE LINE. ITS TEXT IS AUTOMATICALLY FIT TO THE CLUE SCREEN - -THIS IS AN EXAMPLE OF A CLUE -WITH MANUAL LINE BREAKS. -THE LINES OF CLUES LIKE THIS -MUST BE SEQUENTIAL IN THE -FILE, WITH NO BLANK LINES -BETWEEN THEM - -THIS IS AN EXAMPLE OF A CLUE WITH AN AUDIO READING. NOTE HOW PLAYERS ARE NOT ABLE TO RING-IN UNTIL THE AUDIO HAS FINISHED - -EXAMPLE PICTURE ANSWER - -THIS CLUE HAS AUDIO ATTACHED TO IT. PRESS "M" TO TRIGGER IT, WHICH WILL ALSO ALLOW PLAYERS TO BUZZ IN. - - - - - -THIS IS AN EXAMPLE OF A LONG CLUE WRITTEN ON A SINGLE LINE. ITS TEXT IS AUTOMATICALLY FIT TO THE CLUE SCREEN - -THIS IS AN EXAMPLE OF A CLUE -WITH MANUAL LINE BREAKS. -THE LINES OF CLUES LIKE THIS -MUST BE SEQUENTIAL IN THE -FILE, WITH NO BLANK LINES -BETWEEN THEM - -THIS IS AN EXAMPLE OF A CLUE WITH AN AUDIO READING. NOTE HOW PLAYERS ARE NOT ABLE TO RING-IN UNTIL THE AUDIO HAS FINISHED - -EXAMPLE PICTURE ANSWER - -THIS CLUE HAS AUDIO ATTACHED TO IT. PRESS "M" TO TRIGGER IT, WHICH WILL ALSO ALLOW PLAYERS TO BUZZ IN. - - - - - -THIS IS AN EXAMPLE OF A LONG CLUE WRITTEN ON A SINGLE LINE. ITS TEXT IS AUTOMATICALLY FIT TO THE CLUE SCREEN - -THIS IS AN EXAMPLE OF A CLUE -WITH MANUAL LINE BREAKS. -THE LINES OF CLUES LIKE THIS -MUST BE SEQUENTIAL IN THE -FILE, WITH NO BLANK LINES -BETWEEN THEM - -THIS IS AN EXAMPLE OF A CLUE WITH AN AUDIO READING. NOTE HOW PLAYERS ARE NOT ABLE TO RING-IN UNTIL THE AUDIO HAS FINISHED - -EXAMPLE PICTURE ANSWER - -THIS CLUE HAS AUDIO ATTACHED TO IT. PRESS "M" TO TRIGGER IT, WHICH WILL ALSO ALLOW PLAYERS TO BUZZ IN. diff --git a/games/Sample/players.txt b/games/Sample/players.txt deleted file mode 100644 index 6ac65fe..0000000 --- a/games/Sample/players.txt +++ /dev/null @@ -1,3 +0,0 @@ -Team 1 -Team 2 -Team 3 diff --git a/games/Sample/rules.txt b/games/Sample/rules.txt deleted file mode 100644 index 3a8a485..0000000 --- a/games/Sample/rules.txt +++ /dev/null @@ -1,4 +0,0 @@ -* One ring-in per team, per turn -* Answer must be read in full before ring-in -* Responses must be in form of a question -* No daily doubles diff --git a/games/Test/INSTRUCTIONS.txt b/games/Test/INSTRUCTIONS.txt deleted file mode 100644 index 128dc47..0000000 --- a/games/Test/INSTRUCTIONS.txt +++ /dev/null @@ -1,118 +0,0 @@ -======================================================================== -THE FOLLOWING ARE INSTRUCTIONS TO CREATE YOUR OWN VALUES FOR GAME DATA | -======================================================================== -Please note that each respective file has sample data included to aid -you in writing your own data. - -======= -CLUES | -======= - * Clues must be written in 'clues.txt,' located in the folder containing - these instructions. - - * Clues must be separated in these files by one or more blank lines. - -This means there cannot be any blank lines within a single clue. - -For easiest viewing, separate clues in the same category by one line, - and categories by several. - - * There are sample clues already in 'clues.txt' to guide you. - To create your own clues, replace the sample data with your own text, - taking note of the following: - - - Clues are written starting from the top left clue box, then by column. - ~ Example: On a 5x5 board, the first 5 clues will be the clues for - the leftmost category, starting at the top. The next 5 will be for - the column to the right, starting at the top. - - - Clues can be any length, but abnormally long clues may be too small - to be easily read. - - - As can be seen in the sample clues, you may choose to write an - entire clue on a single line or dictate the line breaks - yourself. The simplest method is to write each clue on a single - line. - - -============ -CATEGORIES | -============ - * Categories must be written in 'categories.txt,' located in the folder - containing these instructions. - - * Each non-empty line in 'categories.txt' is treated as a category. - Replace the sample categories with your own. - - * The capitalization used in 'categories.txt' will be used in the game - (all caps is recommended). - - * Leading or trailing whitespace (spaces, tabs, returns) is ignored. - - * Category names can be any length/any number of words, but shorter - is better for readability. - - -============== -PLAYER NAMES | -============== - * Player names are defined in 'players.txt,' located in the folder - containing these instructions. - - * Each player/team name must be on a separate line. - - * There is a maximum of 3 players/teams at this time. If more names - are provided in the file, they will be ignored, and a warning message - printed. If there are fewer than 3 names provided, default names - (Player 1, etc...) will be used for missing names. - - * Leading or trailing whitespace (spaces, tabs, returns) is ignored. - - * Names can be any length and any number of words, but keep in mind very - long names may be drawn so small as to be essentially unreadable. - - -========= -AMOUNTS | -========= - * Clue amounts are defined in 'amounts.txt,' located in the folder - containing these instructions. - - * Each amount should be on a separate line, and must be only an integer - (ex: 200). - - * Do not include a dollar sign, decimal or any other non-numeric character. - - * Make sure the number of amounts matches the number of clues per category. - - * Amounts can be arbitrarily high, but note that scores of 10 million or higher - will not fit properly on the podia. There are no plans to change this behavior - as it is considered an extreme edge case. - - -======= -RULES | -======= - * Rules are defined in 'rules.txt,' located in the folder containing - these instructions. - - * Rules are displayed after the opening sequence, before the category - scroll. - - * Each rule should be on a separate line. - - * Leading or trailing whitespace (spaces, tabs, returns) is ignored. - - * It is recommended to start each rule with a bullet-like character, such as - an asterisk (*). - - -========== -SUBTITLE | -========== - * Subtitle must be written in 'subtitle.txt,' located in the folder - containing these instructions. - - * The first line in 'subtitle.txt' containing any non-whitespace text - is treated as the subtitle. - - * If no subtitle is desired, make 'subtitle.txt' empty (do not delete it, - however). diff --git a/games/Test/amounts.txt b/games/Test/amounts.txt deleted file mode 100644 index eb950e1..0000000 --- a/games/Test/amounts.txt +++ /dev/null @@ -1,5 +0,0 @@ -200 -400 -600 -800 -1000 diff --git a/games/Test/categories.txt b/games/Test/categories.txt deleted file mode 100644 index 6db3bbe..0000000 --- a/games/Test/categories.txt +++ /dev/null @@ -1,5 +0,0 @@ -SAMPLE CATEGORY -EXAMPLE CATEGORY -MODEL CATEGORY -TEST LONG CATEGORY NAME -PROTOTYPE CATEGORY diff --git a/games/Test/clues.txt b/games/Test/clues.txt deleted file mode 100644 index 31fc3f6..0000000 --- a/games/Test/clues.txt +++ /dev/null @@ -1,90 +0,0 @@ -THIS IS AN EXAMPLE OF A LONG CLUE WRITTEN ON A SINGLE LINE. ITS TEXT IS AUTOMATICALLY FIT TO THE CLUE SCREEN - -THIS IS AN EXAMPLE OF A CLUE -WITH MANUAL LINE BREAKS. -THE LINES OF CLUES LIKE THIS -MUST BE SEQUENTIAL IN THE -FILE, WITH NO BLANK LINES -BETWEEN THEM - -THIS IS AN EXAMPLE OF A CLUE WITH AN AUDIO READING. NOTE HOW PLAYERS ARE NOT ABLE TO RING-IN UNTIL THE AUDIO HAS FINISHED - -EXAMPLE PICTURE ANSWER - -THIS CLUE HAS AUDIO ATTACHED TO IT. PRESS "M" TO TRIGGER IT, WHICH WILL ALSO ALLOW PLAYERS TO BUZZ IN. - - - - - -THIS IS AN EXAMPLE OF A LONG CLUE WRITTEN ON A SINGLE LINE. ITS TEXT IS AUTOMATICALLY FIT TO THE CLUE SCREEN - -THIS IS AN EXAMPLE OF A CLUE -WITH MANUAL LINE BREAKS. -THE LINES OF CLUES LIKE THIS -MUST BE SEQUENTIAL IN THE -FILE, WITH NO BLANK LINES -BETWEEN THEM - -THIS IS AN EXAMPLE OF A CLUE WITH AN AUDIO READING. NOTE HOW PLAYERS ARE NOT ABLE TO RING-IN UNTIL THE AUDIO HAS FINISHED - -EXAMPLE PICTURE ANSWER - -THIS CLUE HAS AUDIO ATTACHED TO IT. PRESS "M" TO TRIGGER IT, WHICH WILL ALSO ALLOW PLAYERS TO BUZZ IN. - - - - - -THIS IS AN EXAMPLE OF A LONG CLUE WRITTEN ON A SINGLE LINE. ITS TEXT IS AUTOMATICALLY FIT TO THE CLUE SCREEN - -THIS IS AN EXAMPLE OF A CLUE -WITH MANUAL LINE BREAKS. -THE LINES OF CLUES LIKE THIS -MUST BE SEQUENTIAL IN THE -FILE, WITH NO BLANK LINES -BETWEEN THEM - -THIS IS AN EXAMPLE OF A CLUE WITH AN AUDIO READING. NOTE HOW PLAYERS ARE NOT ABLE TO RING-IN UNTIL THE AUDIO HAS FINISHED - -EXAMPLE PICTURE ANSWER - -THIS CLUE HAS AUDIO ATTACHED TO IT. PRESS "M" TO TRIGGER IT, WHICH WILL ALSO ALLOW PLAYERS TO BUZZ IN. - - - - - -THIS IS AN EXAMPLE OF A LONG CLUE WRITTEN ON A SINGLE LINE. ITS TEXT IS AUTOMATICALLY FIT TO THE CLUE SCREEN - -THIS IS AN EXAMPLE OF A CLUE -WITH MANUAL LINE BREAKS. -THE LINES OF CLUES LIKE THIS -MUST BE SEQUENTIAL IN THE -FILE, WITH NO BLANK LINES -BETWEEN THEM - -THIS IS AN EXAMPLE OF A CLUE WITH AN AUDIO READING. NOTE HOW PLAYERS ARE NOT ABLE TO RING-IN UNTIL THE AUDIO HAS FINISHED - -EXAMPLE PICTURE ANSWER - -THIS CLUE HAS AUDIO ATTACHED TO IT. PRESS "M" TO TRIGGER IT, WHICH WILL ALSO ALLOW PLAYERS TO BUZZ IN. - - - - - -THIS IS AN EXAMPLE OF A LONG CLUE WRITTEN ON A SINGLE LINE. ITS TEXT IS AUTOMATICALLY FIT TO THE CLUE SCREEN - -THIS IS AN EXAMPLE OF A CLUE -WITH MANUAL LINE BREAKS. -THE LINES OF CLUES LIKE THIS -MUST BE SEQUENTIAL IN THE -FILE, WITH NO BLANK LINES -BETWEEN THEM - -THIS IS AN EXAMPLE OF A CLUE WITH AN AUDIO READING. NOTE HOW PLAYERS ARE NOT ABLE TO RING-IN UNTIL THE AUDIO HAS FINISHED - -EXAMPLE PICTURE ANSWER - -THIS CLUE HAS AUDIO ATTACHED TO IT. PRESS "M" TO TRIGGER IT, WHICH WILL ALSO ALLOW PLAYERS TO BUZZ IN. diff --git a/games/Test/players.txt b/games/Test/players.txt deleted file mode 100644 index 6ac65fe..0000000 --- a/games/Test/players.txt +++ /dev/null @@ -1,3 +0,0 @@ -Team 1 -Team 2 -Team 3 diff --git a/games/Test/rules.txt b/games/Test/rules.txt deleted file mode 100644 index 3a8a485..0000000 --- a/games/Test/rules.txt +++ /dev/null @@ -1,4 +0,0 @@ -* One ring-in per team, per turn -* Answer must be read in full before ring-in -* Responses must be in form of a question -* No daily doubles diff --git a/jeoparpy/game/gamedata.py b/jeoparpy/game/gamedata.py index 7caf7e3..55259c3 100644 --- a/jeoparpy/game/gamedata.py +++ b/jeoparpy/game/gamedata.py @@ -114,13 +114,13 @@ def _build_clues_from_file(self, path, numCategories): def _build_players_from_file(self, path): playerNames = get_stripped_nonempty_file_lines(path) - if len(playerNames) > 3: - playerNames = playerNames[:3] + if len(playerNames) > 5: + playerNames = playerNames[:5] print >>stderr, ("WARNING: Too many players provided. " + "Extraneous player names ignored. " + "Bad file: %s" % path) - elif len(playerNames) < 3: - missing = 3 - len(playerNames) + elif len(playerNames) < 5: + missing = 5 - len(playerNames) playerNames += tuple('Player ' + str(i + 2) for i in range(missing)) diff --git a/jeoparpy/selectMenu.py b/jeoparpy/selectMenu.py index bfee40c..071fb6e 100644 --- a/jeoparpy/selectMenu.py +++ b/jeoparpy/selectMenu.py @@ -12,7 +12,7 @@ WINDOWHIEGHT = 500 os.environ ['SDL_VIDEO_WINDOW_POS'] = 'center' windowSurface = pygame.display.set_mode((WINDOWWIDTH, WINDOWHIEGHT), 0, 32) -pygame.display.set_caption('Select Game') +pygame.display.set_caption('Jeopardy') mainClock = pygame.time.Clock() class Select_Game(): @@ -27,10 +27,7 @@ def __init__(self, screen): #Setup select game text pygame.Surface.set_alpha(self.screen) self.jeopFont = pygame.font.Font(os.path.join(ROOT_PATH, 'res', 'fonts', 'gyparody.ttf'), 53) - self.selectText = self.jeopFont.render('Select Game', True, self.WHITE) - self.selectRect = self.selectText.get_rect() - self.selectRect.centerx = 300 - self.selectRect[1] = 70 + #Setup Background Image self.backgroundImage = pygame.image.load(os.path.join(ROOT_PATH,'res', 'images', 'introbg.png')) @@ -40,7 +37,6 @@ def __init__(self, screen): self.screen.blit(self.backgroundImage, self.backgroundRect) - self.screen.blit(self.selectText, self.selectRect) def main(self, event=None): #Blit Selection diff --git a/jeoparpy/ui/maingame/podiapanel.py b/jeoparpy/ui/maingame/podiapanel.py index 67ed18f..6bc005d 100644 --- a/jeoparpy/ui/maingame/podiapanel.py +++ b/jeoparpy/ui/maingame/podiapanel.py @@ -76,24 +76,24 @@ def _init_background(self): img = pygame.transform.scale(img, self.size) self.blit(img, (0, 0)) - return sizeScalar + return sizeScalar * .75 def _init_podia(self, gameData, scalar): podia = pygame.sprite.OrderedUpdates() img = pygame.image.load(IMAGES['podium']).convert_alpha() nameBounds = pygame.Rect(90, 107, 102, 105) - fonts = (('team1', 42), ('team2', 33), ('team3', 40)) + fonts = (('team1', 42), ('team2', 33), ('team3', 40), ('team1', 42), ('team2', 33)) fonts = tuple((FONTS[n], s) for n,s in fonts) - for i in range(3): + for i in range(5): p = Podium(i, img, scalar, gameData.players[i].name, fonts[i], nameBounds, podia) return self._position_podia(podia) def _position_podia(self, podia): - ph = podia.sprites()[0].rect.h - padding = (self.size[1] - 3*ph) / 4 + ph = podia.sprites()[0].rect.h - 10 + padding = (self.size[1] - 5*ph) / 4 y = padding for p in podia: diff --git a/res/fonts/team4.ttf b/res/fonts/team4.ttf new file mode 100644 index 0000000..196c56c Binary files /dev/null and b/res/fonts/team4.ttf differ diff --git a/res/fonts/team5.ttf b/res/fonts/team5.ttf new file mode 100644 index 0000000..2b3c309 Binary files /dev/null and b/res/fonts/team5.ttf differ