Ejemplo n.º 1
0
        /// <summary>
        /// Fully removes the LayeredTileMap from the engine, including the rendering and collision.
        /// </summary>
        public void Destroy()
        {
            // Make it one-way because we want the
            // contained objects to persist after a destroy
            mMapLists.MakeOneWay();

            for (int i = 0; i < mMapLists.Count; i++)
            {
                SpriteManager.RemoveDrawableBatch(mMapLists[i]);
            }

            for (int i = 0; i < this.Collisions.Count; i++)
            {
                this.Collisions[i].RemoveFromManagers();
            }

            for (int i = 0; i < this.ShapeCollections.Count; i++)
            {
                this.ShapeCollections[i].RemoveFromManagers();
            }

            SpriteManager.RemovePositionedObject(this);

            mMapLists.MakeTwoWay();
        }
        public override void Destroy()
        {
            base.Destroy();

            RectsList.MakeOneWay();
            RectsListUnused.MakeOneWay();
            for (int i = RectsList.Count - 1; i > -1; i--)
            {
                FlatRedBall.Math.Geometry.ShapeManager.Remove(RectsList[i]);
            }
            for (int i = RectsListUnused.Count - 1; i > -1; i--)
            {
                FlatRedBall.Math.Geometry.ShapeManager.Remove(RectsListUnused[i]);
            }
            if (ArrowsInstance != null)
            {
                ArrowsInstance.Destroy();
                ArrowsInstance.Detach();
            }
            if (RectLeftCenter != null)
            {
                FlatRedBall.Math.Geometry.ShapeManager.Remove(RectLeftCenter);
            }
            if (RectRightCenter != null)
            {
                FlatRedBall.Math.Geometry.ShapeManager.Remove(RectRightCenter);
            }
            RectsList.MakeTwoWay();
            RectsListUnused.MakeTwoWay();
            FlatRedBall.Math.Collision.CollisionManager.Self.Relationships.Clear();
            CustomDestroy();
        }
Ejemplo n.º 3
0
        public virtual void Destroy()
        {
            FlatRedBall.SpriteManager.RemovePositionedObject(this);

            CannonballList.MakeOneWay();
            if (BoatSpriteInstance != null)
            {
                FlatRedBall.SpriteManager.RemoveSprite(BoatSpriteInstance);
            }
            if (Hitbox != null)
            {
                FlatRedBall.Math.Geometry.ShapeManager.Remove(Hitbox);
            }
            if (AnchorSpriteInstance != null)
            {
                FlatRedBall.SpriteManager.RemoveSprite(AnchorSpriteInstance);
            }
            for (int i = CannonballList.Count - 1; i > -1; i--)
            {
                CannonballList[i].Destroy();
            }
            CannonballList.MakeTwoWay();
            mGeneratedCollision.RemoveFromManagers(clearThis: false);
            CustomDestroy();
        }
Ejemplo n.º 4
0
        public override void Destroy()
        {
            FlatRedBall.SpriteManager.RemoveDrawableBatch(gumIdb);
            base.Destroy();
            Factories.PlayerFactory.Destroy();
            Factories.DoorFactory.Destroy();

            PlayerList.MakeOneWay();
            DoorList.MakeOneWay();
            if (SolidCollisions != null)
            {
                SolidCollisions.Visible = false;
            }
            for (int i = PlayerList.Count - 1; i > -1; i--)
            {
                PlayerList[i].Destroy();
            }
            for (int i = DoorList.Count - 1; i > -1; i--)
            {
                DoorList[i].Destroy();
            }
            PlayerList.MakeTwoWay();
            DoorList.MakeTwoWay();
            FlatRedBall.Math.Collision.CollisionManager.Self.Relationships.Clear();
            CustomDestroy();
        }
Ejemplo n.º 5
0
        public override void Destroy()
        {
            base.Destroy();
            BulletFactory.Destroy();
            EnemyFactory.Destroy();

            BulletList.MakeOneWay();
            EnemyList.MakeOneWay();
            if (BackgroundInstance != null)
            {
                BackgroundInstance.Destroy();
                BackgroundInstance.Detach();
            }
            if (PlayerInstance != null)
            {
                PlayerInstance.Destroy();
                PlayerInstance.Detach();
            }
            for (int i = BulletList.Count - 1; i > -1; i--)
            {
                BulletList[i].Destroy();
            }
            for (int i = EnemyList.Count - 1; i > -1; i--)
            {
                EnemyList[i].Destroy();
            }
            if (ScoreboardInstance != null)
            {
                ScoreboardInstance.Destroy();
                ScoreboardInstance.Detach();
            }
            BulletList.MakeTwoWay();
            EnemyList.MakeTwoWay();
            CustomDestroy();
        }
