Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualparinho7

Posted 01 January 2013 - 11:06 PM

I do one thing it runs fine. I try it again, it crashes. what's happening?

I am trying to use for the first time a finite state machine in my game. The whole reason of making the game is to use a FSM. So, I have two states, STATE_MAIN_MENU and STATE_EXIT.

I have my abstract class, two derived classes for the two states and all. I have already done a similar console application and everything works fine, but here when I am getting from main menu to exit the game crashes, but not all the times. It runs fine for 2-3 times (deletes currentState instance of State_Main_Menu and then currentState = new State_Exit()). The thing is that I put a cout at the constructor of State_Exit and it does construct the class. But then when a function of class is about to run it crushes.

I can't explain it any better, I am attaching the code if anyone could help me I'd appreciate it, because I am getting crazy here!

Thanks in advance!

#1parinho7

Posted 01 January 2013 - 07:24 PM

I do one thing it runs fine. I try it again, it crashes. what's happening?

I am trying to use for the first time a finite state machine in my game. The hole reason of making the game is to use a FSM. So, I have two states, STATE_MAIN_MENU and STATE_EXIT.

I have my abstract class, two derived classes for the two states and all. I have already done a similar console application and everything works fine, but here when I am getting from main menu to exit the game crashes, but not all the times. It runs fine for 2-3 times (deletes currentState instance of State_Main_Menu and then currentState = new State_Exit()). The thing is that I put a cout at the constructor of State_Exit and it does construct the class. But then when a function of class is about to run it crushes.

I can't explain it any better, I am attaching the code if anyone could help me I'd appreciate it, because I am getting crazy here!

Thanks in advance!

PARTNERS