Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Typing Game

tetishi
March 15, 2021

Typing Game

tetishi

March 15, 2021
Tweet

More Decks by tetishi

Other Decks in Programming

Transcript

  1. Purpose • Help students acquire fluency in the English language.

    ◦ International Students, Disabled Students, Young Students, and Etc. • The 21st century is transitioning from traditional means like Writing to Typing. ◦ The keyboard is the modern day equivalent of the pen/ pencil ◦ Ink and Quill → Pen/ Pencil → Keyboard → ??? • Keeping it Simple ◦ Straight to the point. No instructions required. ◦ Anyone can pick it up and begin practicing.
  2. Difficulty: Code In-Depth • The program begins by prompting the

    User with a Start Menu with three difficulty settings: Easy, Normal, and Hard. • By selecting one of the three options available, the program will begin to read in the words from the corresponding text files. • The program will then read the words from the text file and copy them into an ArrayList to be placed into the appropriate “Word Banks” • These “Word Banks” will hold onto the words to be randomized and displayed during the Game Screen in which the User will try to correctly type and match the words displayed.
  3. Game Screen • The Game Screen features a rectangular GUI

    with the words “Press any key to start” front and center to provide the User the option to start the game whenever they are ready. • The background of the Game Screen features a 600x600 pixel image of an Apple iMac that is imported from the game’s library named “TypingGame” located at the Desktop directory.
  4. Game Screen: Code In-Depth • The KeyListener “listens” for a

    key press from the User, then the game will begin. • The conditions for the game is that when the User correctly types the word shown on the screen, it will disappear and another word will be shown. • Every word displayed on the screen is randomly selected by the code from the “Word Bank” that stores the words from the imported text file. • “typingGame.label.setForeground(Color.BLACK)” is used to set the color of the words to Black when it is being displayed. • “typingGame.label.setForeground(Color.RED)” is used to set the color of the word to Red on the condition that the User has incorrectly typed it.
  5. Game Screen: Code In-Depth • When the User incorrectly types

    a word, it will turn the color of the word Red and promptly display the End Screen with the Score. • There is also a “hidden” timer of 3000 milliseconds or 3 seconds that if the User does not finish typing the word, then the game will end and promptly display the End Screen with the Score.
  6. Game Screen: Code In-Depth • For every word the User

    types correctly, the score will increment by 1. • The TypingGame will continue until the User makes a mistake or exceeds the time limit then the End Screen will popup and display the Score. • Pressing the “OK” button will bring the User back to the Game Screen and reset the Score to zero.
  7. Bugs & Errors • One issue we ran into is

    with the countdown timer. We were trying to implement a 60 second countdown timer, but because we were operating within the limits of “System.currentTimeMillis()” we were dealing with Milliseconds rather than Seconds which made things a bit complicated.