Ejemplo n.º 6
0
        public virtual void Destroy()
        {
            FlatRedBall.SpriteManager.RemovePositionedObject(this);

            HealthBarList.MakeOneWay();
            for (int i = HealthBarList.Count - 1; i > -1; i--)
            {
                HealthBarList[i].Destroy();
            }
            HealthBarList.MakeTwoWay();
            CustomDestroy();
        }
Ejemplo n.º 7
0
        public void Destroy()
        {
            // Make it one-way because we want the
            // contained objects to persist after a destroy
            mMapLists.MakeOneWay();

            for (int i = 0; i < mMapLists.Count; i++)
            {
                SpriteManager.RemoveDrawableBatch(mMapLists[i]);
            }

            mMapLists.MakeTwoWay();
        }
Ejemplo n.º 8
0
        public override void Destroy()
        {
            base.Destroy();
            Factories.BulletFactory.Destroy();
            Factories.RockFactory.Destroy();

            BulletList.MakeOneWay();
            RockList.MakeOneWay();
            MainShipList.MakeOneWay();
            for (int i = BulletList.Count - 1; i > -1; i--)
            {
                BulletList[i].Destroy();
            }
            for (int i = RockList.Count - 1; i > -1; i--)
            {
                RockList[i].Destroy();
            }
            for (int i = MainShipList.Count - 1; i > -1; i--)
            {
                MainShipList[i].Destroy();
            }
            if (EndGameUIInstance != null)
            {
                EndGameUIInstance.Destroy();
                EndGameUIInstance.Detach();
            }
            if (HudInstance != null)
            {
                HudInstance.Destroy();
                HudInstance.Detach();
            }
            if (MainShipInstance != null)
            {
                MainShipInstance.Destroy();
                MainShipInstance.Detach();
            }
            if (RockSpawnerInstance != null)
            {
                RockSpawnerInstance.Destroy();
                RockSpawnerInstance.Detach();
            }
            BulletList.MakeTwoWay();
            RockList.MakeTwoWay();
            MainShipList.MakeTwoWay();
            FlatRedBall.Math.Collision.CollisionManager.Self.Relationships.Clear();
            CustomDestroy();
        }
Ejemplo n.º 9
0
        public override void Destroy()
        {
            base.Destroy();

            BulletList.MakeOneWay();
            for (int i = BulletList.Count - 1; i > -1; i--)
            {
                BulletList[i].Destroy();
            }
            if (PlayerInstance != null)
            {
                PlayerInstance.Destroy();
                PlayerInstance.Detach();
            }
            BulletList.MakeTwoWay();
            FlatRedBall.Math.Collision.CollisionManager.Self.Relationships.Clear();
            Parme.Frb.ParmeEmitterManager.Instance.DestroyActiveEmitterGroups();
            CustomDestroy();
        }
Ejemplo n.º 10
0
        public override void Destroy()
        {
            base.Destroy();
            HealthPointFactory.Destroy();
            PlatformerLevel1.Destroy();
            PlatformerLevel1 = null;

            PositionedObjectListInstance.MakeOneWay();
            if (PlayerInstance != null)
            {
                PlayerInstance.Destroy();
                PlayerInstance.Detach();
            }
            for (int i = PositionedObjectListInstance.Count - 1; i > -1; i--)
            {
                PositionedObjectListInstance[i].Destroy();
            }
            PositionedObjectListInstance.MakeTwoWay();
            CustomDestroy();
        }
