Exemplo n.º 1
0
        public CactusEnemy(Rectangle position, int power, int velocity, int frequency, CollisionType collisionType, string message)
        {
            this.Position = new Vector2(position.X, position.Y);
            this.Size     = new Vector2(position.Width, position.Height);
            this.Power    = power;
            this.IsAlive  = true;
            this.sprite   = SpriteFactory.GetCactusSprite();
            this.ShouldNotifyReceivers = false;
            this.CollisionType         = collisionType;
            this.Velocity           = new Vector2(0, 0);
            this.needleSpeed        = velocity;
            this.needleFrequency    = frequency;
            this.timer              = frequency - 15;
            this.MessageToReceivers = message;

            needleRect = new Rectangle(
                position.X + position.Width / 2 - needleWidth / 2,
                position.Y + position.Height / 2 - needleHeight / 2,
                needleWidth,
                needleHeight);
            needles = new List <NeedleEnemy>(6);
        }