Program Description for Developers

pink-dot-copyorange-dot-copyblue-dot-copygreen-dot-copypurple-dot-copy

The following are assumptions made when creating this code:

  • The user has four options: 1 player, 2 player, leaderboard, or quit game
  • There are 6 different positions that dots can appear
  • There are 5 different color dots
  • There are 5 different dot speeds, as well as sizes
  • During 1 player mode
    • If the player hits a red X, the game is over
    • If the player touches the screen in incorrect positions 3 times, the game is over
  • During 2 player mode
    • The game will be played twice, the player with the highest score will win
  • During the Leaderboard option
    • The 3 highest scores will be displayed

The following items are all variables within the code:

  • Global Variables:
    • X; This variable is a counter for how many dots are missed within the game
    • s; This variable is the score for the game
    • pos; This variable is an integer value that is randomly assigned during the game for the position of the shape (positions 1-6)
    • type; This variable is an integer value that is randomly assigned during the game for the type of character (whether it be a dot or a special character)
    • shape; This variable is an integer value that is randomly assigned during the game for the shape of the special characters (whether it be a star or an x)
    • color; This variable is an integer value that is randomly assigned during the game for the color of the dots (whether it be blue, green, peach, purple, or white)
  • Non-Global Variables
    • int
      • P1_score; this variable was used during the 2 player if statement in order to set the score of player 1
      • P2_score; this variable was used during the 2 player if statement in order to set the score of player 2
      • max1; this variable was used during the leaderboard if statement in order to rank 3 max scores (this is the highest score)
      • max2; this variable was used during the leaderboard if statement in order to rank 3 max scores (this is the second highest score)
      • max3; this variable was used during the leaderboard if statement in order to rank 3 max scores (this is the third highest score)
    • float
      • x; this variable was used when calling the touch function for an x position
      • y; this variable was also used when calling the touch function for a y position
      • x1; this variable was used when calling the touch function for an x position (on the “selection menu”)
      • y2; this variable was used when calling the touch function for a y position (on the “selection menu”)
      • s; this variable was used as a float to indicate a number of seconds within the “poke” function (number of seconds the dot would appear for)
      • x1_bound; this variable was used within the “poke function”, it is the left ‘x’ bound of the dot
      • x2_bound; this variable was used within the “poke function”, it is the right ‘x’ bound of the dot
      • y1_bound; this variable was used within the “poke” function, it is the bottom ‘y’ bound of the dot
      • y2_bound; this variable was used within the “poke” function, it is the top ‘y’ bound of the dot
      • stime; this variable was set at the beginning of the function, it recorded the time at the beginning of the function
      • p; this variable was used to get the amount of time passed since TimeNow() was called in ‘stime’;
      • x3; this variable was used within the “poke function” when the Touch function was called, it recorded the x value of the touch
      • y3; this variable was used within the “poke function” when the Touch function was called, it recorded the y value of the touch
    • bool
      • check; this variable was used inside of while loops in order to check for the screen being touched (it was changed to false within the loop)
      • penguin; this variable was used outside of the entire game in order to for the game to run continuously (it was never changed to false)

The following are the two functions that were used within the code:

  • poke
    • Type: void
    • Prototype:
      • void poke(float, float, float, float, float, int pos, int type, int shape, int color);
    • Definition:
      • void poke(float seconds, float x1_bound, float x2_bound, float y1_bound, float y2_bound, int position, int type, int shape, int color)
      • This function checks that the user pokes the dot during the time that the dot is visible (see below) and pokes the dot within the correct bounds
        • SKYBLUE dot: visible for 0.5 seconds
        • LIMEGREEN dot: visible for 0.4 seconds
        • PEACHPUFF dot: visible for 0.3 seconds
        • PLUM dot: visible for 0.25 seconds
        • FLORALWHITE dot: visible for 0.2 seconds
        • STAR: visible for 0.1 seconds
      • This function also calls the score function
        • This ensures that each time a person touches a dot, points are added to their total score;
      • This function adds 1 to the counter ‘X’ if they hit the wrong position
    • How to call this function:
      • Example:
        • poke(0.5, 130, 180, 140, 190, pos, type, shape, color);
          • pos, type, shape, and color are global variables that have been randomly assigned
  • score
    • Type: void
    • Prototype
      • void score(int, int, int, int);
    • Definition
      • void score (int pos, int type, int shape, int color)
      • This function adds points to the user’s score if the touch a dot at the correct time (see below)
        • SKYBLUE dot: add 1 point
        • LIMEGREEN dot: add 2 points
        • PEACHPUFF dot: add 3 points
        • PLUM dot: add 4 points
        • FLORAL WHITE dot: add 5 points
        • STAR: add 25 points
      • This function also increments ‘X’ to 3 if an ‘X’ is touched, and will end the game
    • How to call this function:
      • Example:
        • score (pos, type, shape, color)
          • pos, type, shape, and color are global variables that have been randomly assigned

Below are links to both the pseudo code and the flowchart >>

Poke-A-Dot Pseudocode

Poke-A-Dot Flowchart

Beta Testing:

  • What did you like about their game?
    • “Their game is unique and challenging, it was fun to play and is an interesting idea for a game”
  • What recommendations do you have?
    • “The points need to be displayed somewhere on the screen, and the directions need to be displayed for a longer amount of time. Additionally, there needs to be a way to break out of the game…”
  • What are your overall comments about the game?
    • “Overall, it is an entertaining game but it could use some improvements. Also, the game is challenging, so that is a plus!”

Before the start of the beta testing, the score function had not been figured out (which also controlled the end of the game). Therefore, we took their recommendations very seriously and were able to display the score at the end of the one player game, and within the leaderboard. Also, the game ended when the player missed 3 dots, or if they hit a red x. Additionally, we extended the sleep time of the instructions in order for them to be read and understood!