Ejemplo n.º 11
0
        public override void Destroy()
        {
            base.Destroy();
            Factories.TankFactory.Destroy();
            Factories.BulletFactory.Destroy();
            Factories.TreadEffectFactory.Destroy();
            TestLevel.Destroy();
            TestLevel = null;
            FlatRedBall.SpriteManager.RemoveDrawableBatch(GameScreenGum); FlatRedBall.FlatRedBallServices.GraphicsOptions.SizeOrOrientationChanged -= GameScreenGum.HandleResolutionChanged;
            GameScreenGum = null;

            TankList.MakeOneWay();
            BulletList.MakeOneWay();
            TreadEffects.MakeOneWay();
            for (int i = TankList.Count - 1; i > -1; i--)
            {
                TankList[i].Destroy();
            }
            for (int i = BulletList.Count - 1; i > -1; i--)
            {
                BulletList[i].Destroy();
            }
            if (CameraEntityInstance != null)
            {
                CameraEntityInstance.Destroy();
                CameraEntityInstance.Detach();
            }
            for (int i = TreadEffects.Count - 1; i > -1; i--)
            {
                TreadEffects[i].Destroy();
            }
            if (PlayerSelectionUIInstance != null)
            {
                PlayerSelectionUIInstance.RemoveFromManagers();
            }
            TankList.MakeTwoWay();
            BulletList.MakeTwoWay();
            TreadEffects.MakeTwoWay();
            FlatRedBall.Math.Collision.CollisionManager.Self.Relationships.Clear();
            CustomDestroy();
        }
Ejemplo n.º 12
0
        public override void Destroy()
        {
            base.Destroy();

            RectsList.MakeOneWay();
            if (CenterH != null)
            {
                FlatRedBall.Math.Geometry.ShapeManager.Remove(CenterH);
            }
            if (CenterV != null)
            {
                FlatRedBall.Math.Geometry.ShapeManager.Remove(CenterV);
            }
            for (int i = RectsList.Count - 1; i > -1; i--)
            {
                FlatRedBall.Math.Geometry.ShapeManager.Remove(RectsList[i]);
            }
            RectsList.MakeTwoWay();
            FlatRedBall.Math.Collision.CollisionManager.Self.Relationships.Clear();
            CustomDestroy();
        }
Ejemplo n.º 13
0
        public override void Destroy()
        {
            base.Destroy();
            Factories.BallFactory.Destroy();
            Tiles     = null;
            excellent = null;

            BallList.MakeOneWay();
            if (SolidCollision != null)
            {
                SolidCollision.Visible = false;
            }
            if (PlayerInstance != null)
            {
                PlayerInstance.Destroy();
                PlayerInstance.Detach();
            }
            for (int i = BallList.Count - 1; i > -1; i--)
            {
                BallList[i].Destroy();
            }
            if (GoalCollision != null)
            {
                GoalCollision.Visible = false;
            }
            if (GoalDisplay != null)
            {
                FlatRedBall.SpriteManager.RemoveSprite(GoalDisplay);
            }
            if (UpSpringCollision != null)
            {
                UpSpringCollision.Visible = false;
            }
            BallList.MakeTwoWay();
            FlatRedBall.Math.Collision.CollisionManager.Self.Relationships.Clear();
            CustomDestroy();
        }
