public GameScene(GraphicsDevice graphicsDevice, ContentManager content, TileMap tileMap, Vector2 sceneryOffSet) { this.content = content; this.graphicsDevice = graphicsDevice; this.sceneryOffSet = sceneryOffSet; cameraManager = new CameraManager(); camera = new Camera(Vector2.Zero, new Vector2(this.Width, this.Height), new Vector2(50000, 50000)); this.tileMap = tileMap; this.tileMap.Camera = camera; actorManager = new ActorManager(); gateMapper = new ActorMapper(content, this.tileMap); actorManager.Reset(); player = new Actors.Player(actorManager, tileMap, camera, new Vector2(-100, -100), content.Load <Texture2D>(@"Textures/player"), 25.0f, 16, 16, 15, 15); chasingCamera = new ChasingCamera(player.location, camera, 2.0f); cameraManager.SetCameraScript(chasingCamera); IsCameraFree = false; this.weaponManager = new WeaponManager(); //cameraManager.AddCameraHandler(new Rotater(0.0f, MathHelper.PiOver2, 8)); cameraManager.AddCameraHandler(new Zoomer(1.0f, 1.0f, 0.5f, 0.01f)); UpdateRenderTarget(); this.sceneryOffSet = sceneryOffSet; PuzzleEngineAlpha.Resolution.ResolutionHandler.Changed += ResetSizes; this.tileMap.NewMap += NewMapHandling; particleManager = new ParticleManager(content, this.camera); }
public MenuHandler(ContentManager Content, GraphicsDevice graphicsDevice, MapHandlerScene mapHandler, PuzzleEngineAlpha.Level.TileMap tileMap, ResolutionHandler resolutionHandler, GameSceneDirector sceneDirector) { this.graphicsDevice = graphicsDevice; menuWindows = new Dictionary <string, IScene>(); menuWindows.Add("mainMenu", new MainMenu(Content, this, sceneDirector)); menuWindows.Add("loadMap", new LoadMapMenu(graphicsDevice, Content, this, mapHandler, tileMap)); menuWindows.Add("settings", new SettingsMenu(Content, this, resolutionHandler)); activeWindow = menuWindows["mainMenu"]; IsActive = false; currentState = new MenuStateEnum(); currentState = MenuStateEnum.Hidden; transition = new PuzzleEngineAlpha.Animations.SmoothTransition(0.0f, 0.011f, 0.0f, 1.0f); this.camera = new PuzzleEngineAlpha.Camera.Camera(Vector2.Zero, new Vector2(ResolutionHandler.WindowWidth, ResolutionHandler.WindowHeight), new Vector2(ResolutionHandler.WindowWidth, PuzzleEngineAlpha.Resolution.ResolutionHandler.WindowHeight)); camera.Zoom = transition.Value; ResolutionHandler.Changed += ResetSizes; }
public GameScene(GraphicsDevice graphicsDevice, ContentManager content, TileMap tileMap, Vector2 sceneryOffSet) { this.graphicsDevice = graphicsDevice; this.sceneryOffSet = sceneryOffSet; cameraManager = new CameraManager(); camera = new Camera(Vector2.Zero, new Vector2(this.Width, this.Height), new Vector2(50000, 50000)); this.tileMap = tileMap; this.tileMap.Camera = camera; player = new Actors.Player(tileMap, camera, new Vector2(-100, -100), content.Load <Texture2D>(@"Textures/player"), 350.0f, 16, 16, 16, 16); cameraManager.SetCameraScript(new ChasingCamera(player.location, camera, 6.0f)); cameraManager.AddCameraHandler(new Rotater(0.0f, MathHelper.PiOver2, 8)); cameraManager.AddCameraHandler(new Zoomer(1.0f, 1.0f, 0.5f, 0.01f)); UpdateRenderTarget(); this.sceneryOffSet = sceneryOffSet; PuzzleEngineAlpha.Resolution.ResolutionHandler.Changed += ResetSizes; this.tileMap.NewMap += NewMapHandling; }
void ResetSizes(object sender, EventArgs e) { this.camera = new Camera(Vector2.Zero, new Vector2(ResolutionHandler.WindowWidth, ResolutionHandler.WindowHeight), new Vector2(ResolutionHandler.WindowWidth, ResolutionHandler.WindowHeight)); camera.Zoom = transition.Value; }