public CollisionBoxTimeline(BinaryReader BR, RobotAnimation Owner)
            : base(BR, TimelineType)
        {
            this.Owner = Owner;

            int ListCollisionPolygonCount = BR.ReadInt32();

            ListCollisionPolygon = new List <Polygon>(ListCollisionPolygonCount);
            ListOriginalPolygon  = new List <Polygon>();
            for (int P = ListCollisionPolygonCount - 1; P >= 0; --P)
            {
                Polygon NewPolygon = new Polygon(BR, 1, 1);
                ListCollisionPolygon.Add(new Polygon(NewPolygon));
                ListOriginalPolygon.Add(new Polygon(NewPolygon));
            }

            ComputeSourceRectangle();

            Origin = new Point(Width / 2, Height / 2);

            int DicAnimationSpriteKeyFrameCount = BR.ReadInt32();

            for (int E = 0; E < DicAnimationSpriteKeyFrameCount; E++)
            {
                int Key = BR.ReadInt32();

                VisibleAnimationObjectKeyFrame NewAnimatedBitmapKeyFrame = new VisibleAnimationObjectKeyFrame(BR);

                DicAnimationKeyFrame.Add(Key, NewAnimatedBitmapKeyFrame);
            }
        }
        public SpriteSheetTimeline(BinaryReader BR, ContentManager Content)
            : base(BR, TimelineType)
        {
            SpriteSheetName        = BR.ReadString();
            SourceRectangle        = new Rectangle();
            SourceRectangle.X      = BR.ReadInt32();
            SourceRectangle.Y      = BR.ReadInt32();
            SourceRectangle.Width  = BR.ReadInt32();
            SourceRectangle.Height = BR.ReadInt32();

            int DicAnimationSpriteKeyFrameCount = BR.ReadInt32();

            for (int E = 0; E < DicAnimationSpriteKeyFrameCount; E++)
            {
                int Key = BR.ReadInt32();

                VisibleAnimationObjectKeyFrame NewAnimatedBitmapKeyFrame = new VisibleAnimationObjectKeyFrame(BR);

                DicAnimationKeyFrame.Add(Key, NewAnimatedBitmapKeyFrame);
            }

            if (Content != null)
            {
                SpriteSheet = Content.Load <Texture2D>("Animations/Sprite Sheets/" + SpriteSheetName);
            }

            Origin = new Point(Width / 2, Height / 2);
        }
