C# Console Application
C# Text Adventure
A command-line adventure game developed in C#. I started with code provided by our teacher and expanded it with new rooms, commands, items, health, inventory and an ending.
Interactive demo
Try the game
This JavaScript demo recreates the logic of the original C# console application so it can be played in a browser.
Overview
About the project
We received the basic game code from our teacher. It already included the main game loop, simple rooms, movement and basic commands.
My task was to continue working with this code and add new classes, commands and game mechanics. This helped me practise reading and extending an existing codebase.
Gameplay
How the game works
The player starts outside a university and moves between rooms by typing commands such as go south or go up.
While exploring, the player loses health, finds items and manages a backpack with a weight limit. Items can be picked up, dropped and used.
To finish the game, the player must find a key, solve a riddle, collect an amulet and use it in the portal room.
My work
What I added
- New rooms and exits, including up and down.
- The Player, Item and Inventory classes.
- Health and hunger damage while moving.
- A backpack with a maximum weight.
- The look, status, items and inventory commands.
- The take, drop and use commands.
- Items with different effects.
- A riddle, an amulet and a winning ending.
Technology
Technologies used
Reflection
What I learned
- Reading and understanding existing code.
- Adding features without breaking the original program.
- Working with classes, objects and methods.
- Using dictionaries to store rooms and items.
- Processing commands entered in the terminal.
- Sharing data between different classes.
- Testing and debugging a multi-file C# project.