コード例 #1
0
ファイル: HostWaitState.cs プロジェクト: kiniry-teaching/UCD
 public HostWaitState(IStateManager manager, DroughtGame game)
     : base(manager, game)
 {
     stateManager = manager;
     networkManager = game.getNetworkManager();
     loadContent();
 }
コード例 #2
0
ファイル: MenuState.cs プロジェクト: kiniry-teaching/UCD
 public MenuState(IStateManager manager, DroughtGame game, int width, int height)
     : base(manager, game)
 {
     screenWidth = width;
     screenHeight = height;
     loadContent();
     initialise();
     networkManager = game.getNetworkManager();
 }
コード例 #3
0
ファイル: DroughtGame.cs プロジェクト: kiniry-teaching/UCD
 public DroughtGame()
 {
     graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
     IsMouseVisible = true;
     if (NETWORKED) Components.Add(new GamerServicesComponent(this));
     gameManager = new GameManager(this);
     soundManager = SoundManager.getInstance();
     networkManager = NetworkManager.getInstance();
 }
コード例 #4
0
ファイル: NetLevelState.cs プロジェクト: kiniry-teaching/UCD
        public NetLevelState(IStateManager manager, DroughtGame game, Level aLevel, bool isHost)
            : base(manager, game)
        {
            soundManager = game.getSoundManager();
            networkManager = game.getNetworkManager();
            hosting = isHost;

            input = DeviceInput.getInput();

            sun = new Sun(new Vector3(0, -200, 200));

            levelInfo = new LevelInfo();
            levelInfo.initialise(aLevel);

            List<List<Vector3>> waterList = Water.findWater(levelInfo);
            waters = new Water[waterList.Count];

            for (int i = 0; i < waters.Length; i++)
                waters[i] = new Water(waterList[i], levelInfo, sun, getGraphics());

            aStar = new AStar(levelInfo);

            rain = new PlaneParticleEmitter(512, 256, new Vector3(256, 128, 200), new Vector3(0, 0, 0), new Vector3(3f, 0, -19f), Color.LightBlue.ToVector4(), 100000, 9);

            camera = new Camera(this, levelInfo, false);

            terrain = new Terrain(getGraphics(), getContentManager(), levelInfo, camera);

            soundManager.setListener(camera);

            modelLoader = new ModelLoader(getContentManager(), getGraphics());

            skybox = new Skybox(camera, sun, modelLoader.getModel3D(modelType.Skybox));

            lineTool = new LineTool(getGraphics());

            loadContent();

            initializeEntities();

            foreach (MovableEntity entity in localEntities)
                soundManager.playSound(SoundHandle.Truck, entity);
        }