public Gem(int indexX, int indexY, int size, float x, float y, float radius, Random randomizer, Board board) : base(indexX, indexY, size, x, y, radius, randomizer, board) { Type = GemType.Base; _randomizer = randomizer; Size = size; _fluidSize = size; IndexX = indexX; IndexY = indexY; _radius = radius; _size = size; _fluidX = _x; _fluidY = _y; _opacity = 0; _angle = (float)(_randomizer.Next(100) * Math.PI * 2 / 100); _finalColor = new SKColor(195, 184, 85); _floatingParticule = new FloatingParticule(0, 0, radius / 8, 0.02f, _randomizer); //_floatingParticule = new FloatingParticule(0, 0, 0, 0.02f, _randomizer); //_floatingParticule = new FloatingParticule(0, 0, 3 * radius, 0.02f, _randomizer); var test = new SKColor(255, 255, 255); _spriteHalo = new Sprite(SpriteConst.SmallWhiteHalo, Width / 2, Height / 2, _size * _size, _size * _size, new SKPaint { Color = new SKColor(255, 255, 255) }); AddChild(_spriteHalo); _spriteStar = new Sprite(SizeToStarSpriteFilename(size), Width / 2, Height / 2, _size * _size, _size * _size, new SKPaint { Color = new SKColor(255, 255, 255) }); AddChild(_spriteStar); }
protected override void Draw() { FloatingParticule.Update(); using (var paint = new SKPaint()) { paint.IsAntialias = true; paint.StrokeWidth = 2; paint.Color = CreateColor(255, 200, 36); //Canvas.DrawCircle(X + Radius + FloatingParticule.X, Y + Radius + FloatingParticule.Y, Radius, paint); } }
public Shard(float x, float y, float width, float height, SKColor color) : base(x, y, width, height) { _color = color; _particules = new List <FloatingParticule>(); var randomizer = new Random(); _sprites = new List <Sprite>(); for (int i = 0; i < 5; i++) { var sprite = new Sprite(SpriteConst.Shard, 0, 0, 128, 128, new SKPaint { Color = _color, BlendMode = SKBlendMode.Plus }); AddChild(sprite); _sprites.Add(sprite); var particule = new FloatingParticule(0, 0, width / 4, 0.1f, randomizer); _particules.Add(particule); } Initialize(); DeclareTappable(this); }