Login Register
MoHH2 Legendz

Legends of Medal of honor:Heores 2.. Never forgotten RiP in piece


    You are not connected. Please login or register

    View previous topic View next topic Go down  Message [Page 1 of 1]

    Post: #1Wed Aug 22, 2012 12:54 pm

    ordo ab chao

    ordo ab chao

    Member


    We will start out with the source code for the text based game.
    Code:
    #includes <iostream>
    using namespace std;

    int main()
    {
      char x[128];
      cout << "insert starting text here. what do you do? insert options here ";
      cin >> x;
      if(x == choice1)
      {
          //your code here
      }
      else
      if(x == choice2)
      {
          //your code here
      }
      system("PAUSE");
      return 0;
    }

    that should be good for starting you off, next we will be demonstrating how to play a music file(has to be a .wav to work, convert any music or sound before entering the code, and you have to place it next to the .exe to work, unless you specify a directory)

    Code:
    #include <iostream>
    #include <windows.h>
    #include <MMsystem.h>

    using namespace std;

    int main()
    {
        PlaySound("backgroundmusic.wav", NULL, SND_ASYNC | SND_LOOP);
        system("PAUSE");
        return 0;
    }

    just change the 'backgroungmusic.wav' to '.wav' and your good to go, it loops as well, so it could be used as an overcomplicated music player Laughing

    now for the TextBased game download, since I cant upload it as an attachment, here is the last version of my text based game http://www.moddb.com/members/ordoabchao/downloads/my-text-based-game-version-05
    Do the sex slave route first! have a nice day



    View previous topic View next topic Back to top  Message [Page 1 of 1]

    Permissions in this forum:
    You cannot reply to topics in this forum