Ejemplo n.º 14
0
        public override void Destroy()
        {
            base.Destroy();
            Factories.BulletFactory.Destroy();
            FlatRedBall.SpriteManager.RemoveDrawableBatch(SpaceInvadersGum); FlatRedBall.FlatRedBallServices.GraphicsOptions.SizeOrOrientationChanged -= SpaceInvadersGum.HandleResolutionChanged;
            SpaceInvadersGum = null;

            BulletList.MakeOneWay();
            AlienList.MakeOneWay();
            if (PlayerShipInstance != null)
            {
                PlayerShipInstance.Destroy();
                PlayerShipInstance.Detach();
            }
            for (int i = BulletList.Count - 1; i > -1; i--)
            {
                BulletList[i].Destroy();
            }
            for (int i = AlienList.Count - 1; i > -1; i--)
            {
                AlienList[i].Destroy();
            }
            if (RightGuardRail != null)
            {
                RightGuardRail.Destroy();
                RightGuardRail.Detach();
            }
            if (LeftGuardRail != null)
            {
                LeftGuardRail.Destroy();
                LeftGuardRail.Detach();
            }
            BulletList.MakeTwoWay();
            AlienList.MakeTwoWay();
            FlatRedBall.Math.Collision.CollisionManager.Self.Relationships.Clear();
            CustomDestroy();
        }
        public override void Destroy()
        {
            base.Destroy();
            Factories.BombardingTowerFactory.Destroy();
            Factories.ChemicalTowerFactory.Destroy();
            Factories.ElectricTowerFactory.Destroy();
            Factories.FireTowerFactory.Destroy();
            Factories.FrostTowerFactory.Destroy();
            Factories.PiercingTowerFactory.Destroy();
            Factories.CannonProjectileFactory.Destroy();
            Factories.ChemicalProjectileFactory.Destroy();
            Factories.ElectricProjectileFactory.Destroy();
            Factories.FireProjectileFactory.Destroy();
            Factories.FrostProjectileFactory.Destroy();
            Factories.PiercingProjectileFactory.Destroy();
            worldmap = null;
            FlatRedBall.SpriteManager.RemoveDrawableBatch(MapScreenGum); FlatRedBall.FlatRedBallServices.GraphicsOptions.SizeOrOrientationChanged -= MapScreenGum.HandleResolutionChanged;
            MapScreenGum       = null;
            Messages           = null;
            StructureSelection = null;

            StructureList.MakeOneWay();
            ProjectileList.MakeOneWay();
            if (MapScreenGumInstance != null)
            {
                MapScreenGumInstance.RemoveFromManagers();
            }
            if (MenuWindowInstance != null)
            {
                MenuWindowInstance.RemoveFromManagers();
            }
            if (ChatHistoryInstance != null)
            {
                ChatHistoryInstance.RemoveFromManagers();
            }
            if (TowerSelectionBoxInstance != null)
            {
                TowerSelectionBoxInstance.RemoveFromManagers();
            }
            for (int i = StructureList.Count - 1; i > -1; i--)
            {
                StructureList[i].Destroy();
            }
            if (StructureLayer != null)
            {
                FlatRedBall.SpriteManager.RemoveLayer(StructureLayer);
            }
            for (int i = ProjectileList.Count - 1; i > -1; i--)
            {
                ProjectileList[i].Destroy();
            }
            if (OkMessageInstance != null)
            {
                OkMessageInstance.RemoveFromManagers();
            }
            if (ConfirmationWindowInstance != null)
            {
                ConfirmationWindowInstance.RemoveFromManagers();
            }
            if (HUDLayer != null)
            {
                FlatRedBall.SpriteManager.RemoveLayer(HUDLayer);
            }
            if (CurrentMusicDisplayInstance != null)
            {
                CurrentMusicDisplayInstance.RemoveFromManagers();
            }
            StructureList.MakeTwoWay();
            ProjectileList.MakeTwoWay();
            FlatRedBall.Math.Collision.CollisionManager.Self.Relationships.Clear();
            CustomDestroy();
        }
