Пример #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 ErrorState(GameStateManager manager, GameState associatedState)
     : base(manager, associatedState)
 {
     _gamemanager = manager;
 }
Пример #4
0
 public MainMenuState(GameStateManager manager, GameState associatedState)
     : base(manager, associatedState)
 {
     _gamemanager = manager;
 }
Пример #5
0
 public SettingsState(GameStateManager manager, GameState associatedState)
     : base(manager, associatedState)
 {
     _gamemanager = manager;
 }
Пример #6
0
 public WorldManager(GameStateManager manager,Player player)
 {
     _gamemanager = manager;
     Player = player;
 }
Пример #7
0
 public LoadingState(GameStateManager manager, GameState associatedState)
     : base(manager, associatedState)
 {
     _gamemanager = manager;
 }
Пример #8
0
 protected override void Initialize()
 {
     _gameStateManager = new GameStateManager(_graphics, Content, this);
     base.Initialize();
 }
Пример #9
0
 protected BaseState(GameStateManager manager, GameStateManagers.GameState associatedState)
 {
     Manager = manager;
     AssociatedState = associatedState;
 }
Пример #10
0
 public ServerBrowsingState(GameStateManager manager, GameState associatedState)
     : base(manager, associatedState)
 {
     _gamemanager = manager;
 }