Algorithm

  1. Initialize important variables including world.
  2. Display the introduction text.
  3. Wait until the user touches the screen.
  4. Display the menu.
  5. If the user touches ‘Play’, go to step 6.  If the user touches “Score”, go to step 14.  If the user touches “Shop”, go to step 16.  If the user touches “Rules”, go to step 18.  If the user touches “Credits”, go to step 20.
  6. Initialize the level.
  7. Update car coordinates.
  8. Draw world.
  9. Move the chicken based on what button is pressed.
  10. Check for collisions between the chicken and the cars.  If there is a collision, go to step 12.
  11. Check if the chicken is at the top of the screen.  If so, increment level by 1 and return to step 6.
  12. Display “Game Over” along with the user’s stats and options.
  13. If the user presses the right button, return to step 6.  If the user presses the left button, return to step 4.
  14. Display the user’s highest score and most recent score.
  15. Wait for the user to touch the screen, then return to step 4.
  16. Display the different color options of the chicken.
  17. Wait for the user to touch the screen.  If the user touched one of the colors, change the color of the chicken accordingly.  If the user touched the ‘Exit’ button, return to step 4.
  18. Display the rules of the game.
  19. Wait for the user to touch the screen, then return to step 4.
  20. Display the credits of the game.
  21. Wait for the user to touch the screen, then return to step 4.