Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: TFS' Text Adventure: A C++ Project. DEMO  (Read 2865 times)

0 Members and 1 Guest are viewing this topic.
TFS' Text Adventure: A C++ Project. DEMO
« on: October 22, 2007, 05:46:08 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
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.
Logged
  • Super Fan Gamers!
Re: TFS' Text Adventure: A C++ Project. DEMO
« Reply #1 on: October 22, 2007, 06:07:18 am »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
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;
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: TFS' Text Adventure: A C++ Project. DEMO
« Reply #2 on: October 22, 2007, 06:14:37 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
Labels? Are you talking about goto?
Logged
  • Super Fan Gamers!
Re: TFS' Text Adventure: A C++ Project. DEMO
« Reply #3 on: October 22, 2007, 06:22:19 am »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
Yes.

blahblah:
    int x = 1 + 3;

goto blahblah;

That's labels D:
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog

Mamoruanime

@Mamoruanime
Re: TFS' Text Adventure: A C++ Project. DEMO
« Reply #4 on: October 22, 2007, 06:24:00 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
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
Logged
Re: TFS' Text Adventure: A C++ Project. DEMO
« Reply #5 on: October 22, 2007, 06:36:18 am »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
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
« Last Edit: October 22, 2007, 06:46:05 am by MiNalien »
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog
Re: TFS' Text Adventure: A C++ Project. DEMO
« Reply #6 on: October 22, 2007, 10:20:08 am »
  • (y)(;>.<;)(y)
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3293
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?
« Last Edit: October 22, 2007, 10:26:23 am by TheDarkJay »
Logged
Re: TFS' Text Adventure: A C++ Project. DEMO
« Reply #7 on: October 22, 2007, 07:22:35 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1141
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".
Logged
Re: TFS' Text Adventure: A C++ Project. DEMO
« Reply #8 on: October 23, 2007, 03:21:13 am »
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 4588
7 replies, all about goto? Is everyone a parrot? C'mon =/.

Just a simple text adventure showing my current C++ skills.
Nice work =D.
Logged
the a o d c
Pages: [1]   Go Up

 


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



Page created in 0.277 seconds with 52 queries.