Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actuallinhmai27

Posted 26 November 2012 - 01:29 AM

thank for reading my topic. When i create object of myTank in main function, and render it. All things work.

but when i create object of TankGame in main function( it include instance of mytTank, it call constructor of m_player, and in debug mode, it goes to the end of TankGame constructor ( in this case, it created myTank object ),it raise "error Run-Time Check Failure #0" here

script is an singleton class, and i tested it, it worked. Posted Image

#ifndef TANK_SCRIPTOR
#define TANK_SCRIPTOR
#pragma warning (disable:4786)
//-----------------------------------------------------------------------------
//
//  Name:   Raven_Scriptor
//
//  Author: Mat Buckland (www.ai-junkie.com)
//
//  Desc:   A Singleton Scriptor class for use with the Raven project
//-----------------------------------------------------------------------------
#include <script\Scriptor.h>
#define script Tank_Scriptor::Instance()
class Tank_Scriptor : public Scriptor
{
private:
 
  Tank_Scriptor();
  //copy ctor and assignment should be private
  Tank_Scriptor(const Tank_Scriptor&);
  Tank_Scriptor& operator=(const Tank_Scriptor&);
public:
  static Tank_Scriptor* Instance();
};

#endif

#1linhmai27

Posted 26 November 2012 - 01:27 AM

thank for reading my topic. When i create object of myTank in main function, and render it. All things work.

but when i create object of TankGame in main function( it include instance of mytTank, it call constructor of m_player, and in debug mode, it goes to the end of TankGame constructor ( in this case, it created myTank object ),it raise "error Run-Time Check Failure #0" here

script is an singleton class, and i tested it, it worked. :)

PARTNERS