예제 #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);
            }
            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;
        }
예제 #2
0
        // Generated Methods
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            this.AfterSizeSet      += OnAfterSizeSet;
            this.AfterIntensitySet += OnAfterIntensitySet;
            if (IconSprite.Parent == null)
            {
                IconSprite.CopyAbsoluteToRelative();
                IconSprite.AttachTo(this, false);
            }
            IconSprite.TextureScale = 1f;
                        #if FRB_MDX
            IconSprite.ColorOperation = Microsoft.DirectX.Direct3D.TextureOperation.Subtract;
                        #else
            IconSprite.ColorOperation = FlatRedBall.Graphics.ColorOperation.Subtract;
                        #endif
            if (HighlightSprite.Parent == null)
            {
                HighlightSprite.CopyAbsoluteToRelative();
                HighlightSprite.AttachTo(this, false);
            }
            HighlightSprite.Texture      = IconHighlight;
            HighlightSprite.TextureScale = 1f;
            if (HighlightSprite.Parent == null)
            {
                HighlightSprite.Z = -0.01f;
            }
            else
            {
                HighlightSprite.RelativeZ = -0.01f;
            }
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
예제 #3
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      = ballt;
            SpriteInstance.TextureScale = 1f;
            SpriteInstance.Width        = 10f;
            SpriteInstance.Height       = 10f;
            if (mAxisAlignedRectangleInstance.Parent == null)
            {
                mAxisAlignedRectangleInstance.CopyAbsoluteToRelative();
                mAxisAlignedRectangleInstance.AttachTo(this, false);
            }
            AxisAlignedRectangleInstance.Width   = 10f;
            AxisAlignedRectangleInstance.Height  = 10f;
            AxisAlignedRectangleInstance.Visible = false;
            AxisAlignedRectangleInstance.Color   = Microsoft.Xna.Framework.Color.Violet;
            mGeneratedCollision = new FlatRedBall.Math.Geometry.ShapeCollection();
            Collision.AxisAlignedRectangles.AddOneWay(mAxisAlignedRectangleInstance);
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
예제 #4
0
파일: Hero.cs 프로젝트: MaciejSzpakowski/mu
        public Hero(string name, HeroClass heroClass)
        {
            Collect = false;
            Online = TimeSpan.Zero;
            Target = Position;
            AcceptArrows = true;
            zLastPosition = Position;
            Netid = 0;
            Name = name;
            Class = heroClass;
            Position.Z = ZLayer.Npc;
            WalkingSpeed = 10;

            SpriteManager.AddPositionedObject(this);

            Collider = ShapeManager.AddCircle();
            Collider.AttachTo(this, false);
            Collider.Visible = false;

            Sprite = LoadSprite();
            Sprite.AttachTo(this, false);
            Sprite.Resize(4);
            Sprite.AnimationSpeed = 0.1f;            

            Label = TextManager.AddText(name, Globals.Font);
            Label.AttachTo(this, false);
            Label.HorizontalAlignment = HorizontalAlignment.Center;
            Label.RelativePosition = new Vector3(0, 4, ZLayer.NpcLabel - Position.Z);            

            InitStats();
        }
예제 #5
0
        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;
        }
