示例#1
0
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.CopyAbsoluteToRelative();
                SpriteInstance.AttachTo(this, false);
            }
            SpriteInstance.Texture            = tiny_ship;
            SpriteInstance.LeftTexturePixel   = 0f;
            SpriteInstance.RightTexturePixel  = 32f;
            SpriteInstance.TopTexturePixel    = 4f;
            SpriteInstance.BottomTexturePixel = 27f;
            SpriteInstance.TextureScale       = 1f;
            if (mAxisAlignedRectangleInstance.Parent == null)
            {
                mAxisAlignedRectangleInstance.CopyAbsoluteToRelative();
                mAxisAlignedRectangleInstance.AttachTo(this, false);
            }
            AxisAlignedRectangleInstance.Width   = 32f;
            AxisAlignedRectangleInstance.Height  = 32f;
            AxisAlignedRectangleInstance.Visible = false;
            mGeneratedCollision = new FlatRedBall.Math.Geometry.ShapeCollection();
            mGeneratedCollision.AxisAlignedRectangles.AddOneWay(mAxisAlignedRectangleInstance);
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (mCollisionCircle.Parent == null)
            {
                mCollisionCircle.CopyAbsoluteToRelative();
                mCollisionCircle.AttachTo(this, false);
            }
            CollisionCircle.Radius  = 4f;
            CollisionCircle.Visible = false;
            if (mKickIndicatorInstance.Parent == null)
            {
                mKickIndicatorInstance.CopyAbsoluteToRelative();
                mKickIndicatorInstance.AttachTo(this, false);
            }
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.CopyAbsoluteToRelative();
                SpriteInstance.AttachTo(this, false);
            }
            SpriteInstance.Texture      = SoccerBall;
            SpriteInstance.TextureScale = 1f;
            SpriteInstance.Width        = 8f;
            SpriteInstance.Height       = 8f;
            mGeneratedCollision         = new FlatRedBall.Math.Geometry.ShapeCollection();
            Collision.Circles.AddOneWay(mCollisionCircle);
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
示例#3
0
        public override void Initialize(bool addToManagers)
        {
			// Generated Initialize
			LoadStaticContent(ContentManagerName);
			if (!FlatRedBall.FlatRedBallServices.IsLoaded<FlatRedBall.Scene>(@"content/screens/mundosmith/scenefile.scnx", ContentManagerName))
			{
			}
			SceneFile = FlatRedBall.FlatRedBallServices.Load<FlatRedBall.Scene>(@"content/screens/mundosmith/scenefile.scnx", ContentManagerName);
			if (!FlatRedBall.FlatRedBallServices.IsLoaded<FlatRedBall.Math.Geometry.ShapeCollection>(@"content/screens/mundosmith/limitesmundo.shcx", ContentManagerName))
			{
			}
			LimitesMundo = FlatRedBall.FlatRedBallServices.Load<FlatRedBall.Math.Geometry.ShapeCollection>(@"content/screens/mundosmith/limitesmundo.shcx", ContentManagerName);
			Fondo = SceneFile.Sprites.FindByName("ship painting1");
			SmithInstance = new TesisEconoFight.Entities.Smith(ContentManagerName, false);
			SmithInstance.Name = "SmithInstance";
			PauseTextInstance = new TesisEconoFight.Entities.PauseText(ContentManagerName, false);
			PauseTextInstance.Name = "PauseTextInstance";
			P2WinTextInstance = new TesisEconoFight.Entities.P2WinText(ContentManagerName, false);
			P2WinTextInstance.Name = "P2WinTextInstance";
			P1WinTextInstance = new TesisEconoFight.Entities.P1WinText(ContentManagerName, false);
			P1WinTextInstance.Name = "P1WinTextInstance";
			DoubleKOTextInstance = new TesisEconoFight.Entities.DoubleKOText(ContentManagerName, false);
			DoubleKOTextInstance.Name = "DoubleKOTextInstance";
			ListaJugadores = new FlatRedBall.Math.PositionedObjectList<TesisEconoFight.Entities.Player>();
			ListaJugadores.Name = "ListaJugadores";
			
			
			PostInitialize();
			base.Initialize(addToManagers);
			if (addToManagers)
			{
				AddToManagers();
			}

        }
