Text Adventure - Little Hero
Overview
Little Hero is a text adventure made for the purpose of learning more C#.
The story follows a young boy exploring his home and backyard with the one objective kids always have: play. To move around the world, simply type in "North" or "n" to move to different rooms. (Typing in Help gives all the commands).
Everything you interact with is in the perspective of a child, thus, a stick becomes a sword, a box becomes a helmet, and so forth.
Enemies include monsters that scare the Little Hero, as well as an older sibling and parents who take away from the "imagination." For example, Mom points out the silliness of you wielding a stick.
The story follows a young boy exploring his home and backyard with the one objective kids always have: play. To move around the world, simply type in "North" or "n" to move to different rooms. (Typing in Help gives all the commands).
Everything you interact with is in the perspective of a child, thus, a stick becomes a sword, a box becomes a helmet, and so forth.
Enemies include monsters that scare the Little Hero, as well as an older sibling and parents who take away from the "imagination." For example, Mom points out the silliness of you wielding a stick.
Stats for the game:
1. Imagination - the higher the imagination, the better the stick becomes (and a better ending of the game).
2. Points - This is the score of the game. Talking to parents gives points, but takes away from the player's imagination.
3. Fear - the Little Hero starts at 0, but looking at monsters or trying to attack them increases fear. A heartbeat sound goes off when the kid's fear is really high, until finally one can lose the game through fear.
1. Imagination - the higher the imagination, the better the stick becomes (and a better ending of the game).
2. Points - This is the score of the game. Talking to parents gives points, but takes away from the player's imagination.
3. Fear - the Little Hero starts at 0, but looking at monsters or trying to attack them increases fear. A heartbeat sound goes off when the kid's fear is really high, until finally one can lose the game through fear.
Scripting Highlights
The entire game runs inside a while loop that constantly checks which room the player is in. Then whatever the user types in the console is thrown into a function called UserInput.
If the input given to the program is not valid, the script knows to tell the user something like:
All of the correct inputs are attached to a specific function:
Saying something like "talk to father" will work because the UserInput function knows to check for "talk" and then once it knows this, it calls up the "Handle_Talk" function. And since "father" is a correct string used in the function, it knows to handle the next part.
If you want to play yourself, download the project below and open the folder:
DAVIS_TextAdventure\DAVIS_TextAdventure\bin\Debug
And run the .exe file
DAVIS_TextAdventure\DAVIS_TextAdventure\bin\Debug
And run the .exe file
Download the Project |