Starting a Text-based Adventure game
For about a year and a half I’ve always wanted to make a text-based adventure game. Now I have finally come round to starting one. I don’t know if I’ll be able to carry the story, but building the systems to make the classic text-based adventure game is fun. I’m using Windows Presentation Foundation in C#. For example, I’m using dictionaries to store data about enemies (health, magica, strength, weapon etc.) and weapons (damage, value etc).
public static Dictionary<string, Enemies>; Enemy = new Dictionary<string, Enemies>();
public static Dictionary<string, Weapons>; Weapon = new Dictionary<string, Weapons>();
Weapon.Add("Iron Dagger", new Weapons("Iron Dagger", 5, 6, 30, true));
Enemy.Add("Dark Mage", new Enemies("Dark Mage", 100, 50, 10, 10, Weapon["Iron Dagger"], "A Dark Mage appears! Smight him down, hero!"));
I’m also going to use something like a linked list to make each ‘state’ or ‘room’ (when a statement is given to you and you can reply with input) as this will allow me to link one state to the next and send the player down different routes. I’ve implemented the tab key to repeat your last command to make it a bit easier. It doesn’t validate any text yet, its just a battle system with one enemy and weapon. Looking forward to making more of it. I’m also going to be updating Sweepy Cleaner in the Easter holidays.
That’s all for now :)