Text-Based

This is a discussion on Text-Based within the Game Programming forums, part of the General Programming Boards category; I made this game (or at least tried to) a lot earlier. I had deleted it and moved onto other ...

  1. #1
    Rabite SirCrono6's Avatar
    Join Date
    Nov 2003
    Location
    California, US
    Posts
    269

    Question Text-Based

    I made this game (or at least tried to) a lot earlier. I had deleted it and moved onto other programs and learning more after that. Today I decided I wanted to pick it up again. So I opened my compiler, wrote the code, and got out the errors. Then I found out it will close at this one spot, and I can't figure out why.

    - SirCrono6
    Attached Files Attached Files
    From C to shining C++!

    Great graphics, sounds, algorithms, AI, pathfinding, visual effects, cutscenes, etc., etc. do NOT make a good game.
    - Bubba

    IDE and Compiler - Code::Blocks with MinGW
    Operating System - Windows XP Professional x64 Edition

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    1,205
    Check your switch:
    Code:
    // How you wrote them:
    switch(choice)
    {
    case '1':
        dosomething();
        break;
    }
    
    // How you want them to be:
    switch(choice)
    {
    case 1:           // Notice that I dont have any ' ' around 1
        dosomething();
        break;
    }
    the ' ' are only nessecary (spelling?) around single char's, for example
    Code:
    switch(somechar)
    {
    case 'a':
        dosomething;
        break;
    }

  3. #3
    Rabite SirCrono6's Avatar
    Join Date
    Nov 2003
    Location
    California, US
    Posts
    269
    Thankyou! That worked perfectly. Now I can focus more on creating more gameplay.

    - SirCrono6
    From C to shining C++!

    Great graphics, sounds, algorithms, AI, pathfinding, visual effects, cutscenes, etc., etc. do NOT make a good game.
    - Bubba

    IDE and Compiler - Code::Blocks with MinGW
    Operating System - Windows XP Professional x64 Edition

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Text based game..
    By MipZhaP in forum C++ Programming
    Replies: 8
    Last Post: 02-28-2005, 07:35 AM
  2. struct question
    By caduardo21 in forum Windows Programming
    Replies: 5
    Last Post: 01-31-2005, 03:49 PM
  3. Looping Text based battle
    By pujuman in forum C++ Programming
    Replies: 7
    Last Post: 12-18-2004, 04:24 AM
  4. making a text based game
    By MisterSako in forum C++ Programming
    Replies: 1
    Last Post: 12-05-2004, 12:20 PM
  5. Text Based Game
    By drdroid in forum C++ Programming
    Replies: 2
    Last Post: 02-18-2002, 05:21 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21