示例#4
0
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.CopyAbsoluteToRelative();
                SpriteInstance.AttachTo(this, false);
            }
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.Z = 0f;
            }
            else
            {
                SpriteInstance.RelativeZ = 0f;
            }
            SpriteInstance.Texture      = BulletSprite;
            SpriteInstance.TextureScale = 1f;
            if (mCircleInstance.Parent == null)
            {
                mCircleInstance.CopyAbsoluteToRelative();
                mCircleInstance.AttachTo(this, false);
            }
            CircleInstance.Radius = 1f;
            mGeneratedCollision   = new FlatRedBall.Math.Geometry.ShapeCollection();
            mGeneratedCollision.Circles.AddOneWay(mCircleInstance);
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
示例#5
0
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.CopyAbsoluteToRelative();
                SpriteInstance.AttachTo(this, false);
            }
            SpriteInstance.Texture            = ufo;
            SpriteInstance.LeftTexturePixel   = 22f;
            SpriteInstance.RightTexturePixel  = 331f;
            SpriteInstance.TopTexturePixel    = 22f;
            SpriteInstance.BottomTexturePixel = 229f;
            SpriteInstance.TextureScale       = 0.125f;
            SpriteInstance.AnimationChains    = EnemyAnimation;
            SpriteInstance.CurrentChainName   = "Flying";
            #if FRB_MDX
            SpriteInstance.ColorOperation = Microsoft.DirectX.Direct3D.TextureOperation.Texture;
            #else
            SpriteInstance.ColorOperation = FlatRedBall.Graphics.ColorOperation.Texture;
            #endif
            if (mAxisAlignedRectangleInstance.Parent == null)
            {
                mAxisAlignedRectangleInstance.CopyAbsoluteToRelative();
                mAxisAlignedRectangleInstance.AttachTo(this, false);
            }
            AxisAlignedRectangleInstance.Width   = 32f;
            AxisAlignedRectangleInstance.Height  = 32f;
            AxisAlignedRectangleInstance.Visible = false;
            mGeneratedCollision = new FlatRedBall.Math.Geometry.ShapeCollection();
            mGeneratedCollision.AxisAlignedRectangles.AddOneWay(mAxisAlignedRectangleInstance);
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
示例#6
0
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.CopyAbsoluteToRelative();
                SpriteInstance.AttachTo(this, false);
            }
            SpriteInstance.Texture      = null;
            SpriteInstance.TextureScale = 1f;
            SpriteInstance.UseAnimationRelativePosition = true;
            SpriteInstance.AnimationChains  = SkeletonAnimation;
            SpriteInstance.CurrentChainName = "Idle";
            if (mHitbox.Parent == null)
            {
                mHitbox.CopyAbsoluteToRelative();
                mHitbox.AttachTo(this, false);
            }
            Hitbox.Width        = 32f;
            Hitbox.Height       = 32f;
            mGeneratedCollision = new FlatRedBall.Math.Geometry.ShapeCollection();
            mGeneratedCollision.AxisAlignedRectangles.AddOneWay(mHitbox);
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
示例#7
0
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (BoatSpriteInstance.Parent == null)
            {
                BoatSpriteInstance.CopyAbsoluteToRelative();
                BoatSpriteInstance.AttachTo(this, false);
            }
            if (BoatSpriteInstance.Parent == null)
            {
                BoatSpriteInstance.X = 0f;
            }
            else
            {
                BoatSpriteInstance.RelativeX = 0f;
            }
            if (BoatSpriteInstance.Parent == null)
            {
                BoatSpriteInstance.Y = 0f;
            }
            else
            {
                BoatSpriteInstance.RelativeY = 0f;
            }
            BoatSpriteInstance.Texture      = BoatSprite;
            BoatSpriteInstance.TextureScale = 1f;
            if (mHitbox.Parent == null)
            {
                mHitbox.CopyAbsoluteToRelative();
                mHitbox.AttachTo(this, false);
            }
            Hitbox.Visible = false;
            FlatRedBall.Math.Geometry.Point[] HitboxPoints = new FlatRedBall.Math.Geometry.Point[] { new FlatRedBall.Math.Geometry.Point(13, 32), new FlatRedBall.Math.Geometry.Point(13, -32), new FlatRedBall.Math.Geometry.Point(-13, -32), new FlatRedBall.Math.Geometry.Point(-13, 32), new FlatRedBall.Math.Geometry.Point(13, 32) };
            Hitbox.Points = HitboxPoints;
            if (AnchorSpriteInstance.Parent == null)
            {
                AnchorSpriteInstance.CopyAbsoluteToRelative();
                AnchorSpriteInstance.AttachTo(this, false);
            }
            AnchorSpriteInstance.Texture      = AnchorSprite;
            AnchorSpriteInstance.TextureScale = 0.5f;
            AnchorSpriteInstance.Visible      = false;
            mGeneratedCollision = new FlatRedBall.Math.Geometry.ShapeCollection();
            mGeneratedCollision.Polygons.AddOneWay(mHitbox);
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
示例#8
0
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (mCircleInstance.Parent == null)
            {
                mCircleInstance.CopyAbsoluteToRelative();
                mCircleInstance.AttachTo(this, false);
            }
            CircleInstance.Radius  = 16f;
            CircleInstance.Visible = false;
            mGeneratedCollision    = new FlatRedBall.Math.Geometry.ShapeCollection();
            mGeneratedCollision.Circles.AddOneWay(mCircleInstance);
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (mAxisAlignedRectangleInstance.Parent == null)
            {
                mAxisAlignedRectangleInstance.CopyAbsoluteToRelative();
                mAxisAlignedRectangleInstance.AttachTo(this, false);
            }
            AxisAlignedRectangleInstance.Width  = 128f;
            AxisAlignedRectangleInstance.Height = 128f;
            AxisAlignedRectangleInstance.Color  = Microsoft.Xna.Framework.Color.Red;
            mGeneratedCollision = new FlatRedBall.Math.Geometry.ShapeCollection();
            mGeneratedCollision.AxisAlignedRectangles.AddOneWay(mAxisAlignedRectangleInstance);
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
示例#10
0
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.CopyAbsoluteToRelative();
                SpriteInstance.AttachTo(this, false);
            }
            SpriteInstance.Texture            = M484BulletCollection1;
            SpriteInstance.LeftTexturePixel   = 376f;
            SpriteInstance.RightTexturePixel  = 415f;
            SpriteInstance.TopTexturePixel    = 316f;
            SpriteInstance.BottomTexturePixel = 327f;
            SpriteInstance.TextureScale       = 0.5f;
            if (mAxisAlignedRectangleInstance.Parent == null)
            {
                mAxisAlignedRectangleInstance.CopyAbsoluteToRelative();
                mAxisAlignedRectangleInstance.AttachTo(this, false);
            }
            if (AxisAlignedRectangleInstance.Parent == null)
            {
                AxisAlignedRectangleInstance.X = -0.009895243f;
            }
            else
            {
                AxisAlignedRectangleInstance.RelativeX = -0.009895243f;
            }
            if (AxisAlignedRectangleInstance.Parent == null)
            {
                AxisAlignedRectangleInstance.Y = -0.04981309f;
            }
            else
            {
                AxisAlignedRectangleInstance.RelativeY = -0.04981309f;
            }
            AxisAlignedRectangleInstance.Width   = 19f;
            AxisAlignedRectangleInstance.Height  = 5f;
            AxisAlignedRectangleInstance.Visible = false;
            mGeneratedCollision = new FlatRedBall.Math.Geometry.ShapeCollection();
            mGeneratedCollision.AxisAlignedRectangles.AddOneWay(mAxisAlignedRectangleInstance);
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
示例#11
0
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (mSpriteInstance.Parent == null)
            {
                mSpriteInstance.CopyAbsoluteToRelative();
                mSpriteInstance.AttachTo(this, false);
            }
            SpriteInstance.TextureScale = 1f;
            if (mMeleeHitbox.Parent == null)
            {
                mMeleeHitbox.CopyAbsoluteToRelative();
                mMeleeHitbox.AttachTo(this, false);
            }
            mGeneratedCollision = new FlatRedBall.Math.Geometry.ShapeCollection();
            mGeneratedCollision.Lines.AddOneWay(mMeleeHitbox);
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
示例#12
0
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (mAxisAlignedRectangleInstance.Parent == null)
            {
                mAxisAlignedRectangleInstance.CopyAbsoluteToRelative();
                mAxisAlignedRectangleInstance.AttachTo(this, false);
            }
            if (AxisAlignedRectangleInstance.Parent == null)
            {
                AxisAlignedRectangleInstance.Y = -2f;
            }
            else
            {
                AxisAlignedRectangleInstance.RelativeY = -2f;
            }
            AxisAlignedRectangleInstance.Width   = 8f;
            AxisAlignedRectangleInstance.Height  = 12.5f;
            AxisAlignedRectangleInstance.Visible = false;
            if (mBallCatchArea.Parent == null)
            {
                mBallCatchArea.CopyAbsoluteToRelative();
                mBallCatchArea.AttachTo(this, false);
            }
            BallCatchArea.Radius  = 16f;
            BallCatchArea.Visible = false;
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.CopyAbsoluteToRelative();
                SpriteInstance.AttachTo(this, false);
            }
            SpriteInstance.TextureScale     = 0.25f;
            SpriteInstance.AnimationChains  = AnimationChainListFile;
            SpriteInstance.CurrentChainName = "Idle";
            mGeneratedCollision             = new FlatRedBall.Math.Geometry.ShapeCollection();
            Collision.AxisAlignedRectangles.AddOneWay(mAxisAlignedRectangleInstance);
            Collision.Circles.AddOneWay(mBallCatchArea);
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
示例#13
0
        public override void Initialize(bool addToManagers)
        {
            // Generated Initialize
            LoadStaticContent(ContentManagerName);
            TiledMap                   = new FlatRedBall.TileGraphics.LayeredTileMap();
            TiledMap.Name              = "TiledMap";
            TileCollisionShapes        = new FlatRedBall.Math.Geometry.ShapeCollection();
            TileCollisionShapes.Name   = "TileCollisionShapes";
            BulletList                 = new PositionedObjectList <LudumDare29.Entities.Bullet>();
            BulletList.Name            = "BulletList";
            NextLevelEntityList        = new PositionedObjectList <LudumDare29.Entities.NextLevelEntity>();
            NextLevelEntityList.Name   = "NextLevelEntityList";
            PlayerInstance             = new LudumDare29.Entities.Player(ContentManagerName, false);
            PlayerInstance.Name        = "PlayerInstance";
            SignEntityList             = new PositionedObjectList <LudumDare29.Entities.SignEntity>();
            SignEntityList.Name        = "SignEntityList";
            ActionEntityList           = new PositionedObjectList <LudumDare29.Entities.ActionEntity>();
            ActionEntityList.Name      = "ActionEntityList";
            EnemyBulletList            = new PositionedObjectList <LudumDare29.Entities.EnemyBullet>();
            EnemyBulletList.Name       = "EnemyBulletList";
            EnemyCornerList            = new PositionedObjectList <LudumDare29.Entities.EnemyCorner>();
            EnemyCornerList.Name       = "EnemyCornerList";
            GroundEnemyList            = new PositionedObjectList <LudumDare29.Entities.GroundEnemy>();
            GroundEnemyList.Name       = "GroundEnemyList";
            EntityCollisionShapes      = new FlatRedBall.Math.Geometry.ShapeCollection();
            EntityCollisionShapes.Name = "EntityCollisionShapes";
            EnemyCollisionGround       = new FlatRedBall.Math.Geometry.ShapeCollection();
            EnemyCollisionGround.Name  = "EnemyCollisionGround";
            TheEndText                 = new FlatRedBall.Graphics.Text();
            TheEndText.Name            = "TheEndText";


            PostInitialize();
            base.Initialize(addToManagers);
            if (addToManagers)
            {
                AddToManagers();
            }
        }
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.CopyAbsoluteToRelative();
                SpriteInstance.AttachTo(this, false);
            }
            SpriteInstance.Texture            = AllAssetsSheet;
            SpriteInstance.LeftTexturePixel   = 2816f;
            SpriteInstance.RightTexturePixel  = 2944f;
            SpriteInstance.TopTexturePixel    = 3968f;
            SpriteInstance.BottomTexturePixel = 4096f;
            SpriteInstance.TextureScale       = 1f;
            SpriteInstance.AnimationChains    = AnimationChainListFile;
            SpriteInstance.CurrentChainName   = "Spin";
            if (mCircleInstance.Parent == null)
            {
                mCircleInstance.CopyAbsoluteToRelative();
                mCircleInstance.AttachTo(this, false);
            }
            CircleInstance.Radius  = 75f;
            CircleInstance.Visible = false;
            if (mRangePreviewSprite.Parent == null)
            {
                mRangePreviewSprite.CopyAbsoluteToRelative();
                mRangePreviewSprite.AttachTo(this, false);
            }
            RangePreviewSprite.TextureScale = 1f;
            RangePreviewSprite.Visible      = false;
            RangePreviewSprite.Alpha        = 0.8f;
            mGeneratedCollision             = new FlatRedBall.Math.Geometry.ShapeCollection();
            mGeneratedCollision.Circles.AddOneWay(mCircleInstance);
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
示例#15
0
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.CopyAbsoluteToRelative();
                SpriteInstance.AttachTo(this, false);
            }
            SpriteInstance.Texture            = shells;
            SpriteInstance.LeftTexturePixel   = 664f;
            SpriteInstance.RightTexturePixel  = 718f;
            SpriteInstance.TopTexturePixel    = 591f;
            SpriteInstance.BottomTexturePixel = 615f;
            SpriteInstance.TextureScale       = 1f;
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.RotationZ = 4.71f;
            }
            else
            {
                SpriteInstance.RelativeRotationZ = 4.71f;
            }
            if (mCollisionBox.Parent == null)
            {
                mCollisionBox.CopyAbsoluteToRelative();
                mCollisionBox.AttachTo(this, false);
            }
            CollisionBox.Width   = 24f;
            CollisionBox.Height  = 52f;
            CollisionBox.Visible = false;
            mGeneratedCollision  = new FlatRedBall.Math.Geometry.ShapeCollection();
            mGeneratedCollision.AxisAlignedRectangles.AddOneWay(mCollisionBox);
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
        public override void Initialize(bool addToManagers)
        {
			// Generated Initialize
			LoadStaticContent(ContentManagerName);
			if (!FlatRedBall.FlatRedBallServices.IsLoaded<FlatRedBall.Math.Geometry.ShapeCollection>(@"content/screens/menuprincipal/alternativas.shcx", ContentManagerName))
			{
			}
			Alternativas = FlatRedBall.FlatRedBallServices.Load<FlatRedBall.Math.Geometry.ShapeCollection>(@"content/screens/menuprincipal/alternativas.shcx", ContentManagerName);
			if (!FlatRedBall.FlatRedBallServices.IsLoaded<FlatRedBall.Scene>(@"content/screens/menuprincipal/scenefile.scnx", ContentManagerName))
			{
			}
			SceneFile = FlatRedBall.FlatRedBallServices.Load<FlatRedBall.Scene>(@"content/screens/menuprincipal/scenefile.scnx", ContentManagerName);
			KursorInstance = new TesisEconoFight.Entities.Kursor(ContentManagerName, false);
			KursorInstance.Name = "KursorInstance";
			
			
			PostInitialize();
			base.Initialize(addToManagers);
			if (addToManagers)
			{
				AddToManagers();
			}

        }
