예제 #1
0
 /// <summary>
 /// Remove the instance of the <see cref="Core.Button"/>.
 /// </summary>
 internal void remove()
 {
     _touch.eventTouchBegan -= touchBegan;
     _touch.eventTouchEnded -= touchEnded;
     _father.RemoveChild(_spriteNorm);
     _father.RemoveChild(_spritePressed);
 }
예제 #2
0
        void removeSprite(CCNode sender)
        {
            CCNode p = sender.Parent;

            if (p != null)
            {
                p.RemoveChild(sender, true);
            }
        }
예제 #3
0
        private void removeSprite(CCNode sender)
        {
            ////----UXLOG("removing tile: %x", sender);
            CCNode p = sender.Parent;

            if (p != null)
            {
                p.RemoveChild(sender, true);
            }

            //////----UXLOG("atlas quantity: %d", p.textureAtlas().totalQuads());
        }
예제 #4
0
        private void SetGemType(int x, int y, int newType)
        {
            // Check bounds
            if (x < 0 || x >= Constants.KBoardWidth)
            {
                return;
            }
            if (y < 0 || y >= Constants.KBoardHeight)
            {
                return;
            }

            // Get the type of the gem
            var idx     = x + y * Constants.KBoardWidth;
            var gemType = _board[idx];

            // Make sure that it is a gem
            if (gemType < 0 || gemType >= 5)
            {
                return;
            }

            _board[idx] = newType;

            // Remove old gem and insert a new one
            _gameBoardLayer.RemoveChild(_boardSprites[idx], true);

            var gemSprite = new CCSprite("crystalscrystals/" + newType + ".png");

            gemSprite.Position    = new CCPoint(_fieldPositionZero.X + x * Constants.KGemSize, _fieldPositionZero.Y + y * Constants.KGemSize);
            gemSprite.AnchorPoint = CCPoint.Zero;

            _gameBoardLayer.AddChild(gemSprite);
            _boardSprites[idx] = gemSprite;

            _boardChangedSinceEvaluation = true;
        }