Пример #1
0
        public Stairs(Vector3 position, bool westEast, bool shapeL) : base(position)
        {
            Position = position;

            var original = new CubeGraphic { Position = position, DrawFaces = CubeFaces.All ^ CubeFaces.Front ^ CubeFaces.Floor };
            var nextFloor = new CubeGraphic { Position = original.Position + Vector3.Down, DrawFaces = CubeFaces.Sides ^ CubeFaces.Front };
            var stairs = new ModelGraphic { Position = nextFloor.Position };

            original.Texture = nextFloor.Texture = nextFloor.Resources.Content.Load<Texture2D>("Textures/Wall");

            if (shapeL)
            {
                stairs.Model = stairs.Resources.Content.Load<Model>("Models/stairs1");

                if (westEast)
                    nextFloor.DrawFaces ^= CubeFaces.Right;
                else
                    nextFloor.DrawFaces ^= CubeFaces.Left;
            }
            else
            {
                stairs.Model = stairs.Resources.Content.Load<Model>("Models/stairs");
                nextFloor.DrawFaces ^= CubeFaces.Back;
            }

            if (westEast)
            {
                original.Rotation = nextFloor.Rotation = new Vector3(0, MathHelper.PiOver2, 0);
                stairs.Rotation = new Vector3(0, MathHelper.PiOver2, 0);
                stairs.MirrorX = true;
            }

            graphics = new GraphicsCollection(original, nextFloor, stairs);
            graphicsProviders.SubProviders.Add(graphics);
        }
Пример #2
0
        public Floor(Vector3 position):base(position)
        {
            Position = position;
            wallGraphic = new CubeGraphic { Position = position };
            wallGraphic.Texture = wallGraphic.Resources.Content.Load<Texture2D>("Textures/Wall");

            graphicsProviders.SubProviders.Add(wallGraphic);
        }
Пример #3
0
 protected Item() 
 {
     Graphics = new CubeGraphic
     {
         Scale = new Vector3(0.25f),
         DrawFaces = CubeFaces.All ^ CubeFaces.Floor,
         Outter = true
     };
 }
Пример #4
0
        public Pit(Vector3 position) : base(position)
        {
            wallGraphic.DrawFaces = CubeFaces.None;
            var pitGraphic = new CubeGraphic { Position = position - Vector3.Up, DrawFaces = CubeFaces.Sides };
            pitGraphic.Resources.Content.Load<Texture2D>("Textures/Wall");

            graphics = new GraphicsCollection(wallGraphic, pitGraphic);
            graphicsProviders.SubProviders.Add(graphics);
            base.ContentActivated = true;
        }
Пример #5
0
        public TextTag(Vector3 position, bool visible, bool isWestEast, string text) : base(position)
        {
            Text = text;
            Visible = visible;


            Graphics = new CubeGraphic
            {
                Position = Position,
                Outter =  true,
                Texture = ResourceProvider.Instance.DrawRenderTarget(Text, Color.Black, Color.White),
                Scale = new Vector3(0.3f, 0.3f, 0.1f),
                Rotation = isWestEast ? new Vector3(0, MathHelper.PiOver2, 0) : Vector3.Zero
            };
            

        }
Пример #6
0
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            InitializeEffect();
            myModel = Content.Load<Model>("Models/stairs1");
            myModel1 = Content.Load<Model>("Models/stairs");
            texture = Content.Load<Texture2D>("Textures/wall");
            aspectRatio = (float)graphics.GraphicsDevice.Viewport.Width /
            (float)graphics.GraphicsDevice.Viewport.Height;

            ResourceProvider.Instance.Initialize(GraphicsDevice, Content);
            c = new CubeGraphic { Texture = texture, DrawFaces = CubeFaces.Back, Position = Vector3.Zero, Scale = new Vector3(1) };

            f = new FreeLookCamera(this);
            f.Position = new Vector3(0, 0, 5);
            f.ForwardDirection = -Vector3.UnitZ;
            Components.Add(f);
        }
Пример #7
0
 public Door(Vector3 position, bool hasButton) 
 {
     HasButton = hasButton;
     Graphics = new CubeGraphic { DrawFaces = CubeFaces.All, Outter = true, Scale = new Vector3(0.66f, 0.65f, 0.15f) };
 }