Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
Binary file added Narniagameplay.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
87 changes: 18 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,26 @@
# Text-Based-Adventure
# 🌬 ❄️ 🐺 🦫 Text-Based-Adventure Game - Narnia! 🦫 🐺 ❄️ 🌬

## Introduction
This project was built with javascript as a text based adventure game that you can play in terminal!

This project will build on the skills that you've learned after your first couple weeks of programming in JavaScript! You will build a command line application that plays a text-based adventure game.
My Trello project link: [Trello](https://trello.com/b/vjRX7ODW/my-text-based-adventure-project)

### Examples
Instructions to run this code:
1. Git clone this repo
2. Open up the code in VSCode or your choice of IDE
3. Run npm install to install dependencies that this project uses
4. Run node textBasedAdventure.js
5. Play!

Look [here](https://classicreload.com/zork-i.html) and [here](http://www.bbc.co.uk/programmes/articles/1g84m0sXpnNCv84GpN2PLZG/the-hitchhikers-guide-to-the-galaxy-game-30th-anniversary-edition) for a couple examples of the genre. Be creative!
![Gamegif](https://github.com/sbweins/FSW-Text-Based-Adventure/blob/master/Narniagameplay.gif?raw=true)

A fun Google easter egg is to Google search `text adventure`. From the results page right click on the page and inspect the console. You should find a game by Google.

### Reading input
```javascript
console.log("Hello there! Welcome to Narnia!")

This project imports an npm module called `readline-sync` that allows the user to enter input to the terminal. The line at the top: `const readline = require('readline-sync')` gives you access to this functionality

Use the following line to get user input:

```js
let yourVariableHere = readline.question("Enter your name: ")
if (readlineSync.keyInYNStrict("Would you like to explore the world of Narnia? (Please type Y or N)")) {
play()
}
else {
leaveGame()
}
```


## Setup Instructions

1. Fork this repo
1. Clone the forked repo to your machine
1. `cd` to the cloned folder and type `npm install` in the terminal.
1. Create a file called `.gitignore`.
1. Inside of .gitignore write `node_modules/`

## Submission Instructions

1. Complete the project
1. Commit and Push your changes to your fork
1. Submit a Pull Request back to the assignment repo
1. Paste a link to your Pull Request (not your fork!) on Canvas and submit


## User Stories

### As a user, I want to be able to begin a game

#### Acceptance criteria

- Cloning your project, running `npm install` and `node YOURPROJECTNAMEHERE.js` will start a game
- No errors are logged to the console
- The game displays initial instructions about how to play and a welcome message

### As a user, I want to be able to make decisions during the game

#### Acceptance criteria

- Invalid entires are re-prompted
- There are at least 10 opportunities to make a decision
- The user must enter a string to make a decision
- The user must enter a number to make a decision

### As a user, I want to be able to restart a game

#### Acceptance criteria

- The user is prompted to restart the game and can enter yes or no
- Entering no causes the program to terminate
- Entering yes begins the game again, wiping the previous state

## Trello Board

Replace the link below with the link to your Trello project:

[Trello](https://trello.com/b/vbKtMOKj/text-based-adventure-project-plan)


## Rubric

![outcomesRubric.png](./outcomesRubric.png)
![acRubric.png](./acRubric.png)
127 changes: 126 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"homepage": "https://github.com/joinpursuit/FSW-Text-Based-Adventure#readme",
"dependencies": {
"chalk": "^4.1.0",
"readline-sync": "^1.4.10"
}
}
Loading