Example #1
0
 public HostWaitState(IStateManager manager, DroughtGame game)
     : base(manager, game)
 {
     stateManager = manager;
     networkManager = game.getNetworkManager();
     loadContent();
 }
Example #2
0
 /**
  * Constructs a new <code>GameState</code> being managed by
  * the specified <code>StateManager</code> class.
  *
  * @param manager The state manager to manage this state.
  * @param game XNA's game class to get accesses to
  *      resource managers and devices.
  */
 public GameState(IStateManager manager, DroughtGame game)
 {
     this.game = game;
     stateManager = manager;
     this.content = new ContentManager(game.Services);
     this.content.RootDirectory = "Content";
     this.graphics = game.getGraphics();
     this.spriteBatch = game.getSpriteBatch();
 }
Example #3
0
 public MenuState(IStateManager manager, DroughtGame game, int width, int height)
     : base(manager, game)
 {
     screenWidth = width;
     screenHeight = height;
     loadContent();
     initialise();
     networkManager = game.getNetworkManager();
 }
Example #4
0
        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);
        }
Example #5
0
 public TitleState(IStateManager manager, DroughtGame game, Level aLevel)
     : base(manager, game, aLevel)
 {
 }
Example #6
0
 public SignInState(IStateManager manager, DroughtGame game, bool wait)
     : base(manager, game)
 {
     waited = wait ? 0 : 10;
 }
Example #7
0
        public LevelState(IStateManager manager, DroughtGame game, Level aLevel)
            : base(manager, game)
        {
            /* TEMP */
            explosionParticles = new ExplosionParticleSystem(getContentManager(), getGraphics());
            explosionSmokeParticles = new ExplosionSmokeParticleSystem(getContentManager(), getGraphics());
            projectileTrailParticles = new ProjectileTrailParticleSystem(getContentManager(), getGraphics());
            smokePlumeParticles = new SmokePlumeParticleSystem(getContentManager(), getGraphics());
            fireParticles = new FireParticleSystem(getContentManager(), getGraphics());
            projectileManager = new ProjectileManager(explosionParticles, explosionSmokeParticles, projectileTrailParticles);

            soundManager = game.getSoundManager();

            input = DeviceInput.getInput();

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

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

            TextureMap textureMap = new TextureMap(aLevel);
            //List<List<Vector3>> waterList = Water.findWater(levelInfo);
            List<List<Vector3>> waterListPleh = textureMap.findWater();
            //waters = new Water[waterList.Count];
            waters = new Water[waterListPleh.Count];

            Water[,] waterLocationTable = new Water[levelInfo.getWidth(), levelInfo.getHeight()];
            for (int i = 0; i < waters.Length; i++)
            {
                //waters[i] = new Water(waterList[i], levelInfo, getGraphics());
                waters[i] = new Water(waterListPleh[i], levelInfo, sun, getGraphics());

                for (int j = 0; j < waterListPleh[i].Count; j++)
                {
                    Vector3 p = waterListPleh[i][j];
                    waterLocationTable[(int)p.X, (int)p.Y] = waters[i];
                }
            }
            levelInfo.setWaterPools(waterLocationTable);

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

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

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

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

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

            lineTool = new LineTool(getGraphics());

            aStar = new AStar(levelInfo);

            soundManager.setListener(camera);

            loadContent();

            initializeEntities();

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