public Guard(GameState gameState, LevelInfo levelInfo, ModelLoader modelLoader, Path path, int uid, ProjectileManager proj) : base(gameState, levelInfo, modelLoader.getModel3D(modelType.Tank), path, uid, SPEED, RADIUS, FULL_HEALTH, WATER_CAPACITY, 0, 0) { attackRadiusTool = new LineTool(gameState.getGraphics()); attackRadiusTool.setColor(Color.Green.ToVector3()); attackTarget = null; projectiles = proj; }
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); }