Пример #1
0
 public void Draw(ScreenCanvas sc, int x, int y)
 {
     foreach (var asteroid in _asteroids)
     {
         asteroid.Draw(sc, x, y);
     }
 }
Пример #2
0
 public override void Draw(ScreenCanvas sc, int x, int y)
 {
     if (_size != AsteroidSize.Dne)
     {
         base.Draw(sc, x, y);
     }
 }
Пример #3
0
 public void Draw(ScreenCanvas sc, int x, int y)
 {
     foreach (var explosion in _explosions)
     {
         explosion.Draw(sc, x, y);
     }
 }
Пример #4
0
 public override void Draw(ScreenCanvas sc, int x, int y)
 {
     for (var i = 0; i < NumExpPoints; i++)
     {
         var point = new Point((int)((double)_points[i].X / 10000 * x), (int)((double)_points[i].Y / 7500 * y));
         sc.AddLine(point, new Point(point.X + 1, point.Y + 1), GetRandomFireColor());
     }
 }
Пример #5
0
        protected void DrawPolyToScreen(List <Point> alPoly, ScreenCanvas sc, int x, int y, Color penColor)
        {
            var pointArray = new Point[alPoly.Count];

            for (var i = 0; i < alPoly.Count; i++)
            {
                pointArray[i].X = (int)((double)(CurrentLocation.X + alPoly[i].X) / 10000 * x);
                pointArray[i].Y = (int)((double)(CurrentLocation.Y + alPoly[i].Y) / 7500 * y);
            }
            sc.AddPolygon(pointArray, penColor);
        }
Пример #6
0
        internal void Draw(ScreenCanvas sc, int width, int height)
        {
            if (_paused)
            {
                if (_iPauseTimer > 30)
                {
                    sc.AddText("PAUSE", Justify.Center, 2500, 200, 400, width, height);
                }
            }
            Ship.Draw(sc, width, height);

            foreach (var bullet in _shipBullets)
            {
                bullet.Draw(sc, width, height);
            }
            AsteroidBelt.Draw(sc, width, height);
            _explosions.Draw(sc, width, height);
            //score.Draw(sc, width, height);
        }
Пример #7
0
        public override void Draw(ScreenCanvas sc, int x, int y)
        {
            if (_state != ShipState.Alive)
            {
                return;
            }

            if (_thrustOn)
            {
                var a    = PointsTransformed[PointThrust1];
                var b    = PointsTransformed[PointThrust2];
                var num  = RndGen.Next(200) + 100;
                var list = new List <Point>(3)
                {
                    a,
                    b,
                    new Point((a.X + b.X) / 2 + (int)(num * Math.Sin(Radians)), (a.Y + b.Y) / 2 + (int)(-num * Math.Cos(Radians)))
                };

                DrawPolyToScreen(list, sc, x, y, GetRandomFireColor());
            }

            base.Draw(sc, x, y);
        }
Пример #8
0
 protected void Draw(ScreenCanvas sc, int x, int y, Color penColor)
 {
     DrawPolyToScreen(PointsTransformed, sc, x, y, penColor);
 }
Пример #9
0
 public virtual void Draw(ScreenCanvas sc, int x, int y)
 {
     DrawPolyToScreen(PointsTransformed, sc, x, y, Color.White);
 }