MORGAN DAVIS
  • Professional Work
  • Mod work
    • Dying Light: The Teleporter
    • Half-Life 2: Episode 2: The Elevator
  • Resume
  • Non-clickable Page

Text Adventure - Little Hero

Picture
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.
Picture
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.
Picture
The monsters in the game.
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.
Picture
If the input given to the program is not valid, the script knows to tell the user something like:
Picture
All of the correct inputs are attached to a specific function:
Picture
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.
Picture
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

Download the Project
File Size: 1735 kb
File Type: zip
Download File

Powered by Create your own unique website with customizable templates.
  • Professional Work
  • Mod work
    • Dying Light: The Teleporter
    • Half-Life 2: Episode 2: The Elevator
  • Resume
  • Non-clickable Page