public bool checkIfPlayerHitEnemy(Enemy enemy, Player player) { if (player.playerRec.Intersects(enemy.enemyRec)) { return true; } return false; }
public string checkEnemyLevelCollision(Enemy enemy, Level level) { string collision = ""; foreach (Rectangle rectangle in level.levelRec) { if (enemy.enemyRecRight.Intersects(rectangle)) { collision += "Right"; } if (enemy.enemyRecLeft.Intersects(rectangle)) { collision += "Left"; } if (enemy.enemyRecBottom.Intersects(rectangle)) { collision += "Bottom"; } } return collision; }