ZFGC

Projects => Other Projects => Topic started by: Theforeshadower on October 22, 2007, 05:46:08 am

Title: TFS' Text Adventure: A C++ Project. DEMO
Post by: Theforeshadower on October 22, 2007, 05:46:08 am
Just a simple text adventure showing my current C++ skills.  It is text, so I cannot give a screenie...lol...
It should be in the attachment.
There is only one bug I know of and I can't seem to fix it.  It's no big deal but kills what I am trying to do.
When you get the option to grab the key, if you select no, it takes you to the next room, instead of giving you the previous options for some reason.  You can still finish the demo of course!  Just go back to the previous room instead of continuing forward and make sure to grab the key.
The text comes up fast and I did not put pauses on everyline, so if the text seems hard to figure where to start reading from, sorry.
The source code is also an attachment.
Title: Re: TFS' Text Adventure: A C++ Project. DEMO
Post by: Cassyblanca on October 22, 2007, 06:07:18 am
Dear. God. No. PLEASE tell me you'll never use labels again, or I'll never be able to forgive you for this o-o;
Title: Re: TFS' Text Adventure: A C++ Project. DEMO
Post by: Theforeshadower on October 22, 2007, 06:14:37 am
Labels? Are you talking about goto?
Title: Re: TFS' Text Adventure: A C++ Project. DEMO
Post by: Cassyblanca on October 22, 2007, 06:22:19 am
Yes.

blahblah:
    int x = 1 + 3;

goto blahblah;

That's labels D:
Title: Re: TFS' Text Adventure: A C++ Project. DEMO
Post by: Mamoruanime on October 22, 2007, 06:24:00 am
Yes.

blahblah:
    int x = 1 + 3;

goto blahblah;

That's labels D:

rofl wow I have my VB mentality... I'm like "Uh... I dont see any label controls that were dimensioned o.O"

Although, for a text adventure... he cant really use a game loop or anything; or at least he shouldnt make a game loop for it... Labels seems like the easiest way to do what it is he's trying to do with it :P
Title: Re: TFS' Text Adventure: A C++ Project. DEMO
Post by: Cassyblanca on October 22, 2007, 06:36:18 am
it still makes me cry remembering my text days XD

Blessed be my C++ with Irrlicht or SDL. Blessed be my C# with Irrlicht.NET, SDL.NET, or XNA. Blessed be my sleep, which I really need right now. Gnight XD
Title: Re: TFS' Text Adventure: A C++ Project. DEMO
Post by: TheDarkJay on October 22, 2007, 10:20:08 am
Yes, goto is considered a terrible programming habit, and can result in spaghetti string code.

If you were to do it without labels, why not simply use a switch statement?
Title: Re: TFS' Text Adventure: A C++ Project. DEMO
Post by: sjegtp on October 22, 2007, 07:22:35 pm
Sorry TFS, I forgot to tell you that goto is considered an extremely bad habit -.-" Though C++ enables it in order to allow you to have many ways of making the code. But you can do it without goto, you can switch it by while loops and switch blocks... Sometimes using goto is simpler than using other things, but you shouldn't use it anymore since it "can result in spaghetti string code".
Title: Re: TFS' Text Adventure: A C++ Project. DEMO
Post by: AoDC on October 23, 2007, 03:21:13 am
7 replies, all about goto? Is everyone a parrot? C'mon =/.

Just a simple text adventure showing my current C++ skills.
Nice work =D.

Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved