Exemplo n.º 1
0
        public override void LoadContent()
        {
            _song = Game.Content.Load<Song>("bgm/menuBgm");
            _font = Game.Content.Load<SpriteFont>("Bauhaus");
            _elements = Game.Content.Load<SoundEffect>("sfx/elements01");

            _tutorial = Game.Content.Load<Texture2D>("img/tutorial");

            MediaPlayer.Play(_song);
            _textBounds = new RotatableRectangleF(_font.MeasureString("[Enter] to Play"))
            {
                Center = new Vector2(
                    x: .5f * Game.GraphicsDevice.PresentationParameters.BackBufferWidth,
                    y: Game.GraphicsDevice.PresentationParameters.BackBufferHeight - 100)
            };

            //Should be disposed :)
            _waiter = Wait.Until(time =>
            {
                _textBounds.Rotation = (float) Math.Sin(time.Alive*MathHelper.TwoPi)*.25f;
                _textBounds.Scale = 1.5f*new Vector2(
                    .5f + (float) Math.Sin((time.Alive*MathHelper.TwoPi)%MathHelper.Pi));
                return false;
            }, null, -1);
        }
Exemplo n.º 2
0
 public static Waiter Until(Step step, Action completed = null, int repeat = 1)
 {
     Waiter waiter = new Waiter(step, completed, repeat);
     Waiters.Add(waiter);
     return waiter;
 }