Пример #3
0
        public ParticleEmitterTimeline(BinaryReader BR, ContentManager Content)
            : base(BR, TimelineType)
        {
            Matrix view = Matrix.Identity;

            Matrix Projection      = Matrix.CreateOrthographicOffCenter(0, 800, 600, 0, 0, 1);
            Matrix HalfPixelOffset = Matrix.CreateTranslation(-0.5f, -0.5f, 0);

            Projection = view * (HalfPixelOffset * Projection);

            Particle3DSample.ParticleSettings ParticleSettings = new Particle3DSample.ParticleSettings();
            ParticleSettings.TextureName       = BR.ReadString();
            ParticleSettings.MaxParticles      = 20000;
            ParticleSettings.MinScale          = new Vector2(1, 1);
            ParticleSettings.DurationInSeconds = 1d;
            ParticleSettings.Gravity           = new Vector2(0, 0);
            ParticleSettings.NumberOfImages    = 16;
            ParticleSettings.BlendState        = BlendState.AlphaBlend;
            ParticleSettings.StartingAlpha     = 0.7f;
            ParticleSettings.EndAlpha          = 0.1f;

            _SpawnOffset       = new Vector2(BR.ReadSingle(), BR.ReadSingle());
            _SpawnOffsetRandom = new Vector2(BR.ReadSingle(), BR.ReadSingle());
            SpawnSpeed         = new Vector2(BR.ReadSingle(), BR.ReadSingle());
            SpawnSpeedRandom   = new Vector2(BR.ReadSingle(), BR.ReadSingle());

            ParticlesPerSeconds = BR.ReadDouble();
            ParticleSettings.DurationInSeconds = BR.ReadSingle();
            float SpeedMultiplier = BR.ReadSingle();

            ParticleSettings.NumberOfImages = BR.ReadInt32();
            ParticleSettings.Gravity        = new Vector2(BR.ReadSingle(), BR.ReadSingle());
            Vector2 Size = new Vector2(BR.ReadSingle(), BR.ReadSingle());

            ParticleSettings.MinScale      = new Vector2(BR.ReadSingle(), BR.ReadSingle());
            ParticleSettings.StartingAlpha = BR.ReadSingle();
            ParticleSettings.EndAlpha      = BR.ReadSingle();
            _ParticleBlendState            = (ParticleBlendStates)BR.ReadByte();

            TimeBetweenEachParticle = 1 / ParticlesPerSeconds;
            ParticleSystem          = new Particle3DSample.ParticleSystem(ParticleSettings);
            ParticleSystem.LoadContent(Content, GameScreen.GraphicsDevice, Projection);

            this.SpeedMultiplier = SpeedMultiplier;
            this.Size            = Size;
            UpdateSize();

            int DicAnimationSpriteKeyFrameCount = BR.ReadInt32();

            for (int E = 0; E < DicAnimationSpriteKeyFrameCount; E++)
            {
                int Key = BR.ReadInt32();

                VisibleAnimationObjectKeyFrame NewAnimatedBitmapKeyFrame = new VisibleAnimationObjectKeyFrame(BR);

                DicAnimationKeyFrame.Add(Key, NewAnimatedBitmapKeyFrame);
            }

            Origin = new Point(Width / 2, Height / 2);
        }
        public GunNozzleTimeline(BinaryReader BR, RobotAnimation Owner)
            : base(BR, TimelineType)
        {
            Origin     = new Point(Width / 2, Height / 2);
            this.Owner = Owner;
            if (Owner != null)
            {
                this.OwnerWeapon = Owner.ActiveAddedWeapon;
            }

            _SpawnFrame           = BR.ReadInt32();
            _DeathFrame           = BR.ReadInt32();
            _ShootSecondaryWeapon = BR.ReadBoolean();

            int DicAnimationSpriteKeyFrameCount = BR.ReadInt32();

            for (int E = 0; E < DicAnimationSpriteKeyFrameCount; E++)
            {
                int Key = BR.ReadInt32();

                VisibleAnimationObjectKeyFrame NewAnimatedBitmapKeyFrame = new VisibleAnimationObjectKeyFrame(BR);

                DicAnimationKeyFrame.Add(Key, NewAnimatedBitmapKeyFrame);
            }
        }
        public AnimationOriginTimeline(BinaryReader BR)
            : base(BR, TimelineType)
        {
            Origin = new Point(BR.ReadInt32(), BR.ReadInt32());

            int DicAnimationSpriteKeyFrameCount = BR.ReadInt32();

            for (int E = 0; E < DicAnimationSpriteKeyFrameCount; E++)
            {
                int Key = BR.ReadInt32();

                VisibleAnimationObjectKeyFrame NewAnimatedBitmapKeyFrame = new VisibleAnimationObjectKeyFrame(BR);

                DicAnimationKeyFrame.Add(Key, NewAnimatedBitmapKeyFrame);
            }
        }
        public SceneObjectTimeline(BinaryReader BR, SceneObject SceneObject)
            : base(BR, TimelineType)
        {
            this.SceneObject = SceneObject;

            int DicAnimationSpriteKeyFrameCount = BR.ReadInt32();

            for (int E = 0; E < DicAnimationSpriteKeyFrameCount; E++)
            {
                int Key = BR.ReadInt32();

                VisibleAnimationObjectKeyFrame NewAnimatedBitmapKeyFrame = new VisibleAnimationObjectKeyFrame(BR);

                DicAnimationKeyFrame.Add(Key, NewAnimatedBitmapKeyFrame);
            }
        }
Пример #7
0
        private ENTimeline(BinaryReader BR, ContentManager Content)
            : base(BR, TimelineType)
        {
            _SpawnFrame = BR.ReadInt32();
            _DeathFrame = BR.ReadInt32();

            fntDamage = Content.Load <SpriteFont>("Fonts/Finlander Font");

            int DicAnimationSpriteKeyFrameCount = BR.ReadInt32();

            for (int E = 0; E < DicAnimationSpriteKeyFrameCount; E++)
            {
                int Key = BR.ReadInt32();

                ENKeyFrame NewAnimatedBitmapKeyFrame = new ENKeyFrame(BR);

                DicAnimationKeyFrame.Add(Key, NewAnimatedBitmapKeyFrame);
            }
        }