示例#17
0
        public override void Initialize(bool addToManagers)
        {
			// Generated Initialize
			LoadStaticContent(ContentManagerName);
			if (!FlatRedBall.FlatRedBallServices.IsLoaded<FlatRedBall.Math.Geometry.ShapeCollection>(@"content/screens/menuglosario/altsglosario.shcx", ContentManagerName))
			{
			}
			AltsGlosario = FlatRedBall.FlatRedBallServices.Load<FlatRedBall.Math.Geometry.ShapeCollection>(@"content/screens/menuglosario/altsglosario.shcx", ContentManagerName);
			if (!FlatRedBall.FlatRedBallServices.IsLoaded<FlatRedBall.Scene>(@"content/screens/menuglosario/scenefile.scnx", ContentManagerName))
			{
			}
			SceneFile = FlatRedBall.FlatRedBallServices.Load<FlatRedBall.Scene>(@"content/screens/menuglosario/scenefile.scnx", ContentManagerName);
			Cursores = new FlatRedBall.Math.PositionedObjectList<TesisEconoFight.Entities.Kursor>();
			Cursores.Name = "Cursores";
			
			
			PostInitialize();
			base.Initialize(addToManagers);
			if (addToManagers)
			{
				AddToManagers();
			}

        }
 public static void LoadStaticContent(string contentManagerName)
 {
     if (string.IsNullOrEmpty(contentManagerName))
     {
         throw new ArgumentException("contentManagerName cannot be empty or null");
     }
     #if DEBUG
     if (contentManagerName == FlatRedBallServices.GlobalContentManager)
     {
         HasBeenLoadedWithGlobalContentManager = true;
     }
     else if (HasBeenLoadedWithGlobalContentManager)
     {
         throw new Exception("This type has been loaded with a Global content manager, then loaded with a non-global.  This can lead to a lot of bugs");
     }
     #endif
     if (!FlatRedBallServices.IsLoaded<FlatRedBall.Math.Geometry.ShapeCollection>(@"content/screens/gamescreen/boundaryshapecollection.shcx", contentManagerName))
     {
     }
     BoundaryShapeCollection = FlatRedBallServices.Load<FlatRedBall.Math.Geometry.ShapeCollection>(@"content/screens/gamescreen/boundaryshapecollection.shcx", contentManagerName);
     if (!FlatRedBallServices.IsLoaded<FlatRedBall.Scene>(@"content/screens/gamescreen/skyscenefile.scnx", contentManagerName))
     {
     }
     SkySceneFile = FlatRedBallServices.Load<FlatRedBall.Scene>(@"content/screens/gamescreen/skyscenefile.scnx", contentManagerName);
     FlatRedBird.Entities.Bird.LoadStaticContent(contentManagerName);
     FlatRedBird.Entities.Ground.LoadStaticContent(contentManagerName);
     CustomLoadStaticContent(contentManagerName);
 }
