Esempio n. 1
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;
        }
Esempio n. 2
0
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (mLine1.Parent == null)
            {
                mLine1.CopyAbsoluteToRelative();
                mLine1.AttachTo(this, false);
            }
            FlatRedBall.Math.Geometry.Point[] Line1Points = new FlatRedBall.Math.Geometry.Point[] { new FlatRedBall.Math.Geometry.Point(-6, 6), new FlatRedBall.Math.Geometry.Point(6, -6) };
            Line1.Points = Line1Points;
            if (mLine2.Parent == null)
            {
                mLine2.CopyAbsoluteToRelative();
                mLine2.AttachTo(this, false);
            }
            FlatRedBall.Math.Geometry.Point[] Line2Points = new FlatRedBall.Math.Geometry.Point[] { new FlatRedBall.Math.Geometry.Point(6, 6), new FlatRedBall.Math.Geometry.Point(-6, -6) };
            Line2.Points = Line2Points;
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
Esempio n. 3
0
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (mArrowPoly1.Parent == null)
            {
                mArrowPoly1.CopyAbsoluteToRelative();
                mArrowPoly1.AttachTo(this, false);
            }
            if (ArrowPoly1.Parent == null)
            {
                ArrowPoly1.X = 2f;
            }
            else
            {
                ArrowPoly1.RelativeX = 2f;
            }
            if (ArrowPoly1.Parent == null)
            {
                ArrowPoly1.Y = 58f;
            }
            else
            {
                ArrowPoly1.RelativeY = 58f;
            }
            if (ArrowPoly1.Parent == null)
            {
                ArrowPoly1.RotationZ = 1.57f;
            }
            else
            {
                ArrowPoly1.RelativeRotationZ = 1.57f;
            }
            FlatRedBall.Math.Geometry.Point[] ArrowPoly1Points = new FlatRedBall.Math.Geometry.Point[] { new FlatRedBall.Math.Geometry.Point(0, -50), new FlatRedBall.Math.Geometry.Point(0, 50), new FlatRedBall.Math.Geometry.Point(5, 35), new FlatRedBall.Math.Geometry.Point(-5, 35), new FlatRedBall.Math.Geometry.Point(0, 50) };
            ArrowPoly1.Points = ArrowPoly1Points;
            if (mArrowPoly4.Parent == null)
            {
                mArrowPoly4.CopyAbsoluteToRelative();
                mArrowPoly4.AttachTo(this, false);
            }
            if (ArrowPoly4.Parent == null)
            {
                ArrowPoly4.X = 2f;
            }
            else
            {
                ArrowPoly4.RelativeX = 2f;
            }
            if (ArrowPoly4.Parent == null)
            {
                ArrowPoly4.Y = -58f;
            }
            else
            {
                ArrowPoly4.RelativeY = -58f;
            }
            if (ArrowPoly4.Parent == null)
            {
                ArrowPoly4.RotationZ = -1.57f;
            }
            else
            {
                ArrowPoly4.RelativeRotationZ = -1.57f;
            }
            FlatRedBall.Math.Geometry.Point[] ArrowPoly4Points = new FlatRedBall.Math.Geometry.Point[] { new FlatRedBall.Math.Geometry.Point(0, -50), new FlatRedBall.Math.Geometry.Point(0, 50), new FlatRedBall.Math.Geometry.Point(5, 35), new FlatRedBall.Math.Geometry.Point(-5, 35), new FlatRedBall.Math.Geometry.Point(0, 50) };
            ArrowPoly4.Points = ArrowPoly4Points;
            if (mArrowPoly2.Parent == null)
            {
                mArrowPoly2.CopyAbsoluteToRelative();
                mArrowPoly2.AttachTo(this, false);
            }
            if (ArrowPoly2.Parent == null)
            {
                ArrowPoly2.X = 58f;
            }
            else
            {
                ArrowPoly2.RelativeX = 58f;
            }
            if (ArrowPoly2.Parent == null)
            {
                ArrowPoly2.Y = 1f;
            }
            else
            {
                ArrowPoly2.RelativeY = 1f;
            }
            FlatRedBall.Math.Geometry.Point[] ArrowPoly2Points = new FlatRedBall.Math.Geometry.Point[] { new FlatRedBall.Math.Geometry.Point(0, -50), new FlatRedBall.Math.Geometry.Point(0, 50), new FlatRedBall.Math.Geometry.Point(5, 35), new FlatRedBall.Math.Geometry.Point(-5, 35), new FlatRedBall.Math.Geometry.Point(0, 50) };
            ArrowPoly2.Points = ArrowPoly2Points;
            if (mArrowPoly3.Parent == null)
            {
                mArrowPoly3.CopyAbsoluteToRelative();
                mArrowPoly3.AttachTo(this, false);
            }
            if (ArrowPoly3.Parent == null)
            {
                ArrowPoly3.X = -58f;
            }
            else
            {
                ArrowPoly3.RelativeX = -58f;
            }
            if (ArrowPoly3.Parent == null)
            {
                ArrowPoly3.Y = 1f;
            }
            else
            {
                ArrowPoly3.RelativeY = 1f;
            }
            if (ArrowPoly3.Parent == null)
            {
                ArrowPoly3.RotationZ = 3.14f;
            }
            else
            {
                ArrowPoly3.RelativeRotationZ = 3.14f;
            }
            FlatRedBall.Math.Geometry.Point[] ArrowPoly3Points = new FlatRedBall.Math.Geometry.Point[] { new FlatRedBall.Math.Geometry.Point(0, -50), new FlatRedBall.Math.Geometry.Point(0, 50), new FlatRedBall.Math.Geometry.Point(5, 35), new FlatRedBall.Math.Geometry.Point(-5, 35), new FlatRedBall.Math.Geometry.Point(0, 50) };
            ArrowPoly3.Points = ArrowPoly3Points;
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }