View Full Version: Problem with exe shutting down.

C++ Learning Community > C++ Help > Problem with exe shutting down.


Title: Problem with exe shutting down.


ChipChamp - December 16, 2006 06:54 PM (GMT)
Okay, well my problem is that I made a game thingy and it was working completely fine... except I added a couple more 'potions' and now whenever I choose to fight it says 'Game.exe has encountered a problem and needs to close. We are sorry for the inconveniense.' Then whether or not to send an error report...

EDIT: I figured out where the problem is. When I added comments around this part of the code:
CODE
if (str_up > 0) {
                            str_up -= 1;
                            damage -= 1;
                 }
                 if (def_up > 0) {
                            def_up -= 1;
                            defense -= 1;
                 }

it works fine. But without the comments, it shuts down when you fight... why?
EDIT AGAIN: Ahh... I figured it out. The problem was that I was declaring the str_up and def_up but not giving them values, so it had no value to check with. Sorry for any inconvienience!


Zaqufant - December 16, 2006 11:22 PM (GMT)
Wow, you just had a whole conversation with yourself, and you didn't even give us a chance to help you. You should be sorry.(jk)

Shonoby - December 24, 2006 12:07 AM (GMT)
LOL, u solved ur own problem LOL, what was the point of posting it??, to show ur good at programming (JK, dont reply)...yea so are u gonna post the game, cause i am a game developer, well going to be, and i like to look at diffrent aproches to making games with C++, (click "my best work so far" in my signitaruest to see my text RPG i made )

Ravotus - December 24, 2006 10:30 PM (GMT)
QUOTE
LOL, u solved ur own problem LOL, what was the point of posting it??

Well it obviously wasn't solved when he posted it. :lol:




* Hosted for free by InvisionFree