示例#19
0
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.CopyAbsoluteToRelative();
                SpriteInstance.AttachTo(this, false);
            }
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.X = 2.026742f;
            }
            else
            {
                SpriteInstance.RelativeX = 2.026742f;
            }
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.Y = 15.20056f;
            }
            else
            {
                SpriteInstance.RelativeY = 15.20056f;
            }
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.Z = 1f;
            }
            else
            {
                SpriteInstance.RelativeZ = 1f;
            }
            SpriteInstance.TextureScale = 1f;
            SpriteInstance.ParentRotationChangesPosition = false;
            if (LightOrShadowSprite.Parent == null)
            {
                LightOrShadowSprite.CopyAbsoluteToRelative();
                LightOrShadowSprite.AttachTo(this, false);
            }
            if (LightOrShadowSprite.Parent == null)
            {
                LightOrShadowSprite.Z = -1f;
            }
            else
            {
                LightOrShadowSprite.RelativeZ = -1f;
            }
            LightOrShadowSprite.Texture                       = AllParticles;
            LightOrShadowSprite.LeftTexturePixel              = 1019f;
            LightOrShadowSprite.RightTexturePixel             = 1072f;
            LightOrShadowSprite.TopTexturePixel               = 1895f;
            LightOrShadowSprite.BottomTexturePixel            = 1948f;
            LightOrShadowSprite.TextureScale                  = 1f;
            LightOrShadowSprite.AnimationChains               = BaseProjectileLightAnimationChainListFile;
            LightOrShadowSprite.CurrentChainName              = "Light_Shot";
            LightOrShadowSprite.ParentRotationChangesPosition = false;
            if (mCircleInstance.Parent == null)
            {
                mCircleInstance.CopyAbsoluteToRelative();
                mCircleInstance.AttachTo(this, false);
            }
            if (CircleInstance.Parent == null)
            {
                CircleInstance.X = 0f;
            }
            else
            {
                CircleInstance.RelativeX = 0f;
            }
            if (CircleInstance.Parent == null)
            {
                CircleInstance.Y = 0f;
            }
            else
            {
                CircleInstance.RelativeY = 0f;
            }
            CircleInstance.Radius = 16f;
            CircleInstance.Color  = Microsoft.Xna.Framework.Color.Red;
            CircleInstance.ParentRotationChangesPosition = false;
            if (AnimationChainInstance != null)
            {
            }
            mGeneratedCollision = new FlatRedBall.Math.Geometry.ShapeCollection();
            mGeneratedCollision.Circles.AddOneWay(mCircleInstance);
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
示例#20
0
 /// <summary>
 /// Performs a solid or cloud collision against a ShapeCollection.
 /// </summary>
 /// <param name="shapeCollection">The ShapeCollection to collide against.</param>
 /// <param name="isCloudCollision">Whether to perform solid or cloud collisions.</param>
 public bool CollideAgainst(FlatRedBall.Math.Geometry.ShapeCollection shapeCollection, bool isCloudCollision)
 {
     return(CollideAgainst(() => shapeCollection.CollideAgainstBounce(this.Collision, 1, 0, 0), isCloudCollision));
 }
