Beispiel #1
0
 internal static bool Intersects(BoundingCircle circle, BoundingRectangle rectangle)
 {
     return circle.BoundingSphere.Intersects(rectangle.BoundingBox);
 }
Beispiel #2
0
 private void Init(IGame game)
 {
     _rectangle = new BoundingRectangle
         {
             Position = Position,
             Width = _width*Settings.Instance.PlaygroundBlockWidth,
             Height = _height*Settings.Instance.PlaygroundBlockHeight
         };
     _grid = game.ContentProvider.GetGridSprite(_width*Settings.Instance.PlaygroundBlockWidth,
                                                _height*Settings.Instance.PlaygroundBlockHeight);
     _grid.Position = _position;
     GroundBlocksNumber = Count(block => block is GroundBlock);
     _blocksNumber = (int) (Count(block => block is GroundBlock || block is WaterBlock)*0.88);
     _forReplaceBuffer = new HashSet<PlaygroundBlock>();
     _forIntersectionsBuffer = new List<PlaygroundBlock>();
     _path = new List<PathBlock>();
     _deadPath = new List<DeadPathBlock>();
     _deathBlocksLeftQueue = new Queue<PathBlock>();
     _deathBlocksRightQueue = new Queue<PathBlock>();
 }
Beispiel #3
0
 private void Init()
 {
     SetSprite(ProvideSprite());
     _boundingRectangle = new BoundingRectangle {Position = Position, Height = Height, Width = Width};
 }