Thread: omg....

  1. #1
    |<o>| <--cyclopse LouDu's Avatar
    Join Date
    Mar 2003
    Posts
    137

    omg....

    i opened up my game code, and the whole thing was gone just a bunch of crap code liek this

    Code:
    //---------------------------------------------------------------------------
    
    #include <vcl.h>
    #pragma hdrstop
    //---------------------------------------------------------------------------
    WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
    {
            try
            {
                     Application->Initialize();
                     Application->Run();
            }
            catch (Exception &exception)
            {
                     Application->ShowException(&exception);
            }
            catch (...)
            {
                     try
                     {
                             throw Exception("");
                     }
                     catch (Exception &exception)
                     {
                             Application->ShowException(&exception);
                     }
            }
            return 0;
    }

    WTF IS WRONG HELP
    Languages <> C++, HTML

    /*The Ledgend of Ludlow Coming to a PC Near
    You intro Cinenmatic Needed email me of
    Reply to one of my threads if you can make
    one, thats decent. */

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    What are you talking about??!

    I'm guessing you've overwritten one of your source files by mistake... oh well... I'm sure you've got a back-up copy?
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    |<o>| <--cyclopse LouDu's Avatar
    Join Date
    Mar 2003
    Posts
    137
    just found one hehe but i am haveing a little trouble with this new battle system i want to implment heres the code and below it is what i want it to do, and what it dose now.



    Code:
    if (x > 90)
    
    while (knighthealth > 0)
    {
    if(userhealth <= 0)
            {
                    userhealth = 0;
                    cout << "\nYou have been slayed in battle!\n";
                    cout << "Press any key to continue...\n";
                    getch();
                    return 0;
             }
    
    cout << "You engage an Enemy\n";
    
    cout << "Strike (1)         Run(2)\n\n";
    cin >> combat;
    
    switch (combat)
    {
    case 1 :
                    cout << "\nYou attack, and do " << userattack <<" damage.\n\n";
                    knighthealth = knighthealth - userattack;
                    cout << "\nBlack Knight attacks, does "<< knightattack <<" Damage.\n";
                    userhealth = userhealth - knightattack;
                    getch();
    break;
    case 2 :
                    cout << "\nBlack Knight attacks, does "<< knightattack <<" Damage.\n";
                    userhealth = userhealth - knightattack;
                    getch();
                    User_Location_X++;
                    User_Location_Y++;
    break;
    
    
    }
    
    if (knighthealth <= 0)
    {
            cout << "\nYou have defeated a Black Knight.\n";
            cout << "You gain "<< knightexp << " Exp and "<<knightgold<<" Gold.\n";
            battle = 0;
            getch();
    
            userexp = userexp + knightexp;
            usergold = usergold + knightgold;
            knighthealth = knightmaxhealth;
    }
    
    }}
    while(knighthealth!=1);
    return 0;}



    ok what it dose, is you hit 1, you enagge battle, that works fine, then you choose agin, but once he dies, i want it tto go back into normal moving around modd, you just continulsy keep battleing, and that is not what i want. When you hit 2, the knight only attacks you, then you go to battleing again, i want the battle to end, and then back to the normal walking around "mode"


    if you can help i'd appericate it, this is just the first step in implmenting a majoir battle system so i need this to work without any kinks
    Languages <> C++, HTML

    /*The Ledgend of Ludlow Coming to a PC Near
    You intro Cinenmatic Needed email me of
    Reply to one of my threads if you can make
    one, thats decent. */

  4. #4
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    As far as what you asked, if you could attach the whole cpp so that i may compile/run it, it would be easier for me to debug it.

    Just a few things in there:

    Code:
    knighthealth = knighthealth - userattack;
    This code works, but it can be done better, with shorter statments:

    Code:
    knighthealth -= userattack;
    Since your on this section, now might be a good time to add a catch for bad input when selecting 1 or 2. An example can be found in the "little problem" thread.

    By return to normal walking mode, i assume you mean you want it to return to the player state before the battle? Say i walk to x pos 10 and y pos 10 right before i fight, i would be in that mode, but at say x pos 11 and y pos 9?

  5. #5
    |<o>| <--cyclopse LouDu's Avatar
    Join Date
    Mar 2003
    Posts
    137
    I fixed the problem, it was a mistake with were the if statment should be
    Languages <> C++, HTML

    /*The Ledgend of Ludlow Coming to a PC Near
    You intro Cinenmatic Needed email me of
    Reply to one of my threads if you can make
    one, thats decent. */

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Omg Last Time I Swear!
    By unejam2005 in forum C++ Programming
    Replies: 3
    Last Post: 12-13-2005, 12:49 AM
  2. OMG!!! You guys!!!
    By RoD in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 04-04-2003, 10:17 PM
  3. omg lmao go to this link, it's funnay!
    By Shadow12345 in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 12-07-2002, 06:12 AM