Exemplo n.º 1
0
 public override void Advance()
 {
     if (hide) {
         FadeAnimation animation = new FadeAnimation(game);
         animation.FromImage = game.TakeScreenshot();
         game.PopScreen();
         game.vm.ContinueWithValue(null);
         game.PushScreen(animation);
     }
     else {
         UserInput.Buttons keyState = game.Input.State;
         if (keyState != UserInput.Buttons.None) {
             if (KeyPressed != null) KeyPressed(this, new UserInput.ButtonEventArgs(keyState));
         }
         game.Input.WaitForKeyUp();
     }
     foreach (var gfx in graphics) {
         gfx.Advance();
     }
     foreach (Timer timer in timers) {
         --timer.framesLeft;
         if (timer.framesLeft == 0) {
             timer.callback(this, new EventArgs());
         }
     }
     timers.RemoveAll(t => t.framesLeft == 0);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Moves the player to a location on the current map.
 /// </summary>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <param name="layer"></param>
 public void ShortJump(int x, int y, int layer)
 {
     FadeAnimation anim = new FadeAnimation(game);
     anim.FromImage = game.TakeScreenshot();
     Sprite leader = game.Party.Leader;
     game.currentMap.Move(leader, leader.X, leader.Y, leader.Layer, x, y, layer);
     game.currentMap.OnStep(x, y, layer);
     game.PushScreen(anim);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Moves the player to a location on another map.
 /// </summary>
 /// <param name="loc"></param>
 public void LongJump(Location loc)
 {
     FadeAnimation anim = new FadeAnimation(game);
     anim.FromImage = game.TakeScreenshot();
     Sprite leader = game.Party.Leader;
     game.currentMap.Remove(leader, leader.X, leader.Y, leader.Layer);
     game.currentMap = new Map(loc.MapName, game);
     game.currentMap.Place(leader, loc.X, loc.Y, loc.Layer);
     game.PushScreen(anim);
 }
Exemplo n.º 4
0
 public void Fade(SdlDotNet.Graphics.Surface fromImage, CustomScreen screen)
 {
     FadeAnimation anim = new FadeAnimation(game);
     anim.FromImage = fromImage;
     game.PushScreen(screen);
     game.PushScreen(anim);
 }