Beispiel #1
0
        public bool MayCollectItem(FigureImp figure, out ItemImp item)
        {
            var possibleItem = GetItemData(GetTilePositionFromWorld(figure.Position));

            if (possibleItem.IsActive)
            {
                item = (ItemImp)possibleItem;
                return(true);
            }

            item = null;
            return(false);
        }
Beispiel #2
0
        private void FillDefaultData()
        {
            const int entries = GameLevelWidth * GameLevelHeight;

            _data   = new TileBlockImp[entries];
            _fringe = new TileBlockImp[entries];
            _explosionOverlayData = new ExplosionFragment[entries];
            _bombs.Clear();
            _itemData = new Item[entries];
            for (var i = 0; i < entries; ++i)
            {
                var p = new Point(i % GameLevelWidth, i / GameLevelWidth);
                _explosionOverlayData[i] = new ExplosionFragmentImp {
                    TilePosition = p
                };
                _itemData[i] = new ItemImp {
                    TilePosition = p
                };
            }
        }