This is our final project for UCSD FA23 CSE230
Name | PID | Github account |
---|---|---|
Nai-En Kuo | A59025053 | imgradually |
Mingxuan Li | A69027684 | HunterLep |
Brian Chen | A59016113 | zychen5186 |
Jensen Chang | A59024883 | ycchang99 |
- ghc
- brick
- To clone and build locally:
$ git clone https://github.com/jtdaugherty/brick.git $ cd brick $ cabal new-build
- To clone and build locally:
To run the executable enter the project’s directory and run it, by inputting the following commands:
cd Haskell-Snake-Game
cabal run Haskell-Snake-Game
In this project, We decided to reproduce the classic snake game, with the primary aim to create a two-player gaming experience within the confines of the command line interface. These are the game functionality we will include in our project
- Starting Point: The game starts with a snake for each player with a score of 0 and a piece of food on a grid.
- Movement: The player can control the direction of the snake using arrow keys for P1 and WASD for P2. The snake moves continuously in the specified direction.
- Objective: The main goal is to guide the snake to eat the food, which causes the snake to grow longer and earns point with each consumed piece.
- Grid Boundaries: The snake moves within the boundaries of a defined grid. If it hits the edge of the grid, it dies.
- Eating and Growing: When the snake eats a piece of food, its length and speed increases. The goal is to eat as much food as possible without colliding.
- Game Over: The player must avoid having the collision with itself, the components body, or the boundaries, if any of the above happens, it dies. When both players' snake dies, the game ends.
- Scorekeeping: Points are awarded for each piece of food eaten. The Player with the higher score at the end of the game wins.