public GuidedBullet(World world, GameObject parent, GameObject target, double x, double y) : base(world)
        {
            this.target = target;

            Damage = ScoreManager.GuidedBulletDamage;

            X = parent.X + parent.Width / 2;
            Y = parent.Y + parent.Height / 2;

            Width  = 6;
            Height = 6;

            Sprite = new Engine.CircleSprite(new SolidColorBrush(Color.FromRgb(77, 190, 255)), 3);

            angle = GetAngleToTarget(target);
            SetAngle(angle + angleOffset);

            DispatcherTimer t = new DispatcherTimer();

            t.Interval = TimeSpan.FromSeconds(2.5);
            t.Tick    += delegate
            {
                IsDied = true;
                t.Stop();
            };

            t.Start();
        }
Example #2
0
        public CircleNormalBullet(World world, double x, double y, double x_vec, double y_vec, double radius) : base(world)
        {
            X = x;
            Y = y;

            this.x_vec  = x_vec;
            this.y_vec  = y_vec;
            this.radius = radius;

            Damage = ScoreManager.NormalBulletDamage;

            Sprite = new Engine.CircleSprite(new SolidColorBrush(Color.FromRgb(0, 255, 255)), radius);
        }