Пример #8
0
        public AnimatedChainTimeline(BinaryReader BR, ContentManager Content)
            : base(BR, TimelineType)
        {
            ListCurrentChainSplinePoints = new List <Vector2>();

            Origin = new Point(BR.ReadInt32(), BR.ReadInt32());

            ChainLinkPath = BR.ReadString();

            if (Content != null && !string.IsNullOrEmpty(ChainLinkPath))
            {
                ChainLink        = new AnimatedSprite(Content, "Animations/Sprites/" + ChainLinkPath, Vector2.Zero);
                ChainLink.Origin = new Vector2(BR.ReadSingle(), BR.ReadSingle());
            }

            ChainEndPath = BR.ReadString();
            if (Content != null && !string.IsNullOrEmpty(ChainEndPath))
            {
                ChainEnd        = new AnimatedSprite(Content, "Animations/Sprites/" + ChainEndPath, Vector2.Zero);
                ChainEnd.Origin = new Vector2(BR.ReadSingle(), BR.ReadSingle());
            }

            ChainStartPath = BR.ReadString();
            if (Content != null && !string.IsNullOrEmpty(ChainStartPath))
            {
                ChainStart        = new AnimatedSprite(Content, "Animations/Sprites/" + ChainStartPath, Vector2.Zero);
                ChainStart.Origin = new Vector2(BR.ReadSingle(), BR.ReadSingle());
            }

            int DicAnimationSpriteKeyFrameCount = BR.ReadInt32();

            for (int E = 0; E < DicAnimationSpriteKeyFrameCount; E++)
            {
                int Key = BR.ReadInt32();

                AnimatedChainKeyFrame NewAnimatedBitmapKeyFrame = new AnimatedChainKeyFrame(BR);

                DicAnimationKeyFrame.Add(Key, NewAnimatedBitmapKeyFrame);
            }
        }
Пример #9
0
        private UITimeline(BinaryReader BR, ContentManager Content)
            : base(BR, TimelineType)
        {
            fntFinlanderFont           = Content.Load <SpriteFont>("Fonts/Finlander Font");
            sprBarExtraLargeBackground = Content.Load <Texture2D>("Battle/Bars/Extra Long Bar");
            sprBarExtraLargeEN         = Content.Load <Texture2D>("Battle/Bars/Extra Long Energy");
            sprBarExtraLargeHP         = Content.Load <Texture2D>("Battle/Bars/Extra Long Health");
            sprInfinity = Content.Load <Texture2D>("Battle/Infinity");

            _SpawnFrame = BR.ReadInt32();
            _DeathFrame = BR.ReadInt32();

            int DicAnimationSpriteKeyFrameCount = BR.ReadInt32();

            for (int E = 0; E < DicAnimationSpriteKeyFrameCount; E++)
            {
                int Key = BR.ReadInt32();

                VisibleAnimationObjectKeyFrame NewAnimatedBitmapKeyFrame = new VisibleAnimationObjectKeyFrame(BR);

                DicAnimationKeyFrame.Add(Key, NewAnimatedBitmapKeyFrame);
            }
        }
        public AnimatedBitmapTimeline(BinaryReader BR, ContentManager Content)
            : base(BR, TimelineType)
        {
            Origin = new Point(BR.ReadInt32(), BR.ReadInt32());


            BitmapName = BR.ReadString();
            if (Content != null)
            {
                ActiveSprite = new AnimatedSprite(Content, "Animations/Sprites/" + BitmapName, Vector2.Zero);
            }

            int DicAnimationSpriteKeyFrameCount = BR.ReadInt32();

            for (int E = 0; E < DicAnimationSpriteKeyFrameCount; E++)
            {
                int Key = BR.ReadInt32();

                AnimatedBitmapKeyFrame NewAnimatedBitmapKeyFrame = new AnimatedBitmapKeyFrame(BR);

                DicAnimationKeyFrame.Add(Key, NewAnimatedBitmapKeyFrame);
            }
        }
