Software Documentation – MathGame

INTRODUCTION

The MathGame is a game designed for children who are learning the multiplication table. This game tests your ability with the multiplication of numbers between one and 12, but there’s a catch! You are being timed! This interactive game asks you a set of questions and gives you a series of final results including correct answers and the time it took to answer them. Play it with you peers and see who can be the fastest MathGame master!!

USER MANUAL

This game prompts the user for how many rounds of multiplication questions they want to be asked. After that, the user is asked the answer of the multiplication of to random numbers generated by the computer. The program will continue asking as many questions as the user prompted at the beginning. Lastly, the user is giving the results of the match. They will be given the number of correct answers and the time it took to complete the challenge.

PROGRAM DESCRIPTION FOR DEVELOPERS

This program takes the user’s input on how many rounds they want to play, this is stored in a variable named rounds. A variable count is initialized with value zero to be used for the number of correct answers. The tic command is set to start after the variable rounds, to take the time the user needs to answer the questions. A for loop is created with range i = 1:rounds. Inside the for loop, two random number generators, num1 and num2, are established with parameters one-12. The user is then prompted for the answer to the multiplication question, a variable useransw is created to store the user’s answer. The variable my_scn initializes the graphics collection for any random number selected 1-10 via the simpleGameEngine funciton. Each box in the sprite board is associated with the respective random numbers for num1 and num2, as well a box for “What is” and “X”. The dimensions (170×170 pixels) and background color (white) of each graphic projected is also established. The vector, Usr(i), is set up to store the user’s answers in case they choose to play more than one round. A variable, multp, is established to perform the multiplication of num1 and num2.  The scene based off of the random numbers multiplied is then called through the Drawscene function with the sprite boxes to display”What is, num1, X,num2″, translated from “11, num1,10,num2”. The graphics are then docked through the dock function The answer to multp is stored in a vector called Mult(i), set to have all multiplication answers based on the rounds the user decided to play. The for loop with parameters i = 1:counts is ended. Another for loop with parameters k = 1:length(Mult) is created. Inside this for loop, an if statement is created to check if the user’s answer, Usr(k), equals the correct answer, Mult(k).  If the statement iterates, count increments by one. Both if statement and for loop are ended. A variable Stoptime is created and it’s given the command toc, to stop the time counter. Results are printed in a series of fprintf statements including the number of correct answers and the time measured by the tic-toc stopwatch.

FINAL FLOWCHART

FINAL PROGRAM WITH COMMENTS

Sprite Sheet: mathgamegraphics.png

BRIEF DISCUSSION

The Mathgame started out as a second option after concluding our first game therefore, the initial goal was to create the code. The first decision the team had to make was to determine if the user as going to be able to choose how many multiplication rounds they wanted to play or if it was going to be a fixed number of rounds. After deliberating, the team decided to allow the player to choose which meant, we had to allow user input and let it run the game’s repetitions. Since one of the objectives of the game was to allow the user to know how many seconds it took them to complete the challenge, the team decided to implement the tic and toc function, the timer is set to start right after the user inputs how many rounds they want to play and an the initial equation is displayed. Since the number of repetitions is unknown until  the user makes its decision, the team opted to use a for loop that will iterate according to the previously mention decision. Seeing that the user was most likely going to play a good amount of rounds, we decided to store their answer and the correct answer in two different vectors. To keep the code simple, we chose to implement the multiplication equation in the script file instead of creating a separate function file.  The team decided to let the user know how many correct answers they had thus, we  created another for loop that was in charge of comparing the vector storing the user’s answer and the vector with the correct answer. At the end of the game, the team decided to display two informative messages- one with the number of correct answers and one with the amount of time it took to complete the challenge.

During initial game experimentation, the players thought that the game was average, although nothing really made it very engaging other than the motive to beat the previous time and/or score. Once the team added graphics to the game, the users found the game more engaging, as they would often smile and say comments about how ‘cute’ or ‘creative’ the game was, due to the new number animal component. The game had more of a lasting impression on the player during the second round of testing.

The original idea was use numbers between 1 and 20 to be randomly selected however, as the game was being tested, the team decided to decrease the numbers to 1 and 9 because we realized that since the game was oriented towards kids, big numbers weren’t going to be needed and were difficult to remember. Originally, the team had created the random number generators outside of the for loop however, during the first testing, we realized that if we wanted different numbers with each iteration, we had to include them inside the first for loop.

One of advantage of having to come up with a code from scratch is that we were able to make the program as complicated as we wanted. One important obstacle we had to overcome was making the program come up with the correct multiplication solutions. For this problem we brainstormed two ways of solving this, we could create a function script or we could simply create a variable that would multiply the previously generated random numbers and store that answer in a vector. The team approached both ways and after evaluating them, we decided to go for the second option- a variable responsible for multiplying both numbers.

The graphics obstacles included formatting the sprites to correspond with the correct order of the math operation. For instance, the first time through the graphics showed up as “Random number 1, what is, X, random number 2” instead of “What is, Random number 1, X , random number 2.” Also only parts of the animal number would show up in the figure. In order to fix this issue, the team had to edit the sprite dimensions, and understand how the last row and column of the sprite board was not considered a sprite, meaning that each referenced sprite should have been one less. than stated. The dimensions also needed to be much smaller, as it threw off the latter numbers in the sprite board.

CONCLUSION AND RECOMMENDATIONS

The Mathgame can be a very captivating game for kids just learning multiplication, as they can incorporate a subject into a game and competition, finding inspiration to become better. Although the audience is not for adults this game can be very powerful setting the tone for a child’s interest in math, leading to an interest potentially in a STEM field. After interviewing the users, the team  found that the game was more enjoyable when the animal graphics were added. The audience was more engaged with both the competition portion (the game being timed) as well as the creativity (the detail of the number animals). Without either of these components, the game’s success would be drastically inferior. The team found that there are ways to make learning more fun for students and children!

The success of this game would not be possible without following the problem solving method. Initially, the motivating problem was how to create an educational game for kids to enjoy, which lead to the Mathgame as a solution. The team then used a flowchart to organize our ideas and plan of action for creating the game. Implementing our plan was fairly simple, as coding included three components, a timer, multiplication of two random elements, and graphics. While programming the game, we found that it was not necessary  to have functions, as all we were doing was multiplying two random elements from an array. The team made the game more user friendly by adding comments of encouragement, and an option for the consumer to decide the difficulty level (i.e: choosing the amount of rounds the player wants to play). For a more advanced player, they can choose a higher number of rounds, while a child with a shorter attention span can choose less rounds to play! Lastly, after testing the game we decided to add graphics. This made the game even more approachable, as players would often remark the game as “cute” and would smile while multiplying once we added the graphics.

Further improvements to the game would include creating a leader board, level, and points component to the game. This would encourage more competition with the audience, as they would be motivated to get onto the high score list, or reach the highest level/ point value. The higher level could also unlock more number animals or backgrounds! The team would also look into creating a more aesthetically pleasing welcome screen for the game.

REFERENCES

iMovie, application to edit Pitch Video

  • iMovie. Apple Inc. Version #2.2.8

MATLAB website used to research commands not taught in class:

  • https://www.mathworks.com/help/index.html

Canva, application to create Print Advertisement

  • Canva, Perkins. Version #3.31.1