예제 #6
0
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (BackgroundSprite.Parent == null)
            {
                BackgroundSprite.CopyAbsoluteToRelative();
                BackgroundSprite.AttachTo(this, false);
            }
            if (BackgroundSprite.Parent == null)
            {
                BackgroundSprite.X = -161f;
            }
            else
            {
                BackgroundSprite.RelativeX = -161f;
            }
            if (BackgroundSprite.Parent == null)
            {
                BackgroundSprite.Y = 24f;
            }
            else
            {
                BackgroundSprite.RelativeY = 24f;
            }
            BackgroundSprite.Texture      = sky1;
            BackgroundSprite.TextureScale = 1f;
            BackgroundSprite.UseAnimationRelativePosition = true;
            BackgroundSprite.Animate = true;
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
예제 #7
0
        // Generated Methods
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (mCollision.Parent == null)
            {
                mCollision.CopyAbsoluteToRelative();
                mCollision.AttachTo(this, false);
            }
            Collision.Width   = 32f;
            Collision.Height  = 32f;
            Collision.Visible = false;
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.CopyAbsoluteToRelative();
                SpriteInstance.AttachTo(this, false);
            }
            SpriteInstance.TextureScale     = 2f;
            SpriteInstance.AnimationChains  = AnimationChainListFile;
            SpriteInstance.CurrentChainName = "Enemy";
            if (mBulletPosRect.Parent == null)
            {
                mBulletPosRect.CopyAbsoluteToRelative();
                mBulletPosRect.AttachTo(this, false);
            }
            BulletPosRect.Width   = 5f;
            BulletPosRect.Height  = 5f;
            BulletPosRect.Visible = false;
            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;
            this.Click += OnClick;
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.CopyAbsoluteToRelative();
                SpriteInstance.AttachTo(this, false);
            }
            SpriteInstance.TextureScale = 1f;
            SpriteInstance.Red          = 0.1f;
            SpriteInstance.Green        = 0.1f;
            SpriteInstance.Blue         = 0.1f;
            if (TextInstance.Parent == null)
            {
                TextInstance.CopyAbsoluteToRelative();
                TextInstance.AttachTo(this, false);
            }
            if (TextInstance.Parent == null)
            {
                TextInstance.Z = 5f;
            }
            else
            {
                TextInstance.RelativeZ = 5f;
            }
            TextInstance.AdjustPositionForPixelPerfectDrawing = false;
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
예제 #9
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;
        }
예제 #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      = 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;
        }
예제 #11
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;
        }