示例#21
0
        public override void Initialize(bool addToManagers)
        {
			// Generated Initialize
			LoadStaticContent(ContentManagerName);
			if (!FlatRedBall.FlatRedBallServices.IsLoaded<FlatRedBall.Math.Geometry.ShapeCollection>(@"content/screens/charselect/escogerchar.shcx", ContentManagerName))
			{
			}
			EscogerChar = FlatRedBall.FlatRedBallServices.Load<FlatRedBall.Math.Geometry.ShapeCollection>(@"content/screens/charselect/escogerchar.shcx", ContentManagerName);
			if (!FlatRedBall.FlatRedBallServices.IsLoaded<FlatRedBall.Scene>(@"content/screens/charselect/scenefile.scnx", ContentManagerName))
			{
			}
			SceneFile = FlatRedBall.FlatRedBallServices.Load<FlatRedBall.Scene>(@"content/screens/charselect/scenefile.scnx", ContentManagerName);
			if (!FlatRedBall.FlatRedBallServices.IsLoaded<FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/screens/charselect/seleccionpersonaje.achx", ContentManagerName))
			{
			}
			SeleccionPersonaje = FlatRedBall.FlatRedBallServices.Load<FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/screens/charselect/seleccionpersonaje.achx", ContentManagerName);
			Cursores = new FlatRedBall.Math.PositionedObjectList<TesisEconoFight.Entities.Kursor>();
			Cursores.Name = "Cursores";
			Sprite1 = SceneFile.Sprites.FindByName("cara hayek1");
			Sprite2 = SceneFile.Sprites.FindByName("cara hayek2");
			
			
			PostInitialize();
			base.Initialize(addToManagers);
			if (addToManagers)
			{
				AddToManagers();
			}

        }
示例#22
0
 /// <summary>
 /// Performs a standard solid collision against a ShapeCollection.
 /// </summary>
 /// <param name="shapeCollection"></param>
 public bool CollideAgainst(FlatRedBall.Math.Geometry.ShapeCollection shapeCollection)
 {
     return(CollideAgainst(shapeCollection, false));
 }
示例#23
0
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.CopyAbsoluteToRelative();
                SpriteInstance.AttachTo(this, false);
            }
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.Z = 1f;
            }
            else
            {
                SpriteInstance.RelativeZ = 1f;
            }
            SpriteInstance.TextureScale     = 1f;
            SpriteInstance.AnimationChains  = AnimationChainListFile;
            SpriteInstance.CurrentChainName = "OrangeBody";
            if (mCircleInstance.Parent == null)
            {
                mCircleInstance.CopyAbsoluteToRelative();
                mCircleInstance.AttachTo(this, false);
            }
            CircleInstance.Radius  = 16f;
            CircleInstance.Visible = false;
            if (TurretInstance.Parent == null)
            {
                TurretInstance.CopyAbsoluteToRelative();
                TurretInstance.AttachTo(this, false);
            }
            if (TurretInstance.Parent == null)
            {
                TurretInstance.X = 0f;
            }
            else
            {
                TurretInstance.RelativeX = 0f;
            }
            if (TurretInstance.Parent == null)
            {
                TurretInstance.Z = 2f;
            }
            else
            {
                TurretInstance.RelativeZ = 2f;
            }
            if (TankShadow.Parent == null)
            {
                TankShadow.CopyAbsoluteToRelative();
                TankShadow.AttachTo(this, false);
            }
            if (TankShadow.Parent == null)
            {
                TankShadow.X = 5f;
            }
            else
            {
                TankShadow.RelativeX = 5f;
            }
            if (TankShadow.Parent == null)
            {
                TankShadow.Y = -5f;
            }
            else
            {
                TankShadow.RelativeY = -5f;
            }
            if (TankShadow.Parent == null)
            {
                TankShadow.Z = 0.1f;
            }
            else
            {
                TankShadow.RelativeZ = 0.1f;
            }
            TankShadow.TextureScale = 1f;
            TankShadow.UseAnimationRelativePosition = false;
            TankShadow.AnimationChains  = AnimationChainListFile;
            TankShadow.CurrentChainName = "TankShadow";
            TankShadow.ParentRotationChangesPosition = false;
            if (SmokeInstance.Parent == null)
            {
                SmokeInstance.CopyAbsoluteToRelative();
                SmokeInstance.AttachTo(this, false);
            }
            if (SmokeInstance.Parent == null)
            {
                SmokeInstance.X = -8f;
            }
            else
            {
                SmokeInstance.RelativeX = -8f;
            }
            if (SmokeInstance.Parent == null)
            {
                SmokeInstance.Z = 3f;
            }
            else
            {
                SmokeInstance.RelativeZ = 3f;
            }
            mGeneratedCollision = new FlatRedBall.Math.Geometry.ShapeCollection();
            mGeneratedCollision.Circles.AddOneWay(mCircleInstance);
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
示例#24
0
        protected virtual void InitializeEntity(bool addToManagers)
        {
            // Generated Initialize
            LoadStaticContent(ContentManagerName);
            mCollisionShapeCollection = ShapeCollectionFile.Clone();
            mPassThroughShapeCollection = PassThroughShapeCollectionFile.Clone();
            EntireScene = SceneFile.Clone();
            for (int i = 0; i < EntireScene.Texts.Count; i++)
            {
                EntireScene.Texts[i].AdjustPositionForPixelPerfectDrawing = true;
            }

            PostInitialize();
            if (addToManagers)
            {
                AddToManagers(null);
            }
        }
