Exemple #1
0
 public override bool RectangleCollision(SpriteAbstract otherSprite)
 {
     if (this.X < otherSprite.X - otherSprite.Texture.Width * otherSprite.Scale / 3)
     {
         return(false);
     }
     if (this.Y + this.Texture.Height * this.Scale * HITBOXSCALE / 2 < otherSprite.Y - otherSprite.Texture.Height * otherSprite.Scale / 2)
     {
         return(false);
     }
     if (this.X > otherSprite.X + otherSprite.Texture.Width * otherSprite.Scale / 3)
     {
         return(false);
     }
     if (this.Y - this.Texture.Height * this.Scale * HITBOXSCALE / 2 > otherSprite.Y + otherSprite.Texture.Height * otherSprite.Scale / 2)
     {
         return(false);
     }
     return(true);
 }
Exemple #2
0
 abstract public bool RectangleCollision(SpriteAbstract otherSprite);