コード例 #1
0
    private Bestia ObtenerPokemonDisponible()
    {
        bool   puedeCambiar = false;
        Bestia cambiar      = null;

        foreach (Bestia b in prota.GetEquipo())
        {
            if (b.GetVida() > 0 && !puedeCambiar)
            {
                cambiar = b;
                cambiar.MoveTo(100, 350);
                puedeCambiar = true;
            }
        }

        if (!puedeCambiar)
        {
            PerderCombate();
        }
        return(cambiar);
    }
コード例 #2
0
 public Combate(ref Jugador prota, Bestia salvaje, Juego juego)
 {
     r              = new Random();
     bg             = new Image("data/fondo_combate.png");
     font24         = new Font("data/Joystix.ttf", 25);
     font35         = new Font("data/Joystix.ttf", 35);
     continuar      = true;
     capturando     = false;
     turno          = true;
     posicionFlecha = 560;
     seleccion      = 0;
     this.prota     = prota;
     seleccionado   = ObtenerPokemonDisponible();
     this.salvaje   = salvaje;
     this.juego     = juego;
     salvaje.MoveTo(600, 70);
     fondo_opciones = new Image("data/dialogo_combate.png");
     bgSound        = new Sound("data/sonidos/combate.mp3");
     cantidadMinima = 500;
     cantidadMaxima = 700;
 }