示例#25
0
        public override void Initialize(bool addToManagers)
        {
			// Generated Initialize
			LoadStaticContent(ContentManagerName);
			if (!FlatRedBall.FlatRedBallServices.IsLoaded<FlatRedBall.Math.Geometry.ShapeCollection>(@"content/screens/stageselect/seleccionstage.shcx", ContentManagerName))
			{
			}
			SeleccionStage = FlatRedBall.FlatRedBallServices.Load<FlatRedBall.Math.Geometry.ShapeCollection>(@"content/screens/stageselect/seleccionstage.shcx", ContentManagerName);
			if (!FlatRedBall.FlatRedBallServices.IsLoaded<FlatRedBall.Scene>(@"content/screens/stageselect/scenefile.scnx", ContentManagerName))
			{
			}
			SceneFile = FlatRedBall.FlatRedBallServices.Load<FlatRedBall.Scene>(@"content/screens/stageselect/scenefile.scnx", ContentManagerName);
			if (!FlatRedBall.FlatRedBallServices.IsLoaded<FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/screens/stageselect/animarseleccion.achx", ContentManagerName))
			{
			}
			AnimarSeleccion = FlatRedBall.FlatRedBallServices.Load<FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/screens/stageselect/animarseleccion.achx", ContentManagerName);
			Cursores = new FlatRedBall.Math.PositionedObjectList<TesisEconoFight.Entities.Kursor>();
			Cursores.Name = "Cursores";
			Sprite = SceneFile.Sprites.FindByName("universitätfreiburg1");
			
			
			PostInitialize();
			base.Initialize(addToManagers);
			if (addToManagers)
			{
				AddToManagers();
			}

        }
        public override void Destroy()
        {
            // Generated Destroy
            ObstacleFactory.Destroy();
            if (this.UnloadsContentManagerWhenDestroyed && ContentManagerName != "Global")
            {
                BoundaryShapeCollection.RemoveFromManagers(ContentManagerName != "Global");
            }
            else
            {
                BoundaryShapeCollection.RemoveFromManagers(false);
            }
            if (this.UnloadsContentManagerWhenDestroyed && ContentManagerName != "Global")
            {
                BoundaryShapeCollection = null;
            }
            else
            {
                BoundaryShapeCollection.MakeOneWay();
            }
            if (this.UnloadsContentManagerWhenDestroyed && ContentManagerName != "Global")
            {
                SkySceneFile.RemoveFromManagers(ContentManagerName != "Global");
            }
            else
            {
                SkySceneFile.RemoveFromManagers(false);
            }
            if (this.UnloadsContentManagerWhenDestroyed && ContentManagerName != "Global")
            {
                SkySceneFile = null;
            }
            else
            {
                SkySceneFile.MakeOneWay();
            }

            if (BirdInstance != null)
            {
                BirdInstance.Destroy();
                BirdInstance.Detach();
            }
            for (int i = ObstacleList.Count - 1; i > -1; i--)
            {
                ObstacleList[i].Destroy();
            }
            if (Boundary != null)
            {
                Boundary.RemoveFromManagers(ContentManagerName != "Global");
            }
            if (GroundInstance != null)
            {
                GroundInstance.Destroy();
                GroundInstance.Detach();
            }
            if (SkySceneInstance != null)
            {
                SkySceneInstance.RemoveFromManagers(ContentManagerName != "Global");
            }

            base.Destroy();

            CustomDestroy();
        }
        public override void Initialize(bool addToManagers)
        {
			// Generated Initialize
			LoadStaticContent(ContentManagerName);
			if (!FlatRedBall.FlatRedBallServices.IsLoaded<FlatRedBall.Math.Geometry.ShapeCollection>(@"content/screens/glosariosistemasjuego/opciones.shcx", ContentManagerName))
			{
			}
			Opciones = FlatRedBall.FlatRedBallServices.Load<FlatRedBall.Math.Geometry.ShapeCollection>(@"content/screens/glosariosistemasjuego/opciones.shcx", ContentManagerName);
			if (!FlatRedBall.FlatRedBallServices.IsLoaded<FlatRedBall.Scene>(@"content/screens/glosariosistemasjuego/scenefile.scnx", ContentManagerName))
			{
			}
			SceneFile = FlatRedBall.FlatRedBallServices.Load<FlatRedBall.Scene>(@"content/screens/glosariosistemasjuego/scenefile.scnx", ContentManagerName);
			if (!FlatRedBall.FlatRedBallServices.IsLoaded<FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/screens/glosariosistemasjuego/animacionpantalla.achx", ContentManagerName))
			{
			}
			AnimacionPantalla = FlatRedBall.FlatRedBallServices.Load<FlatRedBall.Graphics.Animation.AnimationChainList>(@"content/screens/glosariosistemasjuego/animacionpantalla.achx", ContentManagerName);
			KursorInstance = new TesisEconoFight.Entities.Kursor(ContentManagerName, false);
			KursorInstance.Name = "KursorInstance";
			Pantalla = SceneFile.Sprites.FindByName("glosario sistema de juegos 11");
			
			
			PostInitialize();
			base.Initialize(addToManagers);
			if (addToManagers)
			{
				AddToManagers();
			}

        }
示例#28
0
        protected virtual void InitializeEntity(bool addToManagers)
        {
            // Generated Initialize
            LoadStaticContent(ContentManagerName);
            mBirdCollision = BirdShapeCollection.Clone();
            BirdSpriterObject = SpriterObjectCollectionFile.FindByName("Bird").Clone();

            PostInitialize();
            if (addToManagers)
            {
                AddToManagers(null);
            }
        }
示例#29
0
 public static void LoadStaticContent(string contentManagerName)
 {
     if (string.IsNullOrEmpty(contentManagerName))
     {
         throw new ArgumentException("contentManagerName cannot be empty or null");
     }
     ContentManagerName = contentManagerName;
     #if DEBUG
     if (contentManagerName == FlatRedBallServices.GlobalContentManager)
     {
         HasBeenLoadedWithGlobalContentManager = true;
     }
     else if (HasBeenLoadedWithGlobalContentManager)
     {
         throw new Exception("This type has been loaded with a Global content manager, then loaded with a non-global.  This can lead to a lot of bugs");
     }
     #endif
     bool registerUnload = false;
     if (LoadedContentManagers.Contains(contentManagerName) == false)
     {
         LoadedContentManagers.Add(contentManagerName);
         lock (mLockObject)
         {
             if (!mRegisteredUnloads.Contains(ContentManagerName) && ContentManagerName != FlatRedBallServices.GlobalContentManager)
             {
                 FlatRedBallServices.GetContentManagerByName(ContentManagerName).AddUnloadMethod("ObstacleStaticUnload", UnloadStaticContent);
                 mRegisteredUnloads.Add(ContentManagerName);
             }
         }
         if (!FlatRedBallServices.IsLoaded<FlatRedBall.Math.Geometry.ShapeCollection>(@"content/entities/obstacle/shapecollectionfile.shcx", ContentManagerName))
         {
             registerUnload = true;
         }
         ShapeCollectionFile = FlatRedBallServices.Load<FlatRedBall.Math.Geometry.ShapeCollection>(@"content/entities/obstacle/shapecollectionfile.shcx", ContentManagerName);
         if (!FlatRedBallServices.IsLoaded<FlatRedBall.Math.Geometry.ShapeCollection>(@"content/entities/obstacle/passthroughshapecollectionfile.shcx", ContentManagerName))
         {
             registerUnload = true;
         }
         PassThroughShapeCollectionFile = FlatRedBallServices.Load<FlatRedBall.Math.Geometry.ShapeCollection>(@"content/entities/obstacle/passthroughshapecollectionfile.shcx", ContentManagerName);
         if (!FlatRedBallServices.IsLoaded<FlatRedBall.Scene>(@"content/entities/obstacle/scenefile.scnx", ContentManagerName))
         {
             registerUnload = true;
         }
         SceneFile = FlatRedBallServices.Load<FlatRedBall.Scene>(@"content/entities/obstacle/scenefile.scnx", ContentManagerName);
     }
     if (registerUnload && ContentManagerName != FlatRedBallServices.GlobalContentManager)
     {
         lock (mLockObject)
         {
             if (!mRegisteredUnloads.Contains(ContentManagerName) && ContentManagerName != FlatRedBallServices.GlobalContentManager)
             {
                 FlatRedBallServices.GetContentManagerByName(ContentManagerName).AddUnloadMethod("ObstacleStaticUnload", UnloadStaticContent);
                 mRegisteredUnloads.Add(ContentManagerName);
             }
         }
     }
     CustomLoadStaticContent(contentManagerName);
 }
        public override void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            base.PostInitialize();
            if (LightOrShadowSprite.Parent == null)
            {
                LightOrShadowSprite.CopyAbsoluteToRelative();
                LightOrShadowSprite.AttachTo(this, false);
            }
            if (LightOrShadowSprite.Parent == null)
            {
                base.LightOrShadowSprite.Y = -8f;
            }
            else
            {
                base.LightOrShadowSprite.RelativeY = -8f;
            }
            if (LightOrShadowSprite.Parent == null)
            {
                base.LightOrShadowSprite.Z = -1f;
            }
            else
            {
                base.LightOrShadowSprite.RelativeZ = -1f;
            }
            base.LightOrShadowSprite.Texture            = AllParticles;
            base.LightOrShadowSprite.LeftTexturePixel   = 1019f;
            base.LightOrShadowSprite.RightTexturePixel  = 1072f;
            base.LightOrShadowSprite.TopTexturePixel    = 1895f;
            base.LightOrShadowSprite.BottomTexturePixel = 1948f;
            base.LightOrShadowSprite.TextureScale       = 1f;
            base.LightOrShadowSprite.Width   = 32f;
            base.LightOrShadowSprite.Height  = 24f;
            base.LightOrShadowSprite.Animate = false;
            #if FRB_MDX
            LightOrShadowSprite.ColorOperation = Microsoft.DirectX.Direct3D.TextureOperation.Modulate;
            #else
            base.LightOrShadowSprite.ColorOperation = FlatRedBall.Graphics.ColorOperation.Modulate;
            #endif
            base.LightOrShadowSprite.Alpha = 0.8f;
            base.LightOrShadowSprite.ParentRotationChangesPosition = false;
            base.LightOrShadowSprite.ParentRotationChangesRotation = false;
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.CopyAbsoluteToRelative();
                SpriteInstance.AttachTo(this, false);
            }
            if (SpriteInstance.Parent == null)
            {
                base.SpriteInstance.Z = 1f;
            }
            else
            {
                base.SpriteInstance.RelativeZ = 1f;
            }
            base.SpriteInstance.TextureScale     = 0.5f;
            base.SpriteInstance.AnimationChains  = CannonProjectileAnimationChainListFile;
            base.SpriteInstance.CurrentChainName = "Shot";
            base.SpriteInstance.Visible          = true;
            base.SpriteInstance.ParentRotationChangesPosition = false;
            if (mCircleInstance.Parent == null)
            {
                mCircleInstance.CopyAbsoluteToRelative();
                mCircleInstance.AttachTo(this, false);
            }
            if (CircleInstance.Parent == null)
            {
                base.CircleInstance.X = 0f;
            }
            else
            {
                base.CircleInstance.RelativeX = 0f;
            }
            if (CircleInstance.Parent == null)
            {
                base.CircleInstance.Y = 0f;
            }
            else
            {
                base.CircleInstance.RelativeY = 0f;
            }
            base.CircleInstance.Radius = 16f;
            base.CircleInstance.Color  = Microsoft.Xna.Framework.Color.Red;
            base.CircleInstance.ParentRotationChangesPosition = false;
            mGeneratedCollision = new FlatRedBall.Math.Geometry.ShapeCollection();
            mGeneratedCollision.Circles.AddOneWay(mCircleInstance);
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
示例#31
0
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.CopyAbsoluteToRelative();
                SpriteInstance.AttachTo(this, false);
            }
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.Z = 10f;
            }
            else
            {
                SpriteInstance.RelativeZ = 10f;
            }
            SpriteInstance.Texture          = null;
            SpriteInstance.TextureScale     = 0.75f;
            SpriteInstance.AnimationChains  = AnimationChain;
            SpriteInstance.CurrentChainName = "Idle";
            if (TextInstance.Parent == null)
            {
                TextInstance.CopyAbsoluteToRelative();
                TextInstance.AttachTo(this, false);
            }
            TextInstance.DisplayText         = "Player";
            TextInstance.HorizontalAlignment = FlatRedBall.Graphics.HorizontalAlignment.Center;
            if (TextInstance.Parent == null)
            {
                TextInstance.Y = 32f;
            }
            else
            {
                TextInstance.RelativeY = 32f;
            }
            if (mHitbox.Parent == null)
            {
                mHitbox.CopyAbsoluteToRelative();
                mHitbox.AttachTo(this, false);
            }
            if (Hitbox.Parent == null)
            {
                Hitbox.Z = 15f;
            }
            else
            {
                Hitbox.RelativeZ = 15f;
            }
            Hitbox.Width   = 32f;
            Hitbox.Height  = 32f;
            Hitbox.Visible = false;
            Hitbox.RepositionDirections = FlatRedBall.Math.Geometry.RepositionDirections.All;
            if (WeaponInstance.Parent == null)
            {
                WeaponInstance.CopyAbsoluteToRelative();
                WeaponInstance.AttachTo(this, false);
            }
            mGeneratedCollision = new FlatRedBall.Math.Geometry.ShapeCollection();
            mGeneratedCollision.AxisAlignedRectangles.AddOneWay(mHitbox);
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
        public override void Initialize(bool addToManagers)
        {
            // Generated Initialize
            LoadStaticContent(ContentManagerName);
            Boundary = BoundaryShapeCollection;
            SkySceneInstance = SkySceneFile;
            for (int i = 0; i < SkySceneInstance.Texts.Count; i++)
            {
                SkySceneInstance.Texts[i].AdjustPositionForPixelPerfectDrawing = true;
            }
            BirdInstance = new FlatRedBird.Entities.Bird(ContentManagerName, false);
            BirdInstance.Name = "BirdInstance";
            ObstacleList = new PositionedObjectList<FlatRedBird.Entities.Obstacle>();
            GroundInstance = new FlatRedBird.Entities.Ground(ContentManagerName, false);
            GroundInstance.Name = "GroundInstance";

            PostInitialize();
            base.Initialize(addToManagers);
            if (addToManagers)
            {
                AddToManagers();
            }
        }
