Ejemplo n.º 1
0
        public void Draw()
        {
            switch (_type)
            {
            case DoorTypes.old:
                Game1.SpriteBatchGlobal.Draw(Game1.doorRack, position: Position - new Vector2(0, 128), scale: new Vector2(2));
                _door.Draw(Game1.door);
                break;

            case DoorTypes.basic:
                _door.Draw(Game1.Textures["DoorBase"]);
                break;
            }
        }
Ejemplo n.º 2
0
        public void Draw()
        {
            Game1.SpriteBatchGlobal.Draw(Game1.Textures["ElevatorClawBack"], _platform.Origin, origin: new Vector2(18 * 2), rotation: _platform.Velocity.ToAngle());


            Game1.SpriteBatchGlobal.Draw(Game1.liftRail, position: Start, sourceRectangle: new Rectangle(0, 0, (int)LineSegmentF.Lenght(Start, Nodes[0]), 14 * 2), origin: new Vector2(0, 7 * 2), rotation: new LineSegmentF(Start, Nodes[0]).ToAngle());

            if (Nodes.Count > 1)
            {
                for (int i = 0; i < Nodes.Count - 1; i++)
                {
                    Game1.SpriteBatchGlobal.Draw(Game1.liftRail, position: Nodes[i], sourceRectangle: new Rectangle(0, 0, (int)LineSegmentF.Lenght(Nodes[i], Nodes[i + 1]), 14 * 2), origin: new Vector2(0, 7 * 2), rotation: new LineSegmentF(Nodes[i], Nodes[i + 1]).ToAngle());
                }
            }

            if (Nodes.Count > 2)
            {
                Game1.SpriteBatchGlobal.Draw(Game1.liftRail, position: Nodes[Nodes.Count - 1], sourceRectangle: new Rectangle(0, 0, (int)LineSegmentF.Lenght(Nodes[Nodes.Count - 1], Start), 14 * 2), origin: new Vector2(0, 7 * 2), rotation: new LineSegmentF(Nodes[Nodes.Count - 1], Start).ToAngle());
            }

            Game1.SpriteBatchGlobal.Draw(Game1.liftEnd, position: Start, origin: new Vector2(11 * 2));

            foreach (Vector2 node in Nodes)
            {
                Game1.SpriteBatchGlobal.Draw(Game1.liftEnd, position: node, origin: new Vector2(11 * 2));
            }

            Game1.SpriteBatchGlobal.Draw(Game1.Textures["ElevatorClaw"], _platform.Origin, origin: new Vector2(18 * 2), rotation: _platform.Velocity.ToAngle());
            _platform.Draw(Game1.platformTex);
        }