Jackson La Vallee
This project is an implementation of the classic 2048 game in Rust. The game features a 4x4 grid where players combine numbered tiles by sliding them in four directions. The goal is to create a tile with the number 2048.
Key features include:
- Command-line interface
- Save and load game functionality
- Undo move capability
- Score tracking
This implementation utilizes the following 3rd party crates:
randfor random number generationserdeandserde_jsonfor game state serialization
To install and compile the project, follow these steps:
- Ensure you have Rust and Cargo installed on your system.
- Clone the repository:
git clone https://github.com/rustvu-2024f/project-JacksonLaVallee.git - Navigate to the project directory:
cd project-JacksonLaVallee - Build the project:
cargo build --release
The compiled binary will be located in target/release/.
To start the game, run the following command in the project directory:
cargo run --release
Game controls:
- Use 'w', 'a', 's', 'd' keys to move tiles up, left, down, and right respectively
- 'u' to undo the last move
- 'k' to save the current game state
- 'l' to load a previously saved game state
- 'q' to quit the game
Example gameplay:
- Start the game
- Press 'd' to move tiles right
- Press 'w' to move tiles up
- Continue playing until you reach 2048 or no more moves are possible
- Use 'k' to save your progress at any time
- Use 'l' to load a saved game in a future session
The game will display the current board state, score, and available moves after each turn.