예제 #1
0
void CannonBall::HandleCollision(IEntity* pOther)
{


	if (pOther->GetType() == ENT_TILES)
	{
		DestroyActorMessage* destroy = new DestroyActorMessage{ this };
		destroy->QueueMessage();
		destroy = nullptr;

	}

	if (pOther->GetType() == ENT_FATHER)
	{
		dynamic_cast<Father*>(pOther)->SetAlive(false);

		SGD::Event* CannonBallHit = new SGD::Event("Death", nullptr, this);
		CannonBallHit->QueueEvent(pOther);
		DestroyActorMessage* destroy = new DestroyActorMessage{ this };
		destroy->QueueMessage();
		destroy = nullptr;

	}


}
예제 #2
0
void CheckPoint::HandleCollision(IEntity* pOther)
{

	if (pOther->GetType() == ENT_FATHER)
	{
		dynamic_cast<Father*>(pOther)->SetCheckPoint(GetPosition());
		SGD::Event* event = new SGD::Event("Walking", nullptr, this);
		event->QueueEvent();
	}
}