My first game!!!!

This is a discussion on My first game!!!! within the C++ Programming forums, part of the General Programming Boards category; Where is lvltext.h? I wanna find out how u can make that typing effect....

  1. #16
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020
    Where is lvltext.h?

    I wanna find out how u can make that typing effect.

  2. #17
    Registered User Sekti's Avatar
    Join Date
    Feb 2002
    Posts
    163

    well

    you can make a function that takes a string and adds 1 to each character in it change a to b c to d or you can make it bigger by doing it times 2 or some then save it to a file its been done on this board just search for it
    +++
    ++
    + Sekti
    ++
    +++

  3. #18
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020
    I don't really understand what you mean sorry.

  4. #19
    Registered User
    Join Date
    Dec 2001
    Posts
    206
    personally i use this function(i made):
    Code:
    typing(char* Text, int speed){
      
    for (int i = 0;Text[i] != '\0';i++) 
    { 
    cout << Text[i]<< flush; 
    Sleep(speed); 
    }
    return 0;
    
    }
    just type typing("What you want to say here", what speed you want it to go at);

    ie:
    typing("Hello", 50);

  5. #20
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020
    Hi,

    After some minor fixes your function works. But is there anyway to do the same thing but not using any delay functions like sleep() ?

    thnx, just wondering

  6. #21
    Pygmy Monkey ErionD's Avatar
    Join Date
    Feb 2002
    Posts
    408
    Why would you want to do that. Oh and i use the same as Denethor.
    Or, well, except for the lvltext cause then i didnt know about that func so i did it like this:

    Code:
    void type(char* letter) {
    cout << letter;
    Sleep(25);
    }
    
    // and then in main:
    
    type("D");
    type("a");
    type("m");
    type("n ");
    type("S");
    type("l");
    type("o");
    type("w");

  7. #22
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    Ok newbie question here.........you see where you have that save character settings and then load character settings, how do you do that. Let's say I want to save the settings of a specific character let's say Mr. X.....and then I want to load it, how would the code for this look like?
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  8. #23
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    anybody?
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  9. #24
    I'm Back
    Join Date
    Dec 2001
    Posts
    556
    elchulo: here's some general idea since i dont have the code of the game.

    1. you create a player
    2. play the game
    3. in between the game somewhere it asks for savegame
    4. if you say yes it writes all the data that the player uses like
    name,level#,htpoints,injuries etc into file
    5. next time you run the file it asks for load saved player
    6 if yes it reads from the file and sets the default values to those
    in the file


    hope this helps


  10. #25
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    Ok, but the part that I am having problems with is saving the data on a specific order so then I can load it up when I open the file and have it all match.........he has in on his game, I just don't know how to do it.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  11. #26
    I'm Back
    Join Date
    Dec 2001
    Posts
    556
    use structures and read/write to store data in file.

    just keep the structure variables same

  12. #27
    Pygmy Monkey ErionD's Avatar
    Join Date
    Feb 2002
    Posts
    408
    When reading from a file it stops when a new line (or a whitespace?) comes up. So i just did it like this:

    Code:
    // make instances of classes for using files
    ofstream fileout(filename/*the variable that the user types in*/,ios::out|ios::trunc);
    ifstream filein(filename);
    
    //save
    fileout << variable << "\n";
    fileout << variable2 << "\n";
    fileout << variable3 << "\n";
    
    //load
    filein >> variable;
    filein >> variable2;
    filein >> variable3;
    ehh? You can just write away the structure!?!?!?!?!?!!!
    AAAAAAAGH!!!!!!!! And i didn't know....

  13. #28
    Registered User
    Join Date
    Feb 2002
    Posts
    27
    Hy there, like the game. I encountered some bugs though.

    1) I accidentally pressed ` in the spellshop and it crashed.

    2) After gaining level 3, my point and coin upgrades didn't register. So I would gain some points and/or coins and they wouldn't be saved. I can't really reproduce it, but it happened.

    And about the encryption, just do some cool stuff with bitshifting and nobody will be able to read it.:)

  14. #29
    Pygmy Monkey ErionD's Avatar
    Join Date
    Feb 2002
    Posts
    408
    What do you mean with that "point and coin upgrades" thing you were talking about?
    Oh and how do i do bitshifting?

  15. #30
    Registered User
    Join Date
    Feb 2002
    Posts
    27
    I mean, experience points and golden coins. U know, the things u get after you've won a battle.

    Bitshifting: >> and <<, just look it up. Its an operator.

Page 2 of 12 FirstFirst 1234567891011 ... LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how do the game engine and the api interact?
    By Shadow12345 in forum Game Programming
    Replies: 9
    Last Post: 12-08-2010, 12:08 AM
  2. Open Source / Semi Open source game idea. Help needed
    By CaptainPatent in forum Projects and Job Recruitment
    Replies: 10
    Last Post: 05-16-2007, 11:44 AM
  3. game engine advice?
    By stien in forum Game Programming
    Replies: 0
    Last Post: 01-23-2007, 03:46 PM
  4. My Maze Game --- A Few Questions
    By TechWins in forum Game Programming
    Replies: 18
    Last Post: 04-25-2002, 12:00 AM

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