Ejemplo n.º 16
0
        public override void Destroy()
        {
            base.Destroy();
            Factories.DockFactory.Destroy();
            Factories.CannonballFactory.Destroy();
            Factories.ExplosionFactory.Destroy();
            Factories.BulletFactory.Destroy();
            Factories.SkeletonFactory.Destroy();
            Terrain.Destroy();
            Terrain = null;
            GameScreenGum.RemoveFromManagers();
            GameScreenGum = null;

            BoatList.MakeOneWay();
            DockList.MakeOneWay();
            CannonballList.MakeOneWay();
            ExplosionList.MakeOneWay();
            BulletList.MakeOneWay();
            EnemyList.MakeOneWay();
            if (PlayerBoat != null)
            {
                PlayerBoat.Destroy();
                PlayerBoat.Detach();
            }
            for (int i = BoatList.Count - 1; i > -1; i--)
            {
                BoatList[i].Destroy();
            }
            for (int i = DockList.Count - 1; i > -1; i--)
            {
                DockList[i].Destroy();
            }
            if (PlayerInstance != null)
            {
                PlayerInstance.Destroy();
                PlayerInstance.Detach();
            }
            if (UIBoatLayer != null)
            {
                FlatRedBall.SpriteManager.RemoveLayer(UIBoatLayer);
            }
            if (SandCollision != null)
            {
                SandCollision.Visible = false;
            }
            if (WaterCollision != null)
            {
                WaterCollision.Visible = false;
            }
            if (DirtCollision != null)
            {
                DirtCollision.Visible = false;
            }
            if (HulkCollision != null)
            {
                HulkCollision.Visible = false;
            }
            if (RockCollision != null)
            {
                RockCollision.Visible = false;
            }
            for (int i = CannonballList.Count - 1; i > -1; i--)
            {
                CannonballList[i].Destroy();
            }
            if (SpeedMeter != null)
            {
                SpeedMeter.Destroy();
                SpeedMeter.Detach();
            }
            for (int i = ExplosionList.Count - 1; i > -1; i--)
            {
                ExplosionList[i].Destroy();
            }
            if (ButtonPistol != null)
            {
                ButtonPistol.RemoveFromManagers();
            }
            if (ButtonShotgun != null)
            {
                ButtonShotgun.RemoveFromManagers();
            }
            for (int i = BulletList.Count - 1; i > -1; i--)
            {
                BulletList[i].Destroy();
            }
            for (int i = EnemyList.Count - 1; i > -1; i--)
            {
                EnemyList[i].Destroy();
            }
            if (InventoryBar != null)
            {
                InventoryBar.RemoveFromManagers();
            }
            if (InventoryGui != null)
            {
                InventoryGui.RemoveFromManagers();
            }
            BoatList.MakeTwoWay();
            DockList.MakeTwoWay();
            CannonballList.MakeTwoWay();
            ExplosionList.MakeTwoWay();
            BulletList.MakeTwoWay();
            EnemyList.MakeTwoWay();
            FlatRedBall.Math.Collision.CollisionManager.Self.Relationships.Clear();
            CustomDestroy();
        }
        public override void Destroy()
        {
            base.Destroy();
            Factories.A_BrickFactory.Destroy();
            Factories.Lucky_blockFactory.Destroy();
            Factories.GumbaFactory.Destroy();
            Factories.A_Brick_being_destroyedFactory.Destroy();
            Factories.MushroomFactory.Destroy();
            Factories.TurtleFactory.Destroy();
            Factories.CoinFactory.Destroy();
            Mario_Main_GUI.RemoveFromManagers(); FlatRedBall.FlatRedBallServices.GraphicsOptions.SizeOrOrientationChanged -= RefreshLayoutInternal;
            Mario_Main_GUI = null;

            A_BrickList.MakeOneWay();
            Lucky_blockList.MakeOneWay();
            GumbaList.MakeOneWay();
            A_Brick_being_destroyedList.MakeOneWay();
            MushroomList.MakeOneWay();
            TurtleList.MakeOneWay();
            CoinList.MakeOneWay();
            for (int i = A_BrickList.Count - 1; i > -1; i--)
            {
                A_BrickList[i].Destroy();
            }
            if (MarioInstance != null)
            {
                MarioInstance.Destroy();
                MarioInstance.Detach();
            }
            for (int i = Lucky_blockList.Count - 1; i > -1; i--)
            {
                Lucky_blockList[i].Destroy();
            }
            for (int i = GumbaList.Count - 1; i > -1; i--)
            {
                GumbaList[i].Destroy();
            }
            for (int i = A_Brick_being_destroyedList.Count - 1; i > -1; i--)
            {
                A_Brick_being_destroyedList[i].Destroy();
            }
            if (CombinedShapeCollection != null)
            {
                CombinedShapeCollection.Visible = false;
            }
            for (int i = MushroomList.Count - 1; i > -1; i--)
            {
                MushroomList[i].Destroy();
            }
            for (int i = TurtleList.Count - 1; i > -1; i--)
            {
                TurtleList[i].Destroy();
            }
            if (DeadMarioInstance != null)
            {
                DeadMarioInstance.Destroy();
                DeadMarioInstance.Detach();
            }
            for (int i = CoinList.Count - 1; i > -1; i--)
            {
                CoinList[i].Destroy();
            }
            A_BrickList.MakeTwoWay();
            Lucky_blockList.MakeTwoWay();
            GumbaList.MakeTwoWay();
            A_Brick_being_destroyedList.MakeTwoWay();
            MushroomList.MakeTwoWay();
            TurtleList.MakeTwoWay();
            CoinList.MakeTwoWay();
            FlatRedBall.Math.Collision.CollisionManager.Self.Relationships.Clear();
            CustomDestroy();
        }