예제 #12
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 = 16f;
            }
            else
            {
                SpriteInstance.RelativeX = 16f;
            }
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.Z = 1f;
            }
            else
            {
                SpriteInstance.RelativeZ = 1f;
            }
            SpriteInstance.Texture      = arrow;
            SpriteInstance.TextureScale = 1f;
            SpriteInstance.Width        = 8f;
            SpriteInstance.Height       = 8f;
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
예제 #13
0
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (BackgroundSprite.Parent == null)
            {
                BackgroundSprite.CopyAbsoluteToRelative();
                BackgroundSprite.AttachTo(this, false);
            }
            if (BackgroundSprite.Parent == null)
            {
                BackgroundSprite.Z = -1f;
            }
            else
            {
                BackgroundSprite.RelativeZ = -1f;
            }
            BackgroundSprite.TextureScale = 1f;
            BackgroundSprite.Width        = 100f;
            BackgroundSprite.Height       = 100f;
            #if FRB_MDX
            BackgroundSprite.ColorOperation = Microsoft.DirectX.Direct3D.TextureOperation.ColorTextureAlpha;
            #else
            BackgroundSprite.ColorOperation = FlatRedBall.Graphics.ColorOperation.ColorTextureAlpha;
            #endif
            BackgroundSprite.Alpha            = 0.75f;
            SpriteInstance.Texture            = AllAssetsSheet;
            SpriteInstance.LeftTexturePixel   = 404f;
            SpriteInstance.RightTexturePixel  = 468f;
            SpriteInstance.TopTexturePixel    = 30f;
            SpriteInstance.BottomTexturePixel = 92f;
            SpriteInstance.TextureScale       = 1f;
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
예제 #14
0
        // Generated Methods
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (mCollision.Parent == null)
            {
                mCollision.CopyAbsoluteToRelative();
                mCollision.AttachTo(this, false);
            }
            Collision.Height  = 100f;
            Collision.Width   = 75f;
            Collision.Color   = Color.Red;
            Collision.Visible = true;
            if (Sprite.Parent == null)
            {
                Sprite.CopyAbsoluteToRelative();
                Sprite.AttachTo(this, false);
            }
            Sprite.Texture      = PlayerTexture;
            Sprite.TextureScale = 1f;
            if (Sprite.Parent == null)
            {
                Sprite.Z = 5f;
            }
            else
            {
                Sprite.RelativeZ = 5f;
            }
            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            = broom2;
            SpriteInstance.FlipHorizontal     = false;
            SpriteInstance.LeftTexturePixel   = 166f;
            SpriteInstance.RightTexturePixel  = 224f;
            SpriteInstance.TopTexturePixel    = 424f;
            SpriteInstance.BottomTexturePixel = 622f;
            SpriteInstance.Width  = 25f;
            SpriteInstance.Height = 100f;
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.RotationZ = 0.25f;
            }
            else
            {
                SpriteInstance.RelativeRotationZ = 0.25f;
            }
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
예제 #16
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            = luckyblocknormal;
            SpriteInstance.TextureAddressMode = Microsoft.Xna.Framework.Graphics.TextureAddressMode.Clamp;
            SpriteInstance.TextureScale       = 1f;
            if (mAxisAlignedRectangleInstance.Parent == null)
            {
                mAxisAlignedRectangleInstance.CopyAbsoluteToRelative();
                mAxisAlignedRectangleInstance.AttachTo(this, false);
            }
            AxisAlignedRectangleInstance.Width   = 16f;
            AxisAlignedRectangleInstance.Height  = 15.9f;
            AxisAlignedRectangleInstance.Visible = false;
            AxisAlignedRectangleInstance.RepositionDirections = FlatRedBall.Math.Geometry.RepositionDirections.All;
            mGeneratedCollision = new FlatRedBall.Math.Geometry.ShapeCollection();
            Collision.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 (Tread1.Parent == null)
            {
                Tread1.CopyAbsoluteToRelative();
                Tread1.AttachTo(this, false);
            }
            if (Tread1.Parent == null)
            {
                Tread1.Y = 10f;
            }
            else
            {
                Tread1.RelativeY = 10f;
            }
            if (Tread1.Parent == null)
            {
                Tread1.Z = 0.1f;
            }
            else
            {
                Tread1.RelativeZ = 0.1f;
            }
            Tread1.TextureScale = 1f;
            Tread1.UseAnimationRelativePosition = false;
            Tread1.Animate          = false;
            Tread1.AnimationChains  = Particles;
            Tread1.CurrentChainName = "TankTread";
            if (Tread2.Parent == null)
            {
                Tread2.CopyAbsoluteToRelative();
                Tread2.AttachTo(this, false);
            }
            if (Tread2.Parent == null)
            {
                Tread2.Y = -10f;
            }
            else
            {
                Tread2.RelativeY = -10f;
            }
            if (Tread2.Parent == null)
            {
                Tread2.Z = 0.1f;
            }
            else
            {
                Tread2.RelativeZ = 0.1f;
            }
            Tread2.TextureScale = 1f;
            Tread2.UseAnimationRelativePosition = false;
            Tread2.Animate          = false;
            Tread2.AnimationChains  = Particles;
            Tread2.CurrentChainName = "TankTread";
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
예제 #18
0
        public SplineMover()
        {

            mVisibleRepresentation = SpriteManager.AddSprite(@"Content\Hud\MoveEntireSpline.png");
            SpriteManager.AddToLayer(mVisibleRepresentation, SpriteManager.TopLayer);
            mVisibleRepresentation.AttachTo(this, false);

            SpriteManager.AddPositionedObject(this);
        }
