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

Boy12

NOT a new member!
OP
Member
Joined
Mar 8, 2012
Messages
536
Trophies
0
Location
Purmerend
XP
459
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

mcopo

Well-Known Member
Member
Joined
Mar 12, 2012
Messages
101
Trophies
1
XP
281
Country
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. :)
 
  • Like
Reactions: Boy12

jonthedit

Well-Known Member
Member
Joined
May 30, 2011
Messages
1,682
Trophies
0
XP
1,010
Country
Bangladesh
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...
 

Boy12

NOT a new member!
OP
Member
Joined
Mar 8, 2012
Messages
536
Trophies
0
Location
Purmerend
XP
459
Country
Netherlands
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?
 

Boy12

NOT a new member!
OP
Member
Joined
Mar 8, 2012
Messages
536
Trophies
0
Location
Purmerend
XP
459
Country
Netherlands
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?
 

ilman

Gbatemp's Official Noise Eraser
Member
Joined
Jul 25, 2010
Messages
1,128
Trophies
0
Age
25
Location
Shibuya
XP
570
Country
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

General chit-chat
Help Users
  • No one is chatting at the moment.
  • K3Nv2 @ K3Nv2:
    Jaws is on a diet
  • K3Nv2 @ K3Nv2:
    Damn power went out
  • BigOnYa @ BigOnYa:
    Ok xdqwerty, your little bro prob tripped On the cord and unplugged you
  • K3Nv2 @ K3Nv2:
    Ya I'm afraid of the dark hug me
  • BigOnYa @ BigOnYa:
    Grab and hold close your AncientBoi doll.
  • K3Nv2 @ K3Nv2:
    Damn didn't charge my external battery either
  • BigOnYa @ BigOnYa:
    Take the batteries out of your SuperStabber3000... Or is it gas powered?
  • K3Nv2 @ K3Nv2:
    I stole batteries from your black mamba
    +1
  • K3Nv2 @ K3Nv2:
    My frozen food better hold up for an hour I know that
  • BigOnYa @ BigOnYa:
    Or else gonna be a big lunch and dinner tomorrow.
  • BigOnYa @ BigOnYa:
    Did you pay your power bill? Or give all yo money to my wife, again.
  • K3Nv2 @ K3Nv2:
    Oh good the estimated time is the same exact time they just said
    +1
  • BigOnYa @ BigOnYa:
    Load up your pc and monitor, and head to a McDonalds dining room, they have free WiFi
  • K3Nv2 @ K3Nv2:
    Sir please watch your porn in the bathroom
    +2
  • BigOnYa @ BigOnYa:
    No sir we can not sell you anymore apple pies, after what you did with the last one.
  • K3Nv2 @ K3Nv2:
    We ran out
  • HiradeGirl @ HiradeGirl:
    for your life
    +1
  • K3Nv2 @ K3Nv2:
    My life has no value my fat ass is staying right here
  • K3Nv2 @ K3Nv2:
    Nearly 4 hours without power :(
  • Veho @ Veho:
    SO POWERLESS
  • K3Nv2 @ K3Nv2:
    Tell Kanye I need power
  • DinohScene @ DinohScene:
    Better start running in your hamster wheel
    DinohScene @ DinohScene: Better start running in your hamster wheel