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

  • Thread starter Thread starter Boy12
  • Start date Start date
  • Views Views 4,527
  • Replies Replies 8
  • Likes Likes 2

Boy12

NOT a new member!
Member
Joined
Mar 8, 2012
Messages
536
Reaction score
135
Trophies
0
Location
Purmerend
XP
489
Country
Netherlands
Screenshot
w1yyY1C.png
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 ;)
 
  • Like
Reactions: Sicklyboy and mcopo
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. :)
 
  • Like
Reactions: Boy12
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. :)
This is strange, considering the 2013 Redist for x86 and x64 should cover the issue...
 
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?
 
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?
 
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.
 

Site & Scene News

Popular threads in this forum