Users get a question like, "Who designed 'Carcassone'?" and must choose from a closed set of answers, e.g.:
- Klaus Teuber
- Klaus-Jürgen Wrede
- Bruno Cathala
- R. Eric Reuss
Users have 10sec and get a point for every right answer. After two wrong answers, the game is over. An arcade-game style leader board will track top scores.
The following types of questions will be available to start:
- QUESTION: Who designed (GAME)?
- ANSWER: [(DESIGNER)]
- QUESTION: Which game was designed by (DESIGNER)?
- ANSWER: [(GAME)]
- QUESTION: When was (GAME) released?
- ANSWER: [(YEAR)]
- QUESTION: Which game came out in (YEAR)?
- ANSWER: [(GAME)]
To start, a database of ~700 games, their years published, and their designers, will be built. Database will be in AWS Dynamo DB.
FastAPI. Endpoints "for":
GET Respond with complete game
{ "id": int, "name": str, "yearPublished": int, "designers": str}
GET Respond with complete designer
{ "id": int, "name": str}
GET (requires logic)
Pick a random question template (in source, e.g.,
{"q": "Who designed __GAME__?", "a": "__GAME__.DESIGNER"}
)
Pick a random "correct" game and fill in slots
Get alternatives (for game or designer, pick random; for year, do math)
Check for false negatives among alternative answers, replace until clean
Respond with complete question
{ "id": int, "template": str, "answers": [str], "correct_answer": int}
POST Add a score
GET Get a score
{ "id": int, "playerName": str, "score": int }
ReactJS SPA. No routing, initially. MobX for state management?
"Pages": Play game, Leaderboard, Help/info/about
default display, button to begin a new game
number of correct answers so far
Display (2 - number of incorrect answers so far). End game when 0.
Display the question text
Provide buttons for each answer option; handle correct/incorrect responses
After response, before next question/game end, tell player if they got it right or wrong. On dismiss, go to next question or game over
Display (10 - seconds elapsed on this question). Trigger incorrect response when 0
Inform the player the game has ended. Navigate to leaderboard on dismiss.
If score is in the top ten, get player name to add to leaderboard.
Container for row of 10 top scores, sorted DESC
Display "PLAYER NAME -- SCORE"
Front end state
{
"view": "leaderboard" or "game", // which page we’re on
"question": Question, // the current question -- empty when game has not started
"asked": List[QuestionID], // list of last (max 100) question ids -- empty when game has not started
"nextQuestions": [Question], // upcoming questions -- empty when game has not started
"score": 0, // number of correct answers so far
"wrongAnswers": 0, // number of wrong answers so far; 2 = game over
"playerName": str, // for leadboard; prompt after each highscore game but remember last
"scores": [
{ "playerName": str, "score": int } // for leaderboard, top 10 scores
]
}