예제 #19
0
        // Generated Methods
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            this.AfterZSet             += OnAfterZSet;
            this.AfterParallaxImageSet += OnAfterParallaxImageSet;
            if (PS1.Parent == null)
            {
                PS1.CopyAbsoluteToRelative();
                PS1.AttachTo(this, false);
            }
            if (PS2.Parent == null)
            {
                PS2.CopyAbsoluteToRelative();
                PS2.AttachTo(this, false);
            }
            if (PS3.Parent == null)
            {
                PS3.CopyAbsoluteToRelative();
                PS3.AttachTo(this, false);
            }
            if (PS4.Parent == null)
            {
                PS4.CopyAbsoluteToRelative();
                PS4.AttachTo(this, false);
            }
            if (PS5.Parent == null)
            {
                PS5.CopyAbsoluteToRelative();
                PS5.AttachTo(this, false);
            }
            if (PS6.Parent == null)
            {
                PS6.CopyAbsoluteToRelative();
                PS6.AttachTo(this, false);
            }
            if (PS7.Parent == null)
            {
                PS7.CopyAbsoluteToRelative();
                PS7.AttachTo(this, false);
            }
            if (PS8.Parent == null)
            {
                PS8.CopyAbsoluteToRelative();
                PS8.AttachTo(this, false);
            }
            if (PS9.Parent == null)
            {
                PS9.CopyAbsoluteToRelative();
                PS9.AttachTo(this, false);
            }
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
예제 #20
0
        // Generated Methods
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (TextInstance.Parent == null)
            {
                TextInstance.CopyAbsoluteToRelative();
                TextInstance.AttachTo(this, false);
            }
            TextInstance.DisplayText     = "TEEEST";
            TextInstance.Font            = MazetechFont;
            TextInstance.NewLineDistance = 9f;
            TextInstance.Scale           = 6f;
            TextInstance.Spacing         = 6f;
            if (TextInstance.Parent == null)
            {
                TextInstance.Z = 15f;
            }
            else
            {
                TextInstance.RelativeZ = 15f;
            }
            TextInstance.HorizontalAlignment = FlatRedBall.Graphics.HorizontalAlignment.Center;
            TextInstance.VerticalAlignment   = FlatRedBall.Graphics.VerticalAlignment.Center;
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.CopyAbsoluteToRelative();
                SpriteInstance.AttachTo(this, false);
            }
            SpriteInstance.Texture      = MessageTexture;
            SpriteInstance.TextureScale = 2.5f;
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.Z = -10f;
            }
            else
            {
                SpriteInstance.RelativeZ = -10f;
            }
            SpriteInstance.Visible = true;
            if (mCollision.Parent == null)
            {
                mCollision.CopyAbsoluteToRelative();
                mCollision.AttachTo(this, false);
            }
            Collision.Color   = Color.Red;
            Collision.Height  = 200f;
            Collision.Visible = false;
            Collision.Width   = 32f;
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
예제 #21
0
        // Generated Methods
        public virtual void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            if (PlayerSprite.Parent == null)
            {
                PlayerSprite.CopyAbsoluteToRelative();
                PlayerSprite.AttachTo(this, false);
            }
            PlayerSprite.TextureScale = 0f;
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
예제 #22
0
        // Generated Methods
        public override void PostInitialize()
        {
            bool oldShapeManagerSuppressAdd = FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue;

            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = true;
            base.PostInitialize();
            if (mCollision.Parent == null)
            {
                mCollision.CopyAbsoluteToRelative();
                mCollision.AttachTo(this, false);
            }
            Collision.Height = 48f;
            Collision.Width  = 28f;
            if (SpriteInstance.Parent == null)
            {
                SpriteInstance.CopyAbsoluteToRelative();
                SpriteInstance.AttachTo(this, false);
            }
            SpriteInstance.AnimationChains  = AnimationChainListFile;
            SpriteInstance.TextureScale     = 1f;
            SpriteInstance.PixelSize        = 1.5f;
            SpriteInstance.CurrentChainName = "StandRight";
            if (HandSprite.Parent == null)
            {
                HandSprite.CopyAbsoluteToRelative();
                HandSprite.AttachTo(this, false);
            }
            HandSprite.AnimationChains  = AnimationChainListFile;
            HandSprite.TextureScale     = 1f;
            HandSprite.PixelSize        = 1.5f;
            HandSprite.CurrentChainName = "Hand";
            if (mGunRectangle.Parent == null)
            {
                mGunRectangle.CopyAbsoluteToRelative();
                mGunRectangle.AttachTo(this, false);
            }
            GunRectangle.Height  = 5f;
            GunRectangle.Visible = false;
            GunRectangle.Width   = 5f;
            if (mFedoraSprite.Parent == null)
            {
                mFedoraSprite.CopyAbsoluteToRelative();
                mFedoraSprite.AttachTo(this, false);
            }
            FedoraSprite.AnimationChains  = AnimationChainListFile;
            FedoraSprite.PixelSize        = 1f;
            FedoraSprite.CurrentChainName = "Fedora";
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
예제 #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);
            }
            SpriteInstance.Texture = FRB_icon;
            SpriteInstance.Width   = 50f;
            SpriteInstance.Height  = 50f;
            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);
            }
            SpriteInstance.TextureScale     = 1f;
            SpriteInstance.AnimationChains  = Brick_getting_killed;
            SpriteInstance.CurrentChainName = "The_brick_is_dead";
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
예제 #25
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;
        }
