-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvictory.pde
More file actions
73 lines (64 loc) · 1.76 KB
/
victory.pde
File metadata and controls
73 lines (64 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Cargar la imagen de la pantalla de victoria
boolean victoria = false;
// Animar a red
int totalFramesVictory = 11; // Número total de cuadros en la animación
int currentFrameVictory = 0; // Cuadro actual
PImage[] imagenesVictory = new PImage[totalFramesVictory];
void victoria() {
if (victoria == true) {
teclaVictoria();
noCursor();
background(0);
animarRedVictory();
//println(mouseX, mouseY);
text("Victoria, ¡Venciste a Red!", 250, 50);
text("Presiona 'X' para jugar de nuevo", 200, 400);
text("Presiona 'C' para volver al menú", 200, 450);
}
}
void teclaVictoria() {
if (finCombate == true) {
if (key == 'X' || key == 'x') {
victory.stop();
recuperacion = 0;
vida = maxVida;
reinicioVariableRectangulo();
reiniciarAtaqueBolas();
finCombate = false;
victoria = false;
vidaRed = vidaRedMax;
turnoJugador = true;
turnoAtaque = 0;
turnoCombate = 0;
musicaBatalla();
combate();
}
if (key == 'C' || key == 'c') {
victory.stop();
recuperacion = 0;
vida = maxVida;
reinicioVariableRectangulo();
reiniciarAtaqueBolas();
finCombate = false;
victoria = false;
menu = true;
vidaRed = vidaRedMax;
turnoJugador = true;
turnoAtaque = 0;
turnoCombate = 0;
musicaMenu.loop();
loop();
}
}
}
void animarRedVictory() {
PImage redAnimation = imagenesVictory[currentFrameVictory];
// Dibujar la imagen en pantalla
image(redAnimation, 320, 65);
// Incrementar el frame actual para la próxima iteración
currentFrameVictory++;
// Si has alcanzado el último frame, reinicia la animación
if (currentFrameVictory >= totalFramesVictory) {
currentFrameVictory = 0;
}
}