Exemple #1
0
        public static AnimatedBackground Create(string reference, int[] componentSequence)
        {
            AnimatedBackground bg = new AnimatedBackground(reference, new Point(Fixed_Width, Definitions.Back_Buffer_Height), 0);

            bg.ComponentSequence = componentSequence;
            bg.CreateComponents();

            return(bg);
        }
        private void FinalizeLevelSetup(XElement levelData)
        {
            string backgroundName = levelData.Element(Background_Data_Element).Attribute("texture").Value;
            int bgSeed = Profile.PlayingRaceMode ? RaceAreaName.Length : Profile.CurrentAreaData.LastSelectedLevel;

            AnimatedBackground inGameBackground = new AnimatedBackground(backgroundName, Map.MapWorldDimensions, bgSeed);
            inGameBackground.CreateComponents();

            _registerGameObject(inGameBackground);

            Map.ViewportDimensionsInTiles = new Point(
                (BackgroundDimensions.X / Definitions.Grid_Cell_Pixel_Size) + 1,
                (BackgroundDimensions.Y / Definitions.Grid_Cell_Pixel_Size) + 3);

            Map.WireUpBombBlockBlastColliders(_registerGameObject);

            _registerGameObject(Map);

            Player.Map = Map;
        }
 public void CreateBackgroundForScene(string reference, int[] componentSequence)
 {
     _animBackground = AnimatedBackground.Create(reference, componentSequence);
     RegisterGameObject(_animBackground);
 }
        public static AnimatedBackground Create(string reference, int[] componentSequence)
        {
            AnimatedBackground bg = new AnimatedBackground(reference, new Point(Fixed_Width, Definitions.Back_Buffer_Height), 0);
            bg.ComponentSequence = componentSequence;
            bg.CreateComponents();

            return bg;
        }