Example #1
0
        private static void DrawTroll(int x, int y, Bitmap bmp, Graphics g, Trolleybus troll)
        {
            using (g = Graphics.FromImage(bmp))
            {
                g.DrawLine(Pens.Gray, 0, y + 48, 850, y + 48);

                g.FillRectangle(Brushes.Yellow, x, y, 120, 40);
                g.FillEllipse(Brushes.Black, x + 20, y + 32, 16, 16);
                g.FillEllipse(Brushes.Black, x + 80, y + 32, 16, 16);

                if (troll.Rods)
                {
                    g.DrawLine(Pens.Black, x + 100, y, x, y - 20);
                }
                else
                {
                    g.DrawLine(Pens.Black, x + 100, y, x, y - 3);
                }

                if (!troll.Engine)
                {
                    g.DrawLine(Pens.Gray, x + 120, y + 25, x + 135, y + 10);
                    g.DrawLine(Pens.Gray, x + 120, y + 25, x + 135, y + 15);
                    g.DrawLine(Pens.Gray, x + 120, y + 25, x + 135, y + 26);
                    g.DrawLine(Pens.Gray, x + 120, y + 25, x + 135, y + 30);
                    g.DrawLine(Pens.Gray, x + 120, y + 25, x + 135, y + 35);
                }
            }
        }
Example #2
0
        public Scene(int ws, int num)
        {
            this.ws = ws;

            trolleybus            = new Trolleybus(0, 20 * num, 7);
            service               = new Service(0, 20 * num, 7);
            driver.TrolleybusSet  = trolleybus;
            service.TrolleybusSet = trolleybus;
        }
Example #3
0
        public Scene(int ws)
        {
            this.ws = ws;

            trolleybus1 = new Trolleybus(0, 20 * 1, 7);
            trolleybus2 = new Trolleybus(0, 20 * 5, 7);
            trolleybus3 = new Trolleybus(0, 20 * 10, 7);
            trolleybus4 = new Trolleybus(0, 20 * 15, 7);

            service = new Service(0, 0, 15);

            driver1.TrolleybusSet = trolleybus1;
            driver2.TrolleybusSet = trolleybus2;
            driver3.TrolleybusSet = trolleybus3;
            driver4.TrolleybusSet = trolleybus4;
        }