You are on page 1of 1

WORLD WAR II

TRIVIA APP
By: Matthew Beck and Andrew Fuller

PURPOSE AND DEVELOPMENT

APP DESCRIPTION:
The World War II Trivia App
is a true and false based game
where the user answers true
or false questions that are
centered around the Pacific
Theatre of WWII. You choose
a ship from either the US or
Japanese and do damage by
answering correctly. Every
win makes your nations win
counter go up unlocking
more, higher health, ships to
use. Win the war by reaching
a win counter for one of the
nations. Learn unique trivia
and the history behind 10
powerful war vessels.

The app was created using the MIT App Inventor program. The purpose of the application is to
provide the user with a fun yet informative game to help learn some interesting World War II
trivia. The video demonstration shows the game being played and how some of the basic
elements of code work. It also showed some of the code in the blocks editor of App Inventor.
The creation of this app was something easier said than done. Many seemingly simple tasks
proved to be more difficultly implemented than expected. One collaborative effort was the
addition of two separate win counters, one for America and one for Japan. This was challenging
in part due to the fact that we had already implemented a singular win counter that kept track of
all wins across the board. We wanted to add two counters so that Japanese and American ships
would be unlocked separately and so we could add a game win condition for one of the nations.
An issue came up where the win counter wasn't counting and every ship was unlocked from the
start. We found that as soon as the ship selection screen initialized we needed to call win
counters from both nations from the Tiny DB. I encountered an issue myself with the addition
ships with different health amounts. I couldn't find a way to give the ships inherent health values
from the ship selection screen because it had been one value, 100, across the board for all ships
originally. I was able to fix it by, on battle_screen initialization, having it check the TinyDB for
your chosen ship and then setting the image, text, and individual health for each possible ship.
The False_Button is an important algorithm in the code that deals with multiple factors and
events that occur when the button is pressed. The circled section of the False_Button contains
two important events which include subtracting 25 from the enemy ship's health and editing the
enemy's health text bar to show the updated statistic. These two factors, in conjunction with
multiple other variables are all the driving force behind the singular algorithm of the
False_Button. The False_Button, when pressed, either does damage to your ship or the enemy
ship. To determine which of these actions to carry out, it must check the list of global Answers to
see if the question asked was true or false. If it was false, or 2 in our binary answer selector, then
it subtracts from the enemy, otherwise it subtracts from your health. The ship that was
"damaged" has its health text bar updated.
The selected Abstraction handles the random selection of true or false questions that are
displayed on the app's Battle_Screen. Anywhere in the code that requires the app to display a
random item from the question list, this abstraction goes in place. After pressing either the True
or False buttons, if yours or the enemy ship have not yet reached zero health, another question
must be displayed on the Battle_Screen so that play is able to continue. The Abstraction is a
procedure called "Question_selector" that sets global Word (the list of about 50 questions) to a
random integer from 1 to the "length of the list" meaning 1 to the number of how many questions
there are in the list. Then it sets the question text to the randomly selected question in the Global
Questions list. This allows us to easily have a random question selected whenever it is needed
such as after a question has been answered to bring up a new one or upon initialization of the
Battle_Screen.

You might also like