Esempio n. 1
0
        public Finish(int Distance, int WidthScreen, int HeightScreen)
        {
            _widthScreen  = WidthScreen;
            this.Distance = Distance;

            Sprite = new AnimationSprite(new Bitmap(MainSpace.SelfRef.SpriteFolder + "FinishLine.png"))
            {
                Name = "Finish", Zindex = 1, Visible = true
            };
            Sprite.Transform(Distance * WidthScreen, 0, WidthScreen * 0.1F, HeightScreen);
            AnimationManager.Animations.Add(Sprite);

            WinAnim = new AnimationSprite()
            {
                Name = "WinAnim", Zindex = 100, Visible = false
            };
            for (int i = 1; i < 33; i++)
            {
                WinAnim.Frame.Add(new Bitmap(MainSpace.SelfRef.SpriteFolder + "WinFrame" + i + ".gif"));
            }
            WinAnim.Transform(0, 0, WidthScreen, HeightScreen);
            AnimationManager.Animations.Add(WinAnim);

            LoseAnim = new AnimationSprite()
            {
                Name = "LoseAnim", Zindex = 100, Visible = false
            };
            for (int i = 1; i < 9; i++)
            {
                LoseAnim.Frame.Add(new Bitmap(MainSpace.SelfRef.SpriteFolder + "LoseFrame" + i + ".gif"));
            }
            LoseAnim.Transform(0, 0, WidthScreen, HeightScreen);
            AnimationManager.Animations.Add(LoseAnim);
        }
Esempio n. 2
0
        public PostProcessing(float WidthScreen, float HeightScreen)
        {
            PPLight = new AnimationSprite()
            {
                Name    = "PPLight",
                Group   = "PostProcessing",
                Zindex  = 201,
                Visible = true,
                Width   = WidthScreen,
                Height  = HeightScreen,
                Left    = 0,
                Top     = 0
            };
            PPLight.Frame.Add(new Bitmap(MainSpace.SelfRef.SpriteFolder + "PPLight.png"));
            AnimationManager.Animations.Add(PPLight);

            PPeclipse = new AnimationSprite()
            {
                Name    = "PPLight",
                Group   = "PostProcessing",
                Zindex  = 200,
                Visible = true,
                Width   = WidthScreen,
                Height  = HeightScreen,
                Left    = 0,
                Top     = 0
            };
            PPeclipse.Frame.Add(new Bitmap(MainSpace.SelfRef.SpriteFolder + "PPeclipse.png"));
            AnimationManager.Animations.Add(PPeclipse);
        }
        public void Remove_Road_Parts()
        {
            AnimationSprite left = null, right = null;

            foreach (AnimationSprite road in RoadParts)
            {
                if (road.Left + WidthScreen > WidthScreen * 4)
                {
                    left = road;
                }

                if (road.Left - WidthScreen < WidthScreen * -4)
                {
                    right = road;
                }
            }

            if (left != null)
            {
                AnimationManager.Animations.Remove(left);
                RoadParts.Remove(left);
            }

            if (right != null)
            {
                AnimationManager.Animations.Remove(right);
                RoadParts.Remove(right);
            }
        }
 public void Create_Road_Parts(float Left)
 {
     _template = new AnimationSprite()
     {
         Name    = _spriteNames[_rand.Next(0, _spriteNames.Length)],
         Group   = "Road",
         Zindex  = -1,
         Visible = true
     };
     _template.Frame.Add(new Bitmap(MainSpace.SelfRef.SpriteFolder + _template.Name + ".png"));
     _template.Transform(Left, 0, WidthScreen, HeightScreen);
     AnimationManager.Animations.Add(_template);
     RoadParts.Add(_template);
 }
 public void Paint()
 {
     _template = new AnimationSprite()
     {
         Name    = "TrackStop",
         Group   = "TrackStop",
         Zindex  = 2,
         Visible = true,
         Width   = Controller.Width * 0.2F,
         Height  = Controller.Height,
         Left    = Controller.Left - Width,
         Top     = Controller.Top
     };
     _template.Frame.Add(new Bitmap(MainSpace.SelfRef.SpriteFolder + "RoadTrack.png"));
     _tracks.Add(_template);
     AnimationManager.Animations.Add(_template);
 }
Esempio n. 6
0
 public AnimationSprite Clone()
 {
     _animation = new AnimationSprite()
     {
         Name    = Name,
         Group   = Group,
         Zindex  = Zindex,
         IndexOf = IndexOf,
         IsLoop  = IsLoop,
         Visible = Visible,
         Top     = Top,
         Left    = Left,
         Width   = Width,
         Height  = Height
     };
     _animation.Frame.AddRange(Frame.ToArray());
     return(_animation);
 }
        public void Remove(float widthScreen)
        {
            AnimationSprite left = null;

            foreach (AnimationSprite track in _tracks)
            {
                if (track.Left - widthScreen < widthScreen * -4)
                {
                    left = track;
                }
            }

            if (left != null)
            {
                AnimationManager.Animations.Remove(left);
                _tracks.Remove(left);
            }
        }