Search:

Type: Posts; User: Xanderbeard

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    5,917

    Getting user input without pausing

    Is there a simple way to allow user input without having the program "wait" for it?

    For example, I want to write a function that counts down from 100 to 0. The only way to stop it would be if the...
  2. Replies
    8
    Views
    1,661

    Thanks for the replies, I am looking into the...

    Thanks for the replies, I am looking into the posted resources now.

    I played around with ascii using simple 2d arrays just to get a feel for how I would do a 2d 'tile-based' game. I worked out a...
  3. Replies
    8
    Views
    1,661

    Your experience from text to graphics.

    I've spent much of my free time, for the last few weeks, learning as much as I can about c++. My first goal was to be to make a text-based rpg. I wasn't concerned, or even very interested, in the...
  4. Thank you very much, this basically answered all...

    Thank you very much, this basically answered all of my questions. My Fruit list[100] is just a normal array. I didn't even think of actually using a list.


    I'm pretty inexperienced, so I don't...
  5. If I close the debug version of my .exe by...

    If I close the debug version of my .exe by literally closing(x) the window. My compiler says there was an access violation. This only happens if there are destructors that would have been called had...
  6. Destructor causes compiler error with hard exit?

    If I hard exit the debug version of my exe, I get a compiling error from class destructors that havn't been called yet. Does this mean I have built the destructors wrong, or is it normal because the...
  7. Code to dump a classes objects into an array?

    class Fruit
    {
    public:
    string name;
    int quantity;
    }apple = {"Apple", 5}, pear = {"Pear", 3}, peach = {"Peach", 2};

    Fruit list[100];
  8. Replies
    2
    Views
    897

    Item[100]* inventory; //this line gets errors...

    Item[100]* inventory; //this line gets errors for me.
    Item* inventory[100]; //this way works though, what's the difference?

    I need each value in inventory[] to point to the name and quantity of...
  9. Replies
    2
    Views
    897

    question on class pointers.

    I'm trying to make an inventory system for a rpg game, and I'm having a hard time doing it. This is the idea of what I have so far:




    class Item
    {
    public:
    void create_item(int...
  10. Replies
    4
    Views
    1,321

    My save file is getting pretty complicated. It...

    My save file is getting pretty complicated. It saves strings, ints, and floats.
    Having it write the information I want to a .txt is no sweat.

    However, reading the various data types is becoming...
  11. Replies
    4
    Views
    1,321

    Thank you very much. The .ignore did the trick. I...

    Thank you very much. The .ignore did the trick. I did not know mixing input methods would be such a hassle, next time I will look into reading the whole file first ,then sorting it out.
  12. Replies
    4
    Views
    1,321

    Reading from a file trouble

    I'm having a hard time reading from a .txt file. Here's a short version of what I have:



    LoadFile.open("Save File.txt", ios::in);

    getline(LoadFile, name1);

    for (int i = 0; i<2;i++)...
  13. Replies
    6
    Views
    996

    Thanks mates, I see where I was confused now....

    Thanks mates, I see where I was confused now. That code I posted was just something I typed for the post-- I wasn't trying to run that.
  14. Replies
    6
    Views
    996

    In my above example. Is there a way to delete the...

    In my above example. Is there a way to delete the object Potion if the user no longer has any? That would free up the memory used to store information about an object that I don't even need. Or am I...
  15. Replies
    6
    Views
    996

    Question about destructors

    I'm working on an inventory system for a game. Right now I have:



    Struct Item()
    {
    string name;
    int value, quantity, type;
    int creator(int);
    };
  16. Replies
    6
    Views
    1,877

    I guess its like I'm moving a mound of dirt with...

    I guess its like I'm moving a mound of dirt with a shovel instead of a tractor. The shovel might be a barbaric way of doing it, but the concept is easy. A tractor on the other hand would be a very...
  17. Replies
    6
    Views
    1,877

    Thank you! That answers my question. So what's...

    Thank you! That answers my question.
    So what's the smallest amount of code to achieve that?



    do
    {
    main_menu();
    }while (choice != 5);
  18. Replies
    6
    Views
    1,877

    Question about "Back" option in menu.

    I'm working on a text-based program that is written almost exclusively in functions.
    I'm using switch statements for the menu choices. Each case input will call the appropriate function.

    So...
Results 1 to 18 of 18