Beispiel #1
0
cPlayer::cPlayer(const std::string & _name, const D3DXVECTOR3 & _pos, const D3DXVECTOR3 & _vDir, cIState * _pState)
{
	this->AddRef();
	SetName(_name);
	m_chrSkinnedMesh = new cSkinnedMesh;
	m_objSkinnedMesh = new cWeaponSkinnedMesh;
	SetVBaseDir(D3DXVECTOR3(0, 0, -1));
	SetVDir(D3DXVECTOR3(0, 0, -1));
	SetVPos(_pos);
	SetVDir(_vDir);

	SetTag(g_pGameManager->FindObjectType("player"));
	g_pObjectManager->AddObject(this);

	SetStateMachine(new cPlayerFSM(this, _pState));
}
void Fire::Initialize(byte* screenPtr, byte screenWidth, byte screenHeight)
{
	// fire properties
	SetX(0);
	SetY(0);
	
	SetHDir(0);
	SetVDir(1);
	SetSpeed(8);
	SetLastUpdate(0);
	SetEnabled(false);
	
	Canvas *canvas = GetCanvas();
	canvas->SetWidth(1);
	canvas->SetHeight(1);
	canvas->SetImage(fire);
	canvas->SetScreenWidth(screenWidth);
	canvas->SetScreenHeight(screenHeight);
	canvas->SetScreen(screenPtr);

	/*
	if ((canvas->GetScreen()) != screenPtr)
	{
		Serial.println(" test 1 - pointers diferentes");
	}
	if (*(canvas->GetScreen()) != *screenPtr)
	{
		Serial.println(" test 2 - valores de pointers diferentes");
	}
	Serial.println("fim fire init");
	*/
}