コード例 #1
0
        public BackgroundManager(
            Camera cameraInstance,
            AssetsLoader assetsLoader,
            InfartGame gameManagerReference)
        {
            CurrentCamera = cameraInstance;
            OldCameraXPos = CurrentCamera.Position.X;

            SfondoRectangle  = assetsLoader.TexturesRectangles["background"];
            TextureReference = assetsLoader.Textures;
            SfondoOrigin     = new Vector2(0.0f, SfondoRectangle.Height);
            SfondoScale      = Vector2.One;

            _grattacieliFondo = new GrattacieliAutogeneranti(
                assetsLoader.TexturesBuildingsBack, assetsLoader.TexturesRectangles, "back", 69, cameraInstance, gameManagerReference);

            SfondoScale = new Vector2(1.8f);

            _grattacieliMid = new GrattacieliAutogeneranti(
                assetsLoader.TexturesBuildingsMid, assetsLoader.TexturesRectangles, "mid", 69, cameraInstance, gameManagerReference);

            _parallaxSpeedFondo = DefaultParallaxSpeedFondo;
            _parallaxSpeedMid   = DefaultParallaxSpeedMid;

            List <Rectangle> tmp = new List <Rectangle>
            {
                assetsLoader.TexturesRectangles["nuvola1"],
                assetsLoader.TexturesRectangles["nuvola2"],
                assetsLoader.TexturesRectangles["nuvola3"]
            };

            _nuvolificioVicino = new Nuvolificio(
                Color.White, 0.6f, new Vector2(45, 60f),
                _nuvoleDefaultSpawnYRange, cameraInstance, tmp, assetsLoader.Textures);

            _nuvolificioMedio = new Nuvolificio(
                new Color(9, 50, 67), 0.4f, new Vector2(30f, 40f),
                _nuvoleDefaultSpawnYRange, cameraInstance, tmp, assetsLoader.Textures);

            _nuvolificioLontano = new Nuvolificio(
                new Color(5, 23, 40), 0.2f, new Vector2(10f, 20f),
                _nuvoleDefaultSpawnYRange, cameraInstance, tmp, assetsLoader.Textures);

            _starfield = new StarFieldParticleSystem(8, assetsLoader);

            CurrentCamera = cameraInstance;
            OldCameraXPos = CurrentCamera.Position.X;
        }
コード例 #2
0
        public GroundManager(
            Camera currentCamera,
            AssetsLoader assetsLoader,
            InfartGame gameManagerReference)
        {
            CurrentCamera = currentCamera;

            _grattacieliCamminabili = new GrattacieliAutogeneranti(
                assetsLoader.TexturesBuildingsGround,
                assetsLoader.TexturesRectangles,
                "ground",
                69,
                currentCamera,
                gameManagerReference);

            _gameManagerReference = gameManagerReference;
        }