Пример #1
0
        public void Draw(Scene scene)
        {
            Tentacules.Position = Image.Position;

            scene.Add(Image);
            scene.Add(Tentacules);
        }
Пример #2
0
        public void Draw(Scene scene, List<Enemy> enemies)
        {
            for (int i = 0; i < NbRows; i++)
                scene.Add(new VisualLine(SpaceUpperLeft + new Vector2(0, i * CellSize), new Vector2(Space.Right, Space.Top) + new Vector2(0, i * CellSize), Color.Azure));

            for (int i = 0; i < NbColumns; i++)
                scene.Add(new VisualLine(SpaceUpperLeft + new Vector2(i * CellSize, 0), new Vector2(Space.Left, Space.Bottom) + new Vector2(i * CellSize, 0), Color.Azure));

            for (int i = 0; i < NbRows; i++)
                for (int j = 0; j < NbColumns; j++)
                    for (int k = 0; k < Grid[i][j].Count; k++)
                    {
                        var enemyId = Grid[i][j][k];

                        if (enemyId >= enemies.Count)
                            continue;

                        Enemy objet = enemies[Grid[i][j][k]];

                        Rectangle r = objet.Rectangle.RectanglePrimitif;
                        r.X = (int) (SpaceUpperLeft.X + j * CellSize);
                        r.Y = (int) (SpaceUpperLeft.Y + i * CellSize);

                        scene.Add(new VisualRectangle(r, objet.Color, true));
                    }
        }
Пример #3
0
        public void Draw(Scene scene)
        {
            base.Draw();

            Aliens.Position =
            Bubble.Position =
            Deadly.Position =
            Eyes.Position =
            InvasionShips.Position =
            Lights.Position =
            Tentacles.Position = Image.Position;

            Aliens.Rotation =
            Bubble.Rotation =
            Deadly.Rotation =
            Eyes.Rotation =
            InvasionShips.Rotation =
            Lights.Rotation =
            Tentacles.Rotation = Image.Rotation;

            scene.Add(Aliens);
            scene.Add(Bubble);
            scene.Add(Deadly);
            scene.Add(Eyes);
            scene.Add(InvasionShips);
            scene.Add(Lights);
            scene.Add(Tentacles);

            foreach (var m in Missiles)
                m.Draw();
        }