示例#33
0
 public static void UnloadStaticContent()
 {
     if (LoadedContentManagers.Count != 0)
     {
         LoadedContentManagers.RemoveAt(0);
         mRegisteredUnloads.RemoveAt(0);
     }
     if (LoadedContentManagers.Count == 0)
     {
         if (BirdShapeCollection != null)
         {
             BirdShapeCollection.RemoveFromManagers(ContentManagerName != "Global");
             BirdShapeCollection= null;
         }
         if (SpriterObjectCollectionFile != null)
         {
             SpriterObjectCollectionFile.Destroy();
             SpriterObjectCollectionFile= null;
         }
         if (redball != null)
         {
             redball= null;
         }
     }
 }
示例#34
0
 public static void LoadStaticContent(string contentManagerName)
 {
     if (string.IsNullOrEmpty(contentManagerName))
     {
         throw new ArgumentException("contentManagerName cannot be empty or null");
     }
     ContentManagerName = contentManagerName;
     #if DEBUG
     if (contentManagerName == FlatRedBallServices.GlobalContentManager)
     {
         HasBeenLoadedWithGlobalContentManager = true;
     }
     else if (HasBeenLoadedWithGlobalContentManager)
     {
         throw new Exception("This type has been loaded with a Global content manager, then loaded with a non-global.  This can lead to a lot of bugs");
     }
     #endif
     bool registerUnload = false;
     if (LoadedContentManagers.Contains(contentManagerName) == false)
     {
         LoadedContentManagers.Add(contentManagerName);
         lock (mLockObject)
         {
             if (!mRegisteredUnloads.Contains(ContentManagerName) && ContentManagerName != FlatRedBallServices.GlobalContentManager)
             {
                 FlatRedBallServices.GetContentManagerByName(ContentManagerName).AddUnloadMethod("BirdStaticUnload", UnloadStaticContent);
                 mRegisteredUnloads.Add(ContentManagerName);
             }
         }
         if (!FlatRedBallServices.IsLoaded<FlatRedBall.Math.Geometry.ShapeCollection>(@"content/entities/bird/birdshapecollection.shcx", ContentManagerName))
         {
             registerUnload = true;
         }
         BirdShapeCollection = FlatRedBallServices.Load<FlatRedBall.Math.Geometry.ShapeCollection>(@"content/entities/bird/birdshapecollection.shcx", ContentManagerName);
         if (!FlatRedBallServices.IsLoaded<FlatRedBall_Spriter.SpriterObjectCollection>(@"content/entities/bird/spriterobjectcollectionfile.scml", ContentManagerName))
         {
             registerUnload = true;
         }
         SpriterObjectCollectionFile = SpriterObjectSave.FromFile("content/entities/bird/spriterobjectcollectionfile.scml").ToRuntime();
         if (!FlatRedBallServices.IsLoaded<Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/entities/bird/redball.png", ContentManagerName))
         {
             registerUnload = true;
         }
         redball = FlatRedBallServices.Load<Microsoft.Xna.Framework.Graphics.Texture2D>(@"content/entities/bird/redball.png", ContentManagerName);
     }
     if (registerUnload && ContentManagerName != FlatRedBallServices.GlobalContentManager)
     {
         lock (mLockObject)
         {
             if (!mRegisteredUnloads.Contains(ContentManagerName) && ContentManagerName != FlatRedBallServices.GlobalContentManager)
             {
                 FlatRedBallServices.GetContentManagerByName(ContentManagerName).AddUnloadMethod("BirdStaticUnload", UnloadStaticContent);
                 mRegisteredUnloads.Add(ContentManagerName);
             }
         }
     }
     CustomLoadStaticContent(contentManagerName);
 }
示例#35
0
 public static void UnloadStaticContent()
 {
     if (LoadedContentManagers.Count != 0)
     {
         LoadedContentManagers.RemoveAt(0);
         mRegisteredUnloads.RemoveAt(0);
     }
     if (LoadedContentManagers.Count == 0)
     {
         if (ShapeCollectionFile != null)
         {
             ShapeCollectionFile.RemoveFromManagers(ContentManagerName != "Global");
             ShapeCollectionFile= null;
         }
         if (PassThroughShapeCollectionFile != null)
         {
             PassThroughShapeCollectionFile.RemoveFromManagers(ContentManagerName != "Global");
             PassThroughShapeCollectionFile= null;
         }
         if (SceneFile != null)
         {
             SceneFile.RemoveFromManagers(ContentManagerName != "Global");
             SceneFile= null;
         }
     }
 }
        public override void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            base.PostInitialize();
            if (mSpriteInstance.Parent == null)
            {
                mSpriteInstance.CopyAbsoluteToRelative();
                mSpriteInstance.AttachTo(this, false);
            }
            base.SpriteInstance.Texture                         = Stage2;
            base.SpriteInstance.LeftTexturePixel                = 3f;
            base.SpriteInstance.RightTexturePixel               = 142f;
            base.SpriteInstance.TopTexturePixel                 = 373f;
            base.SpriteInstance.BottomTexturePixel              = 760f;
            base.SpriteInstance.TextureScale                    = 0.5f;
            base.SpriteInstance.UseAnimationRelativePosition    = true;
            base.SpriteInstance.AnimationChains                 = Rabbit2Animations;
            base.SpriteInstance.CurrentChainName                = "Running";
            base.SpriteInstance.IgnoreAnimationChainTextureFlip = true;
            if (mCircleInstance.Parent == null)
            {
                mCircleInstance.CopyAbsoluteToRelative();
                mCircleInstance.AttachTo(this, false);
            }
            base.CircleInstance.Radius = 16f;
            if (LightSprite.Parent == null)
            {
                LightSprite.CopyAbsoluteToRelative();
                LightSprite.AttachTo(this, false);
            }
            base.LightSprite.Texture            = AllAssetsSheet;
            base.LightSprite.LeftTexturePixel   = 1792f;
            base.LightSprite.RightTexturePixel  = 2048f;
            base.LightSprite.TopTexturePixel    = 1792f;
            base.LightSprite.BottomTexturePixel = 2048f;
            base.LightSprite.TextureScale       = 0.5f;
            if (ShadowSprite.Parent == null)
            {
                ShadowSprite.CopyAbsoluteToRelative();
                ShadowSprite.AttachTo(this, false);
            }
            if (ShadowSprite.Parent == null)
            {
                base.ShadowSprite.Y = -32f;
            }
            else
            {
                base.ShadowSprite.RelativeY = -32f;
            }
            if (ShadowSprite.Parent == null)
            {
                base.ShadowSprite.Z = -1f;
            }
            else
            {
                base.ShadowSprite.RelativeZ = -1f;
            }
            base.ShadowSprite.Texture            = AllParticles;
            base.ShadowSprite.LeftTexturePixel   = 1019f;
            base.ShadowSprite.RightTexturePixel  = 1072f;
            base.ShadowSprite.TopTexturePixel    = 1895f;
            base.ShadowSprite.BottomTexturePixel = 1948f;
            base.ShadowSprite.TextureScale       = 1f;
            base.ShadowSprite.Width  = 48f;
            base.ShadowSprite.Height = 16f;
            #if FRB_MDX
            ShadowSprite.ColorOperation = Microsoft.DirectX.Direct3D.TextureOperation.Modulate;
            #else
            base.ShadowSprite.ColorOperation = FlatRedBall.Graphics.ColorOperation.Modulate;
            #endif
            base.ShadowSprite.Alpha = 0.3f;
            if (PoisonedParticles.Parent == null)
            {
                PoisonedParticles.CopyAbsoluteToRelative();
                PoisonedParticles.AttachTo(this, false);
            }
            if (FrozenParticles.Parent == null)
            {
                FrozenParticles.CopyAbsoluteToRelative();
                FrozenParticles.AttachTo(this, false);
            }
            if (SmokeParticles.Parent == null)
            {
                SmokeParticles.CopyAbsoluteToRelative();
                SmokeParticles.AttachTo(this, false);
            }
            if (StunParticles.Parent == null)
            {
                StunParticles.CopyAbsoluteToRelative();
                StunParticles.AttachTo(this, false);
            }
            mGeneratedCollision = new FlatRedBall.Math.Geometry.ShapeCollection();
            mGeneratedCollision.Circles.AddOneWay(mCircleInstance);
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.CopyAbsoluteToRelative();
                SpriteInstance.AttachTo(this, false);
            }
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.Z = 2f;
            }
            else
            {
                SpriteInstance.RelativeZ = 2f;
            }
            SpriteInstance.TextureScale     = 1f;
            SpriteInstance.AnimationChains  = AnimationChainListFile;
            SpriteInstance.CurrentChainName = "OrangeMissile";
            if (mCircleInstance.Parent == null)
            {
                mCircleInstance.CopyAbsoluteToRelative();
                mCircleInstance.AttachTo(this, false);
            }
            CircleInstance.Radius  = 3f;
            CircleInstance.Visible = false;
            if (BulletShadow.Parent == null)
            {
                BulletShadow.CopyAbsoluteToRelative();
                BulletShadow.AttachTo(this, false);
            }
            if (BulletShadow.Parent == null)
            {
                BulletShadow.X = 10f;
            }
            else
            {
                BulletShadow.RelativeX = 10f;
            }
            if (BulletShadow.Parent == null)
            {
                BulletShadow.Y = -10f;
            }
            else
            {
                BulletShadow.RelativeY = -10f;
            }
            if (BulletShadow.Parent == null)
            {
                BulletShadow.Z = 0.1f;
            }
            else
            {
                BulletShadow.RelativeZ = 0.1f;
            }
            BulletShadow.TextureScale = 1f;
            BulletShadow.UseAnimationRelativePosition = false;
            BulletShadow.AnimationChains  = AnimationChainListFile;
            BulletShadow.CurrentChainName = "MissileShadow";
            BulletShadow.ParentRotationChangesPosition = false;
            if (MissileTrailInstance.Parent == null)
            {
                MissileTrailInstance.CopyAbsoluteToRelative();
                MissileTrailInstance.AttachTo(this, false);
            }
            if (MissileTrailInstance.Parent == null)
            {
                MissileTrailInstance.X = -20f;
            }
            else
            {
                MissileTrailInstance.RelativeX = -20f;
            }
            if (MissileTrailInstance.Parent == null)
            {
                MissileTrailInstance.Z = 2f;
            }
            else
            {
                MissileTrailInstance.RelativeZ = 2f;
            }
            mGeneratedCollision = new FlatRedBall.Math.Geometry.ShapeCollection();
            mGeneratedCollision.Circles.AddOneWay(mCircleInstance);
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }