Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public bool enemiesCheckHit()
- {
- bool hit = false;
- foreach (SpriteAnimation sp in enemies)
- {
- Rectangle enemyAttack = new Rectangle((int)sp.gameObj.position.X + sp.lastRectanglePlus.attackRect.X,
- (int)sp.gameObj.position.Y + sp.lastRectanglePlus.attackRect.Y,
- sp.lastRectanglePlus.attackRect.Width,
- sp.lastRectanglePlus.attackRect.Height);
- Rectangle saiyu = new Rectangle((int)saiyuSpriteAnimation.gameObj.position.X, (int) saiyuSpriteAnimation.gameObj.position.Y,
- saiyuSpriteAnimation.lastRectangle.Width, saiyuSpriteAnimation.lastRectangle.Height);
- if (enemyAttack.Intersects(saiyu))
- {
- hit = true;
- // BEN TODO:
- }
- }
- return hit;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement