示例#1
0
        public SKraft()
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth = 1440;
            graphics.PreferredBackBufferHeight = 900;
            graphics.ApplyChanges();
            Content.RootDirectory = "Content";
            Graphics = GraphicsDevice;

            Vector3 playerPos = new Vector3(1, 1, 1);
            Map = new Map(playerPos);
            player = new Player(this, playerPos, Map);
            Components.Add(new Debug(this));
        }
示例#2
0
        private Vector3 targetRemember = new Vector3(); //zapamietuje obrot, aby updetowac mape

        #endregion Fields

        #region Constructors

        public Player(SKraft game, Vector3 position, Map map)
        {
            this.Position = position;
            this.game = game;
            this.map = map;
            fppCamera = new FppCamera(game, new Vector3(position.X, position.Y + 1, position.Z), Vector3.Zero, Vector3.Up);
            Position = new Vector3(Position.X, 0, Position.Z);

            mousePos = new Vector2(Mouse.GetState().X, Mouse.GetState().Y);
            Speed = 0.1f;
            MouseSpeed = 10;

            game.Components.Add(fppCamera);
        }