Пример #11
0
        public ChargeAttackTimeline(BinaryReader BR, RobotAnimation Owner)
            : base(BR, TimelineType)
        {
            Origin     = new Point(Width / 2, Height / 2);
            this.Owner = Owner;

            _SpawnFrame           = BR.ReadInt32();
            _DeathFrame           = BR.ReadInt32();
            _ShootSecondaryWeapon = BR.ReadBoolean();
            _MaxCharge            = BR.ReadInt32();
            _ChargeAmountPerFrame = BR.ReadInt32();

            int DicAnimationSpriteKeyFrameCount = BR.ReadInt32();

            for (int E = 0; E < DicAnimationSpriteKeyFrameCount; E++)
            {
                int Key = BR.ReadInt32();

                VisibleAnimationObjectKeyFrame NewAnimatedBitmapKeyFrame = new VisibleAnimationObjectKeyFrame(BR);

                DicAnimationKeyFrame.Add(Key, NewAnimatedBitmapKeyFrame);
            }
        }
        public AnimatedTileTimeline(BinaryReader BR, ContentManager Content)
            : base(BR, TimelineType)
        {
            Origin = new Point(BR.ReadInt32(), BR.ReadInt32());

            BitmapName = BR.ReadString();
            if (Content != null)
            {
                ActiveSprite = Content.Load <Texture2D>("Animations/Sprites/" + BitmapName);
            }

            _MaxWidth = BR.ReadInt32();

            int DicAnimationSpriteKeyFrameCount = BR.ReadInt32();

            for (int E = 0; E < DicAnimationSpriteKeyFrameCount; E++)
            {
                int Key = BR.ReadInt32();

                AnimatedTileKeyFrame NewAnimatedBitmapKeyFrame = new AnimatedTileKeyFrame(BR);

                DicAnimationKeyFrame.Add(Key, NewAnimatedBitmapKeyFrame);
            }
        }
Пример #13
0
        public MarkerTimeline(BinaryReader BR, ContentManager Content)
            : base(BR, TimelineType)
        {
            BitmapName  = BR.ReadString();
            _MarkerType = BR.ReadString();

            if (!string.IsNullOrEmpty(BitmapName) && Content != null)
            {
                Sprite = Content.Load <Texture2D>("Animations/Sprites/" + BitmapName);
            }

            Origin = new Point(Width / 2, Height / 2);

            int DicAnimationSpriteKeyFrameCount = BR.ReadInt32();

            for (int E = 0; E < DicAnimationSpriteKeyFrameCount; E++)
            {
                int Key = BR.ReadInt32();

                VisibleAnimationObjectKeyFrame NewAnimatedBitmapKeyFrame = new VisibleAnimationObjectKeyFrame(BR);

                DicAnimationKeyFrame.Add(Key, NewAnimatedBitmapKeyFrame);
            }
        }
Пример #14
0
        public PolygonCutterTimeline(BinaryReader BR, AnimationClass.AnimationLayer ActiveLayer)
            : base(BR, TimelineType)
        {
            this.ActiveLayer            = ActiveLayer;
            _PolygonCutterType          = (PolygonCutterTypes)BR.ReadByte();
            _PolygonCutterSpecialEffect = (PolygonCutterSpecialEffects)BR.ReadByte();

            ListPolygon = new List <Polygon>();

            float MinX = float.MaxValue;
            float MaxX = float.MinValue;
            float MinY = float.MaxValue;
            float MaxY = float.MinValue;

            foreach (Polygon ActivePolygon in ListPolygon)
            {
                for (int V = 0; V < ActivePolygon.VertexCount; V++)
                {
                    int VertexX = (int)ActivePolygon.ArrayVertex[V].X;
                    int VertexY = (int)ActivePolygon.ArrayVertex[V].Y;

                    if (VertexX < MinX)
                    {
                        MinX = VertexX;
                    }
                    if (VertexX > MaxX)
                    {
                        MaxX = VertexX;
                    }

                    if (VertexY < MinY)
                    {
                        MinY = VertexY;
                    }
                    if (VertexY > MaxY)
                    {
                        MaxY = VertexY;
                    }
                }
            }

            SourceRectangle = new Rectangle((int)MinX, (int)MinY, (int)(MaxX - MinX), (int)(MaxY - MinY));
            Origin          = new Point(Width / 2, Height / 2);

            int DicAnimationSpriteKeyFrameCount = BR.ReadInt32();

            for (int E = 0; E < DicAnimationSpriteKeyFrameCount; E++)
            {
                int Key = BR.ReadInt32();

                PolygonCutterKeyFrame NewPolygonCutterKeyFrame = new PolygonCutterKeyFrame(BR, ActiveLayer);

                DicAnimationKeyFrame.Add(Key, NewPolygonCutterKeyFrame);
            }

            int FirstKey = int.MaxValue;

            foreach (int ActiveKey in DicAnimationKeyFrame.Keys)
            {
                if (FirstKey > ActiveKey)
                {
                    FirstKey = ActiveKey;
                }
            }
            PolygonCutterKeyFrame FirstKeyFrame = (PolygonCutterKeyFrame)DicAnimationKeyFrame[FirstKey];

            for (int P = 0; P < FirstKeyFrame.ListPolygon.Count; P++)
            {
                Polygon ActivePolygon = new Polygon(FirstKeyFrame.ListPolygon[P]);
                ListPolygon.Add(ActivePolygon);
            }
        }