コード例 #1
0
ファイル: Chunk.cs プロジェクト: Shmaug/Voxel-Generator
        public Chunk(int x, int z, World wld)
        {
            X = x;
            Z = z;
            world = wld;
            blocks = new Block[CHUNK_SIZE, CHUNK_HEIGHT, CHUNK_SIZE];

            blockLight = new float[CHUNK_SIZE * CHUNK_HEIGHT * CHUNK_SIZE];
            skyLight = new float[CHUNK_SIZE * CHUNK_HEIGHT * CHUNK_SIZE];
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: Shmaug/Voxel-Generator
        internal void loadGame()
        {
            world = new World(5);
            world.sunRenderTarget = new RenderTarget2D(GraphicsDevice, Window.ClientBounds.Width, Window.ClientBounds.Height, false, GraphicsDevice.PresentationParameters.BackBufferFormat, GraphicsDevice.PresentationParameters.DepthStencilFormat);
            world.postfxRenderTarget1 = new RenderTarget2D(GraphicsDevice, Window.ClientBounds.Width, Window.ClientBounds.Height, false, GraphicsDevice.PresentationParameters.BackBufferFormat, GraphicsDevice.PresentationParameters.DepthStencilFormat);
            world.postfxRenderTarget2 = new RenderTarget2D(GraphicsDevice, Window.ClientBounds.Width, Window.ClientBounds.Height, false, GraphicsDevice.PresentationParameters.BackBufferFormat, GraphicsDevice.PresentationParameters.DepthStencilFormat);
            world.sceneRenderTarget = new RenderTarget2D(GraphicsDevice, Window.ClientBounds.Width, Window.ClientBounds.Height, false, GraphicsDevice.PresentationParameters.BackBufferFormat, GraphicsDevice.PresentationParameters.DepthStencilFormat);
            //world.depthRenderTarget = new RenderTarget2D(GraphicsDevice, 4096, 4096, false, SurfaceFormat.Single, DepthFormat.Depth24Stencil8);

            player = new Player(world);
            player.Position = new Vector3(0, Chunk.CHUNK_HEIGHT, 0);
            player.Camera = new Camera((float)graphics.PreferredBackBufferWidth / graphics.PreferredBackBufferHeight);

            Mouse.SetPosition(Window.ClientBounds.Center.X, Window.ClientBounds.Center.Y);
            IsMouseVisible = false;

            GameState = GameState.InGame;

            Screen.Screens["Main Menu"].Visible = false;
            Screen.Screens["Loading"].Visible = false;
        }
コード例 #3
0
ファイル: Player.cs プロジェクト: Shmaug/Voxel-Generator
 public Player(World world)
 {
     Width = .6f;
     Height = 1.8f;
     this.world = world;
 }