Grid/Strategy Game
Write a Python program using the Arcade module that allows the user to play a game which takes place on a grid in which the player wins by matching things in rows, columns, or both. It can either be an "action" game (like Bejeweled, Candy Crush, or Tetris) or a turn-based game (like Connect4, Othello, or Checkers). For two person games, you should make an "intelligent" opponent to play against (even if it only makes a random legal move).
Beyond drawing the board (there may or may not be any animation in this game), you will need to verify legal moves and when the game is over. For example:
- Connect Four
- a legal move in is a column that has at least one available space (the piece slides down that column until it "hits" another piece, filling the board from the bottom with no gaps in between)
- the game is won by lining up four checkers either vertically, horizontally, or diagonally
- Candy Crush
- moves are based on swapping adjacent candies to make a row or column of at least three matching-colored candies (at which point they are removed from the board and candies above them fall into the empty spaces)
- the level is won by different ways (like a score, an order of clearing the candies, or clearing all the special candies)
Getting Started
You can write this game from scratch or by starting with this template.
Specifications
Complete these minimal requirements:
- create a game based on a grid (list of lists) that can be any size (i.e., its number of rows and columns are constants set at the top of the program)
- accept only legal moves within the game (i.e., do nothing or report to the player when they make an invalid move)
- detect the game's end condition and display separate winning and losing messages
- track the player's score such as games won, levels completed, spaces occupied, etc.
- allow the user to restart the game by resetting all the game objects, scores, and options to their starting values
Beyond the basics, you must add at least one feature to your game, such as:
- highlight legal moves: show the player the current possible legal moves
- computer player: create an opponent to play against that is at least better than a random legal move
- levels: make some aspect of the game harder after the player has accomplished or won some aspect of the game
- pause: blank the screen and stop the game during play until the player is ready to play again (look at using Arcade's View class)
- save game: save the grid state of the game to a file that can be read in to restart the game at that point
- high score: show the maximum score ever on the screen (by saving it to a file at the end of each game and reading it in at the start of the game)
In the comment at the top of the Python file add:
- Your name
- How long you spent coding it
- Acknowledgments for any online or human resources used
- Acknowledgments for any resource files (images, sounds, etc.) used
- How to play your game (so I know how to play the game and what you intended to do and what is not completely working)
- Discussion of the fixed values you choose to make your game fun to play: distance between and speed of the obstacles, how high (or low or far away) each obstacle is, the time it takes to complete a jump, duck, or shot, etc.