Sign in to follow this  
Aliquis

Zork-like text game in C#

Recommended Posts

Aliquis    101
Hello everyone.

I have just started to learn C#, and decided to make my first project a text RPG along the lines of Zork or Adventure. I have some programming experience with C++ and Java, so I am not a total beginner. My knowledge is a bit limited though, and I know nothing about C#. So, I wanted to make sure I do everything right from the beginning, to avoid stupid mistakes that will force me to redo the whole project.

I'd like my game to have a GUI - basically, a window with a text field, a line to enter commands, and some buttons to open other windows like inventory, stats, etc. How do I best approach this? I've read there are two different ways to make a GUI in C#, WinForms and WPF, which would you recommend?

Thanks.

Share this post


Link to post
Share on other sites
RaoulJWZ    1305

Altought i'm not a c# programmer, it seems better to me for you to start simple: 

maybe with a simple text-based RPG without GUI, while this can become quiete hard if you don't know anything about the language.

I know it isn't that cool, but it's a good way to get an understanding of the syntax and the principes (if you don't know these already from c++ and java).

 

I hope this will be a bit usefull for you and that someone else can maybe give you some c# information.

Share this post


Link to post
Share on other sites
Aliquis    101
I did make a simple game in C++ without GUI a few years ago, it had like 3 rooms, 2 monsters, 3 spells, something like that. So I'm fairly confident I'll be able to write something. It was probably very sub-optimally written though.

Share this post


Link to post
Share on other sites
Glass_Knife    8636

So, I wanted to make sure I do everything right from the beginning, to avoid stupid mistakes that will force me to redo the whole project.

 

If you ever figure out how to do this, write a book.  You will make a lot of money.  :-)

 

Making many games, all with errors, is the path to becoming a developer.  There isn't a short cut to skip this part.  Go make your game.

Edited by Glass_Knife

Share this post


Link to post
Share on other sites
Lodeman    1596

But still, should I pick WinForms or WPF?

I have no experience with WPF, all I can tell you is that WinForms is incredibly straight-forward and easy to implement considering the needs you mentioned. So that would definitely not be a bad choice.

Share this post


Link to post
Share on other sites
Xai    1838

WinForms is outdated and has no real future, but it actually is incredibly easy to do something like this ... I actually found that my "zork like" prototype was easier in WinForms than as a console app, because I didn't have to think in terms of paying attention to building everything in the world in terms of term arrangement and layout.  Also, WinForms isn't too bad of an experience if you later use any other standard GUI library, like GTK#, QT, wxWindows, etc.

 

I gave mine a menu:  nothing but Exit and About to start ... later added New Game, Save Game and Load Game

A main output text area - where all the output was shown to the user.

A main input text box - for the user to type into.

AND - a debugging box, that had a second output text area (for sending debugging info), including outputting the "normalized" version of the user's parsed command (helped a lot in debugging early issues).

 

Good Luck.

Share this post


Link to post
Share on other sites
LennyLen    5715


Altought i'm not a c# programmer, it seems better to me for you to start simple: 

 

A basic GUI such as the one he wants is actually extremely simple using C# and Visual Studio.  My first C# project had a more complicated GUI (drop down menus that were generated at runtime as the data had to be read in from another program), and I finished the entire program in one afternoon, having never seen the language before or having ever used the IDE.

 

The game logic will be far more complicated than doing the GUI.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this