Thread: My first attempt at a text rpg

  1. #1
    Registered User Bargomm's Avatar
    Join Date
    Nov 2007
    Posts
    4

    My first attempt at a text rpg

    Hello.
    I am pretty much new to programming. I decided to try my hand at programming a text rpg. It isn't that great, but I'm just starting. Please leave comments or criticisms about it. Some critiques on the bollocks story would be cool, too. Please be nice but honest. Thanks :-)



    http://www.geocities.com/mysteriousy...tasmagoria.zip
    Last edited by Bargomm; 12-24-2007 at 07:46 PM.

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Only there's no code and this is a programming forum
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User Bargomm's Avatar
    Join Date
    Nov 2007
    Posts
    4
    I know :-p I'll post the hacked and slashed source later. I'm a bit pressed on a time right now:-)



    EDIT: Here is the source. I know it looks horrible and disgusting, not to mention a clumsy mess. But criticism probably could help me from making more messes of code :-p

    http://www.geocities.com/mysteriousy...hantsource.zip
    Last edited by Bargomm; 12-24-2007 at 05:08 PM.

  4. #4
    Registered User
    Join Date
    Jan 2007
    Posts
    89
    nice job...your next step should be to break up that cpp file into muliple files.
    5500 lines is alot of code to peruse all at once.

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Break code into other files.
    Put declarations in header files.
    Don't use global variables (or avoid).
    Fix your indentation - each block should be indented once and all indentation in the same block level should be consistent.

    This is what I can figure out after a small look at the code.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Registered User Bargomm's Avatar
    Join Date
    Nov 2007
    Posts
    4
    Thanks for the tips guys. But do you know how I can fix the double-click problem? I use the getch() function to gather input from the keyboard, but I have to press twice in order for it to register it. How can I fix that?

  7. #7
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459

  8. #8
    Registered User Bargomm's Avatar
    Join Date
    Nov 2007
    Posts
    4
    Ha ha, did not see that. Thanks :-p



    Edit: Someone pointed out to me the error that caused the double click. It was because I was calling the getch() function twice like

    int response;
    getch();
    response=getch();

    I just have to take out the first getch() and the program asks only for one response. Anything else I should do better?
    Last edited by Bargomm; 12-26-2007 at 06:48 AM.

  9. #9
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Yeah, you could try to fix what I mentioned. Then you could re-post your code and we can take a look at it again.12
    Readability comes first.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. text rpg help
    By xxwerdxx in forum Game Programming
    Replies: 1
    Last Post: 11-26-2005, 08:16 PM
  2. Replies: 3
    Last Post: 05-25-2005, 01:50 PM
  3. struct question
    By caduardo21 in forum Windows Programming
    Replies: 5
    Last Post: 01-31-2005, 04:49 PM
  4. mygets
    By Dave_Sinkula in forum C Programming
    Replies: 6
    Last Post: 03-23-2003, 07:23 PM
  5. Check out My Text Rpg Game
    By knight543 in forum C++ Programming
    Replies: 3
    Last Post: 05-17-2002, 10:40 PM