Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (146)

Sign In or Sign Up now to post a comment!
  • to compile go to visual studio command prompt and type in cd C:\users\"yourusername"\deskto­p into it and save the game in desktop and type in cl /EHsc adventuregame.cpp

  • also everytime i debug it says there's 1 fail.

    

  • i can't find where to compile and run....

  • Mindsedge why dont you use do while loop for ignoring other options?

    for example if you type 1, 2 ,3 you "advance" however if you click everything else it reloads.

    do {

    your menu or story code

    }while (opt != 1 && opt != 2 && opt !=3);

  • @1DarkMasK1

    sorry type not click lol.

  • Someone pls respond... I'm working in visual studio and every time i debug (compile and run) it it only shows for a second. I tried system("pause"); and it doesn't work! Please help!

  • @MrLegendaryStream

    Add cin.get();  after your code (in main.cpp) just before "return 0;" if you have that, otherwise, at the end, before "}". The system will expect an input from the user.

    Hope this helps!

  • @sharkyjulz i did this and i get an error because "Error identifier "cin" is unidentified. what can i do?

  • need help... i got the text down but everytime i try somthing it fails. if i press enter it just closes the window...

  • How do you compile and run it?

  • @bunny12391 and also, I never told anyone to learn their shit. You and 13Macintosh did. And I was referring to command like 13igMacintosh said, not c++

  • @bunny12391 please make informed statements. Someone told me to learn MY shit. Am I expected to sit back and take their crap?

  • @bunny12391 someone told ME to learn MY shit. I was only saying that to THEM.

  • Yeah i've followed this tutorial, and everytime i open the game up, it closes out on me, then when i use DevC++ it stays open, but the game crashes everytime i make a option, what am i doing wrong here?

  • @Hatred2Soul I had the same problem in DEV C++ you need this at the end, visual studio does it automatically!

    system("PAUSE");

    return EXIT_SUCCESS;

  • @CHADCURTISS1 That's the problem too, i actually do have that at the end, and it still gives problems :S

  • Comment removed

  • can i parse this to take more than 2 worm commands?

  • can this be used in DEV C++?

  • lol printf, good on you lad - I know that printf isn't standard, but it's better for text adventures (from experience, it doesn't tend to put random lines in places.)

  • @13igMacintosh c++ is a programming language no mater how you chose to show it wether its on an ide or notepad its the same thing. learn YOUR shit ma brotha

  • @bunny12391 trudat!

  • and please send me a link to it

  • what program?

  • @mryomantoo visual studio

  • Whoa! You sure use a lot of non standard C++. I made my first text advanture during summer and I have no idea what these commands are.

  • I have one more question! how can i describe it? with the

    int Choice

    ...

    scanf( "%d", &Choice )

    i can only make

    if( Choice == [Number] )

    but i want to make something like

    if( Choice == [Word] )

    how can i do it? hope, you understood what i mean

  • Hello everybody! I want to make my own text-adventure but there is one problem.. Can I give the parts of my adventure names and can I use a command like "if x then goto", that would be very important in my text adventure! Please help me!

  • Could you give me the link for that wallpaper pls

  • project is out of date?

  • Choice is not defined

  • @13igMacintosh I know my shit, I'm learning c++ with my friend. Notepad however, is easier than c++ and does the same thing. I was offering a simpler alternative, not asking for a smartass reply.

  • @epicnerd905 like i said before c++ is a programming language it exactly the same no mater what your using. and if you were just making a simple seggestion you probably shouldnt be telling people to learn there shit

  • If you like Bootleggers your going to love Mafia Secrets, you here about everyone claiming old school on bl, well be old school on MS. The game just in the early stages and just being released just a few days ago, this is were its at, wanna be the most powerful on a game, and have the advantage of being there from the start then check us out @ mafiasecrets . com

    

  • Dude, just use notepad.

  • @epicnerd905

    lol

  • @epicnerd905 ...

  • printf is not c++ standard... use cout

  • I'm sorry, but this is just terrible.

  • guess it's pretty much same thing if I use dev c++ right?

  • God never use printf.. It's very old and is used in C. ALWAYS use cout unless there is no other possible way.

  • Whenever I try to put in a choice and click enter, it closes the console window :(

    I have no errors what so ever when I compile, what am I doing wrong?

  • @Chrisxantixemox Sorry if this reply is a little late. Its because the system uses enter as a way to close the window.

    To fix it add

    system("PAUSE");

    Before the 'return 0;' at the end of the code :)

  • @MrPhantomBadger Yeah, figured it out by now :P but thanks anyways!

  • Help! please someone, after i do the response at 4:45 it says 0 succeeded and 1 failed and says fatal error C1075: end of file found before the left brace '{' in the output box but there is nothing before it, if someone can help me out i would appreciate it '-'

  • no file called _TCHAR

  • Can you give us source code of that game? I really need to check something out!

  • Um, isn't cout << "Insert text here" beter than printf?

  • Thank you so much ive been trying to make a game like this but i didnt know you have to use this ==

  • is this a good tutorial if you just started with c++?

  • right now when i just put pause it shows the text for 1 second then dissapeares how can i make it stay????????????!!!!!!!!!

  • @Heboidme Try cin.get(); at the end, then it will wait for you to type before it ends it.

  • @Heboidme cin.get(); is a good way to do it but if you have used "cin >> blablabla" anywhere in your code that wont work so you can do system("pause")

    (however that one wont work if you use CodeBlocks

  • when i put the system("pause"); it showsan error of

    " 1 IntelliSense: identifier "system is undefined

    what to do?

  • @Heboidme

    Do you use windows? Or other operating system?

  • if it apeas and dissapperss put to equals for the codes

  • My console appears and disappears. It does not stay open :(!!!

  • @TheDeLeG3nD Put at the end:

    system("pause");

    return = 0;

  • @TheDeLeG3nD Or whenever you want the game to pause

  • why the fuck you are using printf() for C++ tutorial?

  • Printf(); ? Have you not heard of cout?

  • for people who are sad about the auto close problem in their hello-world programs you have to put system("PAUSE"); at the end of the program before return0 ( it only works on widows). Oh and this is a great tutorial i always come back to get info from it for more complex programs i build, hope minds edge makes more tutorials

  • @spiceweasel09 try _getch

  • nice tutorial it is very good explained and i understand it well

  • why do you use printf() and not cout << ?

    i always found cout << when i watched something about c++

    i thought printf() was C

  • It auto closes (as the top comment says) on my as well :(:(

  • ....ok great vid but thats not c++

    dont u use cout << "whatever u want to say here" << endl;

    some thing like that...were does this printf come from

  • Meh, many ways to do it. I use cout << :P

  • @littlex6 it and alternative choice you can use i use cout as well though

  • hay instead of compiling it all the time you can also click build solution and it will just say if u have an error so u dont have to run the program every time

  • : Commit Suicide

    Commit Suicide with what?

    >Commit Suicide with Polar bear!

  • use, cout << " ";

    and #include "stdafx.h"

    

  • SO. Say I dont have a program like that. If I made this is Notepad how would I go about testing to see if it worked? (Would the program Eclipse work?)

  • <3

  • one thing happends when i press 1 and another thing happend when i press 2

  • but if i want another "answer" for Choice number two, so there will be diffrent things that happends when i press 1 or 2???

  • why is he using printf when you could use cout or std::cout? unless it's completely in C and not C++

  • use void to shorten up your code guys!

  • if it just opens and cloes, if you printf("whatever"); . Before return 0; put getchar();

  • Comment removed

  • to compile = ctrl + f7

    to run it = ctrl + f5

  • I has paused at 6:18

  • how do u complile the instructions?

  • If you guys are having the problem were the program runs and then closes with out showing you the results simply type in Cin.get at the last part

  • Will this work with Visual Studio C++ Express?

  • mafia-vendetta . com

  • How do I make the program restart instead of ending?

  • thankyou for this vid i defenently learnt somin. :D

  • Is it the game process when coding in Java? Cause right now im in java trying to make a text adventure game.

  • @conker2020 Java and C++ is diffrent yet similar, similar due to some of the refrence keys and way you type stuff, but if your writing in java to make a text based game this isn't the tutorial ur really looking for

  • @infamousstuff well this tutorial really helped alot i basically took what you had in C++ and applied it all to java

  • @conker2020 Like i said its similar but diffrent in some aspects, and this isnt my video, i just can code better then this, i was looking for more advance way to make a game and this was not what i was looking for lol, but it helps out a bit

  • I also had the problem with the command window closing as soon as I executed the program after compiling it, despite having no errors. However, I found that if you press CTRL+F5, it should run no problem :)

  • This helped a lot! :D

  • @TheUnknown0924 no download it its free.

  • @TheUnknown0924 you would need a c++ compiler (google) but visual studio is free!

  • @TheUnknown0924 lol you can get microsoft visual c++ express 100% free. just google it

  • im am using 2010 ver and when i try to open it it closes arffter 0.5 seconds what is happing? im use windows 7 plz help i have looked every where with no solution...

  • @TheUnknown0924 just download it. It's free.

  • if only this was c#, that'd be amazing.

  • Is there a way to make different branches? Say, if a character tells someone they love you, or doesn't, can it still continue throughout the whole game, depending on what they chose?

  • when you debug or play this game all the writing will be their from the choice before so would cls work to clear line space?

  • Where's part two?

  • Where's part 2?

  • Best online Text-Based games bit(.)ly/boVa9a register now...

  • Could you please make another Video explaining how to give the user choices and stuff.

  • I like it but it really doesn't explain how to do it...for example you just pasted in the intro..i have no idea how to add that stuff in or how to make my text box stay up.

  • @TheScam117 There's actually a different way a different way of doing this and possibly simpler if you haven't worked with c++ very much. I've been experimenting. PM me if u want a bit of a tutorial. You'll have to bear with me though, I'm still just learning myself lol

  • Where's part 2? I subscribed to your channel so that I could finish my own game, but can't find part 2 of this video. Thanks.

  • is this easy to make if have completely no knowledge about c++ ?

  • does it works on visual c++ too?

  • i tried printf( "hi" ); but it auto closes :(

  • @ThatLPerGuy That is because the console application has ended, so it closes. I do not know why the authors application pauses after it ends. He probably has that set somewhere in the Visual Studio IDE. You can do this manually by placing this just before the final return(0);

    system("pause");

    Or you could have it read for a keystroke by doing another scanf.

  • @joeshmoe66 well actually, i read somewhere about this problem and they said debugging it by using alt f5 or ctrl f5 (it's morning i cant remember) and it debugs it in a way and it didnt close. i think that's what the author did

  • @ThatLPerGuy Ok, makes sense. However, when you make the exe file and execute it, you will not get the benefit of that automatic pause. You will still probably want to program in some sort of pause.

  • @ThatLPerGuy mine does that too...

  • @ThatLPerGuy Type:

    system ("PAUSE");

    after the printf.

  • @ThatLPerGuy I think he made a mistake. Cout >> "" outputs text. The command printf is used in C. Hoped this helped. :)

  • @ThatLPerGuy

    printf( "hi" );

    return 0;

  • @ThatLPerGuy try to do cin.get

  • @ThatLPerGuy At the end of the program try typing Cin.get instead of return 0; because that doesnt show the work and just closes, but after the if else then function then put the return 0; in respectful places

  • @ThatLPerGuy XD put " getchar();" at the very end, 2 if you need to

  • @ThatLPerGuy  use this cin.clear();

    cin.ignore(255, '\n');

    cin.get();

  • @ThatLPerGuy That's not C++. To print "Hi" in C++ you need to do: cout << "hi" << endl;

  • @ThatLPerGuy you have to put cin.get(); at the end so that the program waits for the user to press a key before quitting the program

  • @ThatLPerGuy IT runs. It just runs so fast, you cannot see it. Try adding System("pause");

    to your program

  • @ThatLPerGuy

    Ctrl + F5

    That should bring the window back up

  • thanks man, this really made my knowlegde of C++ quadrouple :D

  • wow cool tutorial

  • And whatever choice i make ends up with the text i wrote for the fourth choice... Annoying

  • Hi, can you paste in the code snippet that is giving you trouble? I will look at it.

  • My program stops as soon as i choose what to do... How do I make it continue?

  • Comment removed

  • Thank you so much,

    best tutorial out there!

  • Thanks for the kinds words!

  • @MindsEdge2006 You'r awesome thank you :D

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more