Пример #1
0
        //Constructor
        public Chunk(int x,int z, WorldManager gamein,GameStateManager man)
        {
            //Needed cause of the buffer copy
            _gameman = man;
            _world = gamein;

            PosX = x;
            PosZ = z;

            BlockMap = new BaseBlock[Size,Height,Size];

            //Load our effect
            _effect = _gameman.Conmanager.Load<Effect>("Effects/DefaultEffect");

            //Load our terrain
            //Check if the user want to use custom textures
            if (_world.Customtexturepath != "")
            {
                Terrain = TextureFromFile(_world.Customtexturepath);
            }
            else
            {
                Terrain = _gameman.Conmanager.Load<Texture2D>("Textures/terrain");
            }

            //Set unchanging effect parameters (Fog and a constant value used for lighting)
            _effect.Parameters["FogEnabled"].SetValue(true);
            _effect.Parameters["FogStart"].SetValue(256);
            _effect.Parameters["FogEnd"].SetValue(512);
            _effect.Parameters["FogColor"].SetValue(Color.SkyBlue.ToVector4());
            _effect.Parameters["WorldInverseTranspose"].SetValue(Matrix.Transpose(Matrix.Invert(Matrix.Identity)));
        }
Пример #2
0
 public PropertyBag(MineWorldClient gamein,GameStateManager gameManagerin)
 {
     Game = gamein;
     GameManager = gameManagerin;
     NetPeerConfiguration netconfig = new NetPeerConfiguration("MineWorld");
     netconfig.EnableMessageType(NetIncomingMessageType.DiscoveryResponse);
     Client = new NetClient(netconfig);
     Client.Start();
     Player = new Player(this);
     WorldManager = new WorldManager(GameManager, Player);
     ClientListener = new ClientListener(Client, this);
     ClientSender = new ClientSender(Client, this);
     Debugger = new Debug(this);
 }
Пример #3
0
 public BlockRemover(Player player, WorldManager manager)
 {
     Worldmanager = manager;
     Player = player;
 }
Пример #4
0
 public Stacker(Player player, WorldManager manager)
 {
     Worldmanager = manager;
     Player = player;
 }