예제 #1
0
파일: object.cpp 프로젝트: Taka03/Nolfeus
//===============================================
//当たり判定処理
//===============================================
void CObject::CheckHitRect(CPlayer &player, CEnemy &enemy)
{
	if(enemy.IsExist)
	{
		if(HitCheck(player.HitRect, enemy.HitRect) )
		{
			if(player.IsWolf)
			{
				enemy.CalcDamage(30, 0);
			}
			
			else if(player.IsClear)
			{
			
			}
			
			else
			{
				if(!player.IsInvince)
				{
					player.CalcDamage(enemy.Attack, player.Defence);
					player.KnockBack();
				}
			}
			
		}
	}
	
}
예제 #2
0
파일: object.cpp 프로젝트: Taka03/Nolfeus
void CObject::CheckHitRect(CPlayer &player, CBoss &boss)
{
	if(boss.IsExist && boss.counter > 200)
	{
		if(HitCheck(player.HitRect, boss.HitRect) )
		{
			if(player.IsWolf)
			{
				boss.CalcDamage(30, 0);	
			}
			
			else if(player.IsClear)
			{
			
			}
			
			else
			{
				if(!player.IsInvince)
				{
					player.CalcDamage(boss.Attack, player.Defence);
					player.KnockBack();
				}
			}
		}
	}

}
예제 #3
0
파일: object.cpp 프로젝트: Taka03/Nolfeus
void CObject::CheckHitRect(CBullet &bullet, CPlayer &player)
{
	/*敵弾とプレイヤーとの処理*/
	for(int i = 0;i < BULLET_MAX;i++)
	{
		if(bullet.Flag[i])
		{
			if(HitCheck(bullet.HitRect[i], player.HitRect) )
			{
				if(player.IsWolf)
				{
					bullet.Flag[i] = FALSE;
				}
				
				else if(player.IsClear)
				{
				
				}
				
				else
				{
					if(!player.IsInvince)
					{
						player.CalcDamage(bullet.Attack, player.Defence);
						player.KnockBack();
					}
					
					bullet.Flag[i] = FALSE;
				}
			}
			
			if(player.umbrella.IsExist)
			{
				if(HitCheck(bullet.HitRect[i], player.umbrella.HitRect) )
				{
					if(player.umbrella.counter >= 5 && player.umbrella.counter <= 8)
					{
						Se[SE_REFRECT].PlaySoundA();
						bullet.Flag[i] = FALSE;
						player.bullet.CreateRefBullet(player.umbrella.Get_PosX(), player.umbrella.Get_PosY(), i);
						player.bullet.IsRefrect[i] = TRUE;
					}
					
					else
					{
						player.bullet.IsRefrect[i] = FALSE;
					}
						
				}
			}
			
		}
	}
	
}