Advertisement
Guest User

Untitled

a guest
May 28th, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. public bool enemiesCheckHit()
  2. {
  3. bool hit = false;
  4. foreach (SpriteAnimation sp in enemies)
  5. {
  6. Rectangle enemyAttack = new Rectangle((int)sp.gameObj.position.X + sp.lastRectanglePlus.attackRect.X,
  7. (int)sp.gameObj.position.Y + sp.lastRectanglePlus.attackRect.Y,
  8. sp.lastRectanglePlus.attackRect.Width,
  9. sp.lastRectanglePlus.attackRect.Height);
  10.  
  11. Rectangle saiyu = new Rectangle((int)saiyuSpriteAnimation.gameObj.position.X, (int) saiyuSpriteAnimation.gameObj.position.Y,
  12. saiyuSpriteAnimation.lastRectangle.Width, saiyuSpriteAnimation.lastRectangle.Height);
  13.  
  14. if (enemyAttack.Intersects(saiyu))
  15. {
  16. hit = true;
  17. // BEN TODO:
  18. }
  19.  
  20. }
  21.  
  22. return hit;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement