ZFGC
Projects => Other Projects => Topic started 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.
-
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;
-
Labels? Are you talking about goto?
-
Yes.
blahblah:
int x = 1 + 3;
goto blahblah;
That's labels D:
-
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
-
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
-
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?
-
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".
-
7 replies, all about goto? Is everyone a parrot? C'mon =/.
Just a simple text adventure showing my current C++ skills.
Nice work =D.