예제 #26
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         = CombinedAssets;
            SpriteInstance.TextureScale    = 1f;
            SpriteInstance.Animate         = true;
            SpriteInstance.AnimationChains = AnimationChainListFile;
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
예제 #27
0
        public CommandDisplay()
        {
            mLayer = SpriteManager.AddLayer();

            SpriteManager.AddPositionedObject(this);

            Texture2D texture = FlatRedBallServices.Load<Texture2D>(@"Assets\UI\LinkIcon.png", 
                "Global");

            mCreateLink = SpriteManager.AddSprite(texture, mLayer);

            mCreateLink.ScaleX = mCreateLink.ScaleY = .5f;
            mCreateLink.AttachTo(this, false);
            mCreateLink.RelativeX = -1.5f;
            mCreateLink.RelativeY = 1.5f;

        }
예제 #28
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            = healthpoint_texture;
            SpriteInstance.LeftTexturePixel   = 0f;
            SpriteInstance.RightTexturePixel  = 16f;
            SpriteInstance.TopTexturePixel    = 0f;
            SpriteInstance.BottomTexturePixel = 15f;
            SpriteInstance.TextureScale       = 1f;
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
예제 #29
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            = GameButtonsForGUIFREE;
            SpriteInstance.LeftTexturePixel   = 195f;
            SpriteInstance.RightTexturePixel  = 588f;
            SpriteInstance.TopTexturePixel    = 189f;
            SpriteInstance.BottomTexturePixel = 345f;
            SpriteInstance.TextureScale       = 0.5f;
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
예제 #30
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;
        }
예제 #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);
            }
            SpriteInstance.Texture                      = Spaceship_tut;
            SpriteInstance.LeftTexturePixel             = -6f;
            SpriteInstance.RightTexturePixel            = 170f;
            SpriteInstance.TopTexturePixel              = -6f;
            SpriteInstance.BottomTexturePixel           = 247f;
            SpriteInstance.TextureScale                 = 0.25f;
            SpriteInstance.UseAnimationRelativePosition = true;
            FlatRedBall.Math.Geometry.ShapeManager.SuppressAddingOnVisibilityTrue = oldShapeManagerSuppressAdd;
        }
예제 #32
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;
        }
예제 #33
0
        public SplineCrawler(Spline splineToMoveAlong)
        {
            ConstantVelocityValue = 3;

            mSpline = splineToMoveAlong;

            mVisibleRepresentation = SpriteManager.AddSprite("redball.bmp");
            mVisibleRepresentation.AttachTo(this, false);
            mVisibleRepresentation.ColorOperation = FlatRedBall.Graphics.ColorOperation.Add;
            mVisibleRepresentation.Blue = .5f;

            SpriteManager.AddPositionedObject(this);

            this.Position = mSpline.GetPositionAtTime(0);

            const float scaleMultiplier = 20; // so it pulses big for a sec
            mVisibleRepresentation.ScaleX = mVisibleRepresentation.ScaleY = 
                scaleMultiplier / SpriteManager.Camera.PixelsPerUnitAt(this.Z);

        }
예제 #34
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;
        }
예제 #35
0
        public void InitializeSprite(Texture2D texture, int row, int column)
        {
            this.SpriteSheetRow = row;
            this.SpriteSheetColumn = column;
            SpriteInstance = new Sprite();
            this.X = column * (int)MappingEnum.TileWidth;
            this.Y = -(row * (int)MappingEnum.TileHeight);

            SpriteInstance.Texture = texture;
            SpriteInstance.PixelSize = 0.5f;
            SpriteInstance.TopTexturePixel = row * (int)MappingEnum.TileHeight;
            SpriteInstance.LeftTexturePixel = column * (int)MappingEnum.TileWidth;
            SpriteInstance.BottomTexturePixel = (row + 1) * (int)MappingEnum.TileHeight;
            SpriteInstance.RightTexturePixel = (column + 1) * (int)MappingEnum.TileWidth;

            SpriteManager.AddSprite(SpriteInstance);
            SpriteInstance.AttachTo(this, false);
        }
예제 #36
0
파일: Mob.cs 프로젝트: MaciejSzpakowski/mu
 private void InitSprite(string file)
 {
     Sprite = Functions.AddSpriteFromAchx(Path.Make(Path.Mob, file));
     Sprite.CurrentChainName = "Idle";
     Sprite.Resize(4);
     Sprite.IgnoresParentVisibility = true;
     Sprite.AttachTo(this, false);
 }
예제 #37
0
        public EditorHandles()
        {
            spritesAlreadyChanged = new PositionedObjectList<PositionedObject>();

			Layer axisLayer = SpriteManager.AddLayer();

			origin = SpriteManager.AddSprite(
                FlatRedBallServices.Load<Texture2D>("Content/EditorHandles/Origin.png", GuiManager.InternalGuiContentManagerName), axisLayer);
			origin.Name = "OriginOfEditAxes";
			editAxisSpriteArray.Add(origin);
			
			xAxis = SpriteManager.AddSprite(
                FlatRedBallServices.Load<Texture2D>("Content/EditorHandles/MoveX.png", GuiManager.InternalGuiContentManagerName), axisLayer);

			editAxisSpriteArray.Add(xAxis);

			yAxis = SpriteManager.AddSprite(
                FlatRedBallServices.Load<Texture2D>("Content/EditorHandles/MoveY.png", GuiManager.InternalGuiContentManagerName), axisLayer);
			editAxisSpriteArray.Add(yAxis);

			zAxis = SpriteManager.AddSprite(
                FlatRedBallServices.Load<Texture2D>("Content/EditorHandles/MoveZ.png", GuiManager.InternalGuiContentManagerName), axisLayer);
			editAxisSpriteArray.Add(zAxis);

			xScale = SpriteManager.AddSprite(
                FlatRedBallServices.Load<Texture2D>("Content/EditorHandles/ScaleX.png", GuiManager.InternalGuiContentManagerName), axisLayer);
			editAxisSpriteArray.Add(xScale);

			yScale = SpriteManager.AddSprite(
                FlatRedBallServices.Load<Texture2D>("Content/EditorHandles/ScaleY.png", GuiManager.InternalGuiContentManagerName), axisLayer);
			editAxisSpriteArray.Add(yScale);

			xRot = SpriteManager.AddSprite(
                FlatRedBallServices.Load<Texture2D>("Content/EditorHandles/RotateX.png", GuiManager.InternalGuiContentManagerName), axisLayer);

			editAxisSpriteArray.Add(xRot);

			yRot = SpriteManager.AddSprite(
                FlatRedBallServices.Load<Texture2D>("Content/EditorHandles/RotateY.png", GuiManager.InternalGuiContentManagerName), axisLayer);
			

			
			editAxisSpriteArray.Add(yRot);

			xAxis.AttachTo(origin, true);
			yAxis.AttachTo(origin, true);
			zAxis.AttachTo(origin, true);
			xScale.AttachTo(origin, true);
			yScale.AttachTo(origin, true);
			xRot.AttachTo(origin, true);
			yRot.AttachTo(origin, true);

            Scale = 1;

            editAxisSpriteArray.Visible = false;
            mCursorOverAxis = false;
            mVisible = false;



        }