My first attempt at a text rpg

This is a discussion on My first attempt at a text rpg within the Game Programming forums, part of the General Programming Boards category; Hello. I am pretty much new to programming. I decided to try my hand at programming a text rpg. It ...

  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 06:46 PM.

  2. #2
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,184
    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.
    For information on how to enable C++11 on your compiler, look here.
    よく聞くがいい!私は天才だからね! ^_^

  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 04: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をこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,184
    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.
    For information on how to enable C++11 on your compiler, look here.
    よく聞くがいい!私は天才だからね! ^_^

  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 05:48 AM.

  9. #9
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,184
    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.
    For information on how to enable C++11 on your compiler, look here.
    よく聞くがいい!私は天才だからね! ^_^

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, 07: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, 03:49 PM
  4. mygets
    By Dave_Sinkula in forum C Programming
    Replies: 6
    Last Post: 03-23-2003, 06: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21