An interactive terminal maze-solving game.
This project is one of Codecademy's challenge projects within their Intermediate JavaScript course.
The player has lost their hat (^) in a field full of holes (O), and they must navigate back to it without falling down one of the holes or stepping outside of the field.
In Progress..
- The project is centered on a Field class. The Field constructor should take a two-dimensional array argument representing the “field” itself.
- Give the Field class a .print() method that prints the current state of the field.
- The game should be playable by users. They should be prompted input and be able to indicate which direction they'd like to move.
- After entering an instruction, the user should see a printed result of their current field map with the tiles they have visited marked with (*). They should be prompted for their next move.
- When any of the below occur, let the user know and end the game:
- The player wins by finding their hat.
- The player loses by landing on (and falling in) a hole.
- The player attempts to move “outside” the field.
- Add a .generateField() static method to the Field class. This method should at least take arguments for height and width of the field, and it should return a randomized two-dimensional array representing the field with a hat and one or more holes. Add a third percentage argument used to determine what percent of the field should be covered in holes.
- Give the Field class a static .generateField() method that takes arguments for height and width of the field, and returns a randomized two-dimensional array representing the field with a hat and one or more holes.
- Have the character start on a random location that’s not the upper-left corner.
- Create a “hard mode” where one or more holes are added after certain turns.
- Improve game graphics and interactivity in the terminal.
- Create a field validator to ensure that the field generated by Field.generateField() can actually be solved.
- Javacript ES6
- Node.js v21.7.2
- prompt-sync v4.1.7
- terminal-kit v3.1.1