Пример #1
0
        public AnimateActionState(Sprite target, Animate action)
            : base(target, action)
        {
            _sprite = target;
            Animation = action.Animation;
            SplitTimes = new Bag<float>(action.SplitTimes);

            _originalFrame = Animation.RestoreOriginalSprite ? target.Frame : null;
            _framesCount = Animation.Frames.Count;
            _nextFrame = 0;
            _executedLoops = 0;
        }
Пример #2
0
        public MainMenu(MainStage stage)
            : base(stage)
        {
            Visible = true;
            _stage = stage;
            var logo = new Sprite {Frame = SkidiGame.ResourceManager.GetFrame("logo")};
            logo.Size *= SkidiBirdGame.Scale;

            Add(new GridLayout(SkidiGame.ScreenBounds, (int)(24 * SkidiBirdGame.Scale))
            {
                new Row(1f)
                {
                    new HColumn(1f)
                    {
                        HorizontalAlign = HorizontalAlign.Left,
                        VerticalAlign = VerticalAlign.Top,
                        Items = { new Buttons.SoundSwitch() }
                    }
                }
            });

            Add(new GridLayout(SkidiGame.ScreenBounds, 12)
            {
                Rows =
                {
                    new Row(.5f)
                    {
                        new HColumn(1f) {logo}
                    },
                    new Row(.3f)
                    {
                        new HColumn(1f) { new Buttons.PlayButton(PlayBtnClick) }
                    }
                }
            });
        }
Пример #3
0
        private Sprite CreateGround()
        {
            var frame = SkidiGame.ResourceManager.GetFrame("grass");
            var sizeScale = SkidiGame.ScreenBounds.Width/frame.Size.X;

            var result = new Sprite(frame);
            result.Size *= sizeScale;

            result.Position = new Vector2(0, SkidiGame.ScreenBounds.Height - result.Size.Y);
            return result;
        }