The Murderer - My first text-based C++ game!

Discussion in 'Computer Programming, Emulation, and Game Modding' started by Boy12, Aug 28, 2014.

  1. Boy12
    OP

    Boy12 NOT a new member!

    Member
    536
    134
    Mar 8, 2012
    Netherlands
    Purmerend
    Screenshot
    [​IMG]
    To start off
    First of all, i began learning C++ about a week ago now.​
    This little text game is only made as a little project, to see what if i can do/have learned so far.​
    In terms of updates: don't expect very much (maybe 2 or so) updates, because as i said above, it's just a little test game.​
    What the game is about
    One night, you are sleeping peacefully in your bed, when suddenly, you hear knocking on your front door!​
    You don't know what to do at that point, as you keep lying in your bed, awake...​
    Versions / Downloads / Homepage
    The current version right now is version 1.0.​
    There is not really that much content in the game right now, but you can consider this version a little demo of some sort.​
    The source is (and will also be in later versions) included, so you can also take a look at it, and see on what points I can improve.​
    You may of course also use the source, to toy around with it yourself!​
    Although I must say the code is not very clean right now.​

    Feedback is always welcome!
    Have fun ;)
     
    Sicklyboy and mcopo like this.
  2. Boy12
    OP

    Boy12 NOT a new member!

    Member
    536
    134
    Mar 8, 2012
    Netherlands
    Purmerend
    18 downloads - no feedback guys? :(
     
  3. jonthedit

    jonthedit GBAtemp Advanced Maniac

    Member
    1,691
    438
    May 30, 2011
    Bangladesh
  4. mcopo

    mcopo Advanced Member

    Newcomer
    91
    9
    Mar 12, 2012
    Brazil
    I managed to run it. I simply downloaded msvcr120d.dll and msvcp120d.dll from www.dll-files.com and put them on the .exe folder.

    Fun little game. I liked the endings XD
    Just too bad the knife wasn't nasty...

    But here's my two cents:
    - since this is for learning, I'd suggest to always aim to add more "gameplay elements" instead of content. For example, next version you should try to make the game accept words from the player like "go north", "get knife", etc. Simply adding more choices, more endings and such won't teach you much.
    - I've noticed some "goto" commands on the code. Please, avoid at all costs using them because as the project grows, "goto" commands make the program really really hard to read and understand. (http://sourcemaking.com/antipatterns/spaghetti-code).

    I coded very little in C++ so that's what I can say for now. I'll soon get back to it, though.
    Now good luck on your learning quest. :)
     
    Boy12 likes this.
  5. jonthedit

    jonthedit GBAtemp Advanced Maniac

    Member
    1,691
    438
    May 30, 2011
    Bangladesh
    This is strange, considering the 2013 Redist for x86 and x64 should cover the issue...
     
  6. Boy12
    OP

    Boy12 NOT a new member!

    Member
    536
    134
    Mar 8, 2012
    Netherlands
    Purmerend
    Huh, weird some people are having some .DLL error's.
    Is there any way I can fix my code so people won't have those issues?
     
  7. jonthedit

    jonthedit GBAtemp Advanced Maniac

    Member
    1,691
    438
    May 30, 2011
    Bangladesh
    Not use the strange version of Visual C++ :P
     
  8. Boy12
    OP

    Boy12 NOT a new member!

    Member
    536
    134
    Mar 8, 2012
    Netherlands
    Purmerend
    So, it's been a long time since I am working on this game!
    Since i'm having my tentams next week, i'll try to give you guys a little update (hopefully) in the upcoming days.
    EDIT: I'm also cleaning up my code a little bit for version 1.1, what code should I use instead of goto?
     
  9. ilman

    ilman Gbatemp's Official Noise Eraser

    Member
    1,130
    243
    Jul 25, 2010
    Shibuya
    Use do{}while() loops instead of those goto commands.
    For example this:
    Code:
    retry:
    ...
    if (something) goto retry;
    can be switched with this:
    Code:
    do{
    ...
    }
    while (something);
    Also, don't use system() functions...they are super slow and they have alternatives.
    For example instead of system("pause") you can make this function:
    Code:
    void pause()
    {
        char a;
        cout<<"Any text goes here"<<endl;
        cin.get(a);
    }
    There was an alternative for system ("CLS") but I don't remember it, sojust google it.