SKAction GetResizeAction(SKTexture texture) { SKAction sequence = SKAction.Sequence( SKAction.WaitForDuration(1.0f), SKAction.ResizeTo(192.0f, 192.0f, 1.0f), SKAction.WaitForDuration(1.0f), SKAction.ResizeTo(128.0f, 192.0f, 1.0f), SKAction.WaitForDuration(1.0f), SKAction.ResizeTo(256.0f, 128.0f, 1.0f), SKAction.WaitForDuration(1.0f), SKAction.ResizeTo(texture.Size, 1.0f) ); return(SKAction.RepeatActionForever(sequence)); }
/// <summary> /// Анимация бонуса Бомба /// </summary> /// <param name="bomb">Бомба.</param> public void AnimateBomb(Gem bomb) { CGSize initialSize = new CGSize(gemCellWidth, gemCellHeight); CGSize newSize = new CGSize(gemCellWidth * (Properties.BombBlastRadius * 2 + 1), gemCellHeight * (Properties.BombBlastRadius * 2 + 1)); CGPoint initialPosition = GetPositionFromRowAndColumn(bomb.Row, bomb.Column); SKSpriteNode sprite = SKSpriteNode.FromImageNamed("bomb_blast"); sprite.Size = initialSize; sprite.Position = initialPosition; sprite.ZPosition = 110; SKAction resizeSprite = SKAction.ResizeTo(newSize, Properties.LineDestructionDuration / 1000f); gemLayer.AddChild(sprite); sprite.RunAction(SKAction.Sequence(resizeSprite, SKAction.RemoveFromParent())); }