Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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;
        }