estandaritzats els globos a 0, 1, 2 i 3 (en lloc del mix que havia antes amb altres coses a 1, 2, 3 i 4)

balloon: passant const i enum a la part publica
This commit is contained in:
2025-07-23 23:03:17 +02:00
parent ec008ef5dd
commit 55d5957ff0
29 changed files with 359 additions and 359 deletions

View File

@@ -3,275 +3,275 @@
# Variables disponibles: # Variables disponibles:
# X1_0, X1_50, X1_100, X2_0, X2_100, X3_0, X3_100, X4_0, X4_100 # X1_0, X1_50, X1_100, X2_0, X2_100, X3_0, X3_100, X4_0, X4_100
# QUARTER1_X4, QUARTER3_X4, DEFAULT_POS_Y # QUARTER1_X4, QUARTER3_X4, DEFAULT_POS_Y
# BALLOON_SIZE_0, BALLOON_SIZE_1, BALLOON_SIZE_2, BALLOON_SIZE_3 # SIZE_0, SIZE_1, SIZE_2, SIZE_3
# RIGHT, LEFT # RIGHT, LEFT
formation: 0 formation: 0
# Dos enemigos BALLOON4 uno a cada extremo # Dos enemigos BALLOON3 uno a cada extremo
X4_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE4, 0 X4_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_3, 0
X4_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE4, 0 X4_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_3, 0
formation: 1 formation: 1
# Dos enemigos BALLOON4 uno a cada cuarto. Ambos van hacia el centro # Dos enemigos BALLOON3 uno a cada cuarto. Ambos van hacia el centro
QUARTER1_X4, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE4, 0 QUARTER1_X4, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_3, 0
QUARTER3_X4, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE4, 0 QUARTER3_X4, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_3, 0
formation: 2 formation: 2
# Cuatro enemigos BALLOON2 uno detrás del otro. A la izquierda y hacia el centro # Cuatro enemigos BALLOON1 uno detrás del otro. A la izquierda y hacia el centro
X2_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE2, 30 X2_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_1, 30
X2_0, 1, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE2, 20 X2_0, 1, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_1, 20
X2_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE2, 10 X2_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_1, 10
X2_0, 3, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE2, 0 X2_0, 3, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_1, 0
formation: 3 formation: 3
# Cuatro enemigos BALLOON2 uno detrás del otro. A la derecha y hacia el centro # Cuatro enemigos BALLOON1 uno detrás del otro. A la derecha y hacia el centro
X2_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE2, 30 X2_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_1, 30
X2_100, -1, DEFAULT_POS_Y, LEFT, BALLOON, SIZE2, 20 X2_100, -1, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_1, 20
X2_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE2, 10 X2_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_1, 10
X2_100, -3, DEFAULT_POS_Y, LEFT, BALLOON, SIZE2, 0 X2_100, -3, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_1, 0
formation: 4 formation: 4
# Tres enemigos BALLOON3. 0, 25, 50. Hacia la derecha # Tres enemigos BALLOON2. 0, 25, 50. Hacia la derecha
X3_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 20 X3_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 20
X3_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 10 X3_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 10
X3_0, 4, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 0 X3_0, 4, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 0
formation: 5 formation: 5
# Tres enemigos BALLOON3. 50, 75, 100. Hacia la izquierda # Tres enemigos BALLOON2. 50, 75, 100. Hacia la izquierda
X3_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 20 X3_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 20
X3_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 10 X3_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 10
X3_100, -4, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 0 X3_100, -4, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 0
formation: 6 formation: 6
# Tres enemigos BALLOON3. 0, 0, 0. Hacia la derecha # Tres enemigos BALLOON2. 0, 0, 0. Hacia la derecha
X3_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 20 X3_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 20
X3_0, 1, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 10 X3_0, 1, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 10
X3_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 0 X3_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 0
formation: 7 formation: 7
# Tres enemigos BALLOON3. 100, 100, 100. Hacia la izquierda # Tres enemigos BALLOON2. 100, 100, 100. Hacia la izquierda
X3_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 20 X3_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 20
X3_100, -1, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 10 X3_100, -1, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 10
X3_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 0 X3_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 0
formation: 8 formation: 8
# Seis enemigos BALLOON1. 0, 0, 0, 0, 0, 0. Hacia la derecha # Seis enemigos BALLOON0. 0, 0, 0, 0, 0, 0. Hacia la derecha
X1_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 50 X1_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 50
X1_0, 1, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 40 X1_0, 1, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 40
X1_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 30 X1_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 30
X1_0, 3, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 20 X1_0, 3, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 20
X1_0, 4, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 10 X1_0, 4, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 10
X1_0, 5, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 0 X1_0, 5, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 0
formation: 9 formation: 9
# Seis enemigos BALLOON1. 100, 100, 100, 100, 100, 100. Hacia la izquierda # Seis enemigos BALLOON0. 100, 100, 100, 100, 100, 100. Hacia la izquierda
X1_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 50 X1_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 50
X1_100, -1, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 40 X1_100, -1, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 40
X1_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 30 X1_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 30
X1_100, -3, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 20 X1_100, -3, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 20
X1_100, -4, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 10 X1_100, -4, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 10
X1_100, -5, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 0 X1_100, -5, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 0
formation: 10 formation: 10
# Tres enemigos BALLOON4 seguidos desde la izquierda. Hacia la derecha # Tres enemigos BALLOON3 seguidos desde la izquierda. Hacia la derecha
X4_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE4, 30 X4_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_3, 30
X4_0, 1, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE4, 15 X4_0, 1, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_3, 15
X4_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE4, 0 X4_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_3, 0
formation: 11 formation: 11
# Tres enemigos BALLOON4 seguidos desde la derecha. Hacia la izquierda # Tres enemigos BALLOON3 seguidos desde la derecha. Hacia la izquierda
X4_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE4, 30 X4_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_3, 30
X4_100, -1, DEFAULT_POS_Y, LEFT, BALLOON, SIZE4, 15 X4_100, -1, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_3, 15
X4_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE4, 0 X4_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_3, 0
formation: 12 formation: 12
# Seis enemigos BALLOON2 uno detrás del otro. A la izquierda y hacia el centro # Seis enemigos BALLOON1 uno detrás del otro. A la izquierda y hacia el centro
X2_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE2, 50 X2_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_1, 50
X2_0, 1, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE2, 40 X2_0, 1, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_1, 40
X2_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE2, 30 X2_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_1, 30
X2_0, 3, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE2, 20 X2_0, 3, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_1, 20
X2_0, 4, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE2, 10 X2_0, 4, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_1, 10
X2_0, 5, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE2, 0 X2_0, 5, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_1, 0
formation: 13 formation: 13
# Seis enemigos BALLOON2 uno detrás del otro. A la derecha y hacia el centro # Seis enemigos BALLOON1 uno detrás del otro. A la derecha y hacia el centro
X2_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE2, 50 X2_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_1, 50
X2_100, -1, DEFAULT_POS_Y, LEFT, BALLOON, SIZE2, 40 X2_100, -1, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_1, 40
X2_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE2, 30 X2_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_1, 30
X2_100, -3, DEFAULT_POS_Y, LEFT, BALLOON, SIZE2, 20 X2_100, -3, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_1, 20
X2_100, -4, DEFAULT_POS_Y, LEFT, BALLOON, SIZE2, 10 X2_100, -4, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_1, 10
X2_100, -5, DEFAULT_POS_Y, LEFT, BALLOON, SIZE2, 0 X2_100, -5, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_1, 0
formation: 14 formation: 14
# Cinco enemigos BALLOON3. Hacia la derecha. Separados # Cinco enemigos BALLOON2. Hacia la derecha. Separados
X3_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 40 X3_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 40
X3_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 30 X3_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 30
X3_0, 4, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 20 X3_0, 4, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 20
X3_0, 6, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 10 X3_0, 6, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 10
X3_0, 8, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 0 X3_0, 8, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 0
formation: 15 formation: 15
# Cinco enemigos BALLOON3. Hacia la izquierda. Separados # Cinco enemigos BALLOON2. Hacia la izquierda. Separados
X3_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 40 X3_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 40
X3_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 30 X3_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 30
X3_100, -4, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 20 X3_100, -4, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 20
X3_100, -6, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 10 X3_100, -6, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 10
X3_100, -8, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 0 X3_100, -8, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 0
formation: 16 formation: 16
# Cinco enemigos BALLOON3. Hacia la derecha. Juntos # Cinco enemigos BALLOON2. Hacia la derecha. Juntos
X3_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 40 X3_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 40
X3_0, 1, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 30 X3_0, 1, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 30
X3_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 20 X3_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 20
X3_0, 3, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 10 X3_0, 3, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 10
X3_0, 4, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 0 X3_0, 4, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 0
formation: 17 formation: 17
# Cinco enemigos BALLOON3. Hacia la izquierda. Juntos # Cinco enemigos BALLOON2. Hacia la izquierda. Juntos
X3_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 40 X3_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 40
X3_100, -1, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 30 X3_100, -1, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 30
X3_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 20 X3_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 20
X3_100, -3, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 10 X3_100, -3, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 10
X3_100, -4, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 0 X3_100, -4, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 0
formation: 18 formation: 18
# Doce enemigos BALLOON1. Hacia la derecha. Juntos # Doce enemigos BALLOON0. Hacia la derecha. Juntos
X1_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 110 X1_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 110
X1_0, 1, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 100 X1_0, 1, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 100
X1_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 90 X1_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 90
X1_0, 3, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 80 X1_0, 3, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 80
X1_0, 4, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 70 X1_0, 4, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 70
X1_0, 5, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 60 X1_0, 5, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 60
X1_0, 6, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 50 X1_0, 6, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 50
X1_0, 7, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 40 X1_0, 7, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 40
X1_0, 8, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 30 X1_0, 8, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 30
X1_0, 9, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 20 X1_0, 9, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 20
X1_0, 10, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 10 X1_0, 10, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 10
X1_0, 11, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 0 X1_0, 11, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 0
formation: 19 formation: 19
# Doce enemigos BALLOON1. Hacia la izquierda. Juntos # Doce enemigos BALLOON0. Hacia la izquierda. Juntos
X1_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 110 X1_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 110
X1_100, -1, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 100 X1_100, -1, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 100
X1_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 90 X1_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 90
X1_100, -3, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 80 X1_100, -3, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 80
X1_100, -4, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 70 X1_100, -4, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 70
X1_100, -5, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 60 X1_100, -5, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 60
X1_100, -6, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 50 X1_100, -6, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 50
X1_100, -7, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 40 X1_100, -7, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 40
X1_100, -8, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 30 X1_100, -8, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 30
X1_100, -9, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 20 X1_100, -9, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 20
X1_100, -10, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 10 X1_100, -10, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 10
X1_100, -11, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 0 X1_100, -11, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 0
formation: 20 formation: 20
# Cuatro enemigos BALLOON4 seguidos desde la izquierda/derecha. Simétricos # Cuatro enemigos BALLOON3 seguidos desde la izquierda/derecha. Simétricos
X4_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE4, 0 X4_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_3, 0
X4_0, 1, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE4, 0 X4_0, 1, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_3, 0
X4_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE4, 0 X4_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_3, 0
X4_100, -1, DEFAULT_POS_Y, LEFT, BALLOON, SIZE4, 0 X4_100, -1, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_3, 0
formation: 21 formation: 21
# Diez enemigos BALLOON2 uno detrás del otro. Izquierda/derecha. Simétricos # Diez enemigos BALLOON1 uno detrás del otro. Izquierda/derecha. Simétricos
X2_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE2, 12 X2_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_1, 12
X2_0, 1, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE2, 9 X2_0, 1, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_1, 9
X2_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE2, 6 X2_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_1, 6
X2_0, 3, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE2, 3 X2_0, 3, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_1, 3
X2_0, 4, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE2, 0 X2_0, 4, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_1, 0
X2_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE2, 12 X2_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_1, 12
X2_100, -1, DEFAULT_POS_Y, LEFT, BALLOON, SIZE2, 9 X2_100, -1, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_1, 9
X2_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE2, 6 X2_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_1, 6
X2_100, -3, DEFAULT_POS_Y, LEFT, BALLOON, SIZE2, 3 X2_100, -3, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_1, 3
X2_100, -4, DEFAULT_POS_Y, LEFT, BALLOON, SIZE2, 0 X2_100, -4, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_1, 0
formation: 22 formation: 22
# Diez enemigos BALLOON3. Hacia la derecha/izquierda. Separados. Simétricos # Diez enemigos BALLOON2. Hacia la derecha/izquierda. Separados. Simétricos
X3_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 40 X3_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 40
X3_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 30 X3_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 30
X3_0, 4, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 20 X3_0, 4, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 20
X3_0, 6, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 10 X3_0, 6, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 10
X3_0, 8, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 0 X3_0, 8, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 0
X3_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 40 X3_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 40
X3_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 30 X3_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 30
X3_100, -4, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 20 X3_100, -4, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 20
X3_100, -6, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 10 X3_100, -6, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 10
X3_100, -8, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 0 X3_100, -8, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 0
formation: 23 formation: 23
# Diez enemigos BALLOON3. Hacia la derecha. Juntos. Simétricos # Diez enemigos BALLOON2. Hacia la derecha. Juntos. Simétricos
X3_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 40 X3_0, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 40
X3_0, 1, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 30 X3_0, 1, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 30
X3_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 20 X3_0, 2, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 20
X3_0, 3, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 10 X3_0, 3, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 10
X3_0, 4, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE3, 0 X3_0, 4, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_2, 0
X3_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 40 X3_100, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 40
X3_100, -1, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 30 X3_100, -1, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 30
X3_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 20 X3_100, -2, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 20
X3_100, -3, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 10 X3_100, -3, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 10
X3_100, -4, DEFAULT_POS_Y, LEFT, BALLOON, SIZE3, 0 X3_100, -4, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_2, 0
formation: 24 formation: 24
# Treinta enemigos BALLOON1. Del centro hacia los extremos. Juntos. Simétricos # Treinta enemigos BALLOON0. Del centro hacia los extremos. Juntos. Simétricos
X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 0 X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 0
X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 5 X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 5
X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 10 X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 10
X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 15 X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 15
X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 20 X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 20
X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 25 X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 25
X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 30 X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 30
X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 35 X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 35
X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 40 X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 40
X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 45 X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 45
X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 50 X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 50
X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 55 X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 55
X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 60 X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 60
X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 65 X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 65
X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 70 X1_50, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 70
X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 0 X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 0
X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 5 X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 5
X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 10 X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 10
X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 15 X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 15
X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 20 X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 20
X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 25 X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 25
X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 30 X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 30
X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 35 X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 35
X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 40 X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 40
X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 45 X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 45
X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 50 X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 50
X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 55 X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 55
X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 60 X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 60
X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 65 X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 65
X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 70 X1_50, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 70
formation: 25 formation: 25
# Treinta enemigos BALLOON1. Del centro hacia adentro. Juntos. Simétricos # Treinta enemigos BALLOON0. Del centro hacia adentro. Juntos. Simétricos
X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 70 X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 70
X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 65 X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 65
X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 60 X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 60
X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 55 X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 55
X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 50 X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 50
X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 45 X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 45
X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 40 X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 40
X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 35 X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 35
X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 30 X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 30
X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 25 X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 25
X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 20 X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 20
X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 15 X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 15
X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 10 X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 10
X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 5 X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 5
X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE1, 0 X1_50 + 20, 0, DEFAULT_POS_Y, LEFT, BALLOON, SIZE_0, 0
X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 70 X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 70
X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 65 X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 65
X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 60 X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 60
X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 55 X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 55
X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 50 X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 50
X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 45 X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 45
X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 40 X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 40
X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 35 X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 35
X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 30 X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 30
X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 25 X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 25
X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 20 X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 20
X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 15 X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 15
X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 10 X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 10
X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 5 X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 5
X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE1, 0 X1_50 - 20, 0, DEFAULT_POS_Y, RIGHT, BALLOON, SIZE_0, 0

View File

@@ -1,5 +1,5 @@
frame_width=48 frame_width=10
frame_height=48 frame_height=10
[animation] [animation]
name=orange name=orange

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -1,5 +1,5 @@
frame_width=48 frame_width=10
frame_height=48 frame_height=10
[animation] [animation]
name=default name=default

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 760 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -1,5 +1,5 @@
frame_width=26 frame_width=48
frame_height=26 frame_height=48
[animation] [animation]
name=default name=default

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -11,7 +11,7 @@
#include "texture.h" // Para Texture #include "texture.h" // Para Texture
// Constructor // Constructor
Balloon::Balloon(float x, float y, BalloonType type, BalloonSize size, float vel_x, float speed, Uint16 creation_timer, SDL_FRect play_area, std::shared_ptr<Texture> texture, const std::vector<std::string> &animation) Balloon::Balloon(float x, float y, Type type, Size size, float vel_x, float speed, Uint16 creation_timer, SDL_FRect play_area, std::shared_ptr<Texture> texture, const std::vector<std::string> &animation)
: sprite_(std::make_unique<AnimatedSprite>(texture, animation)), : sprite_(std::make_unique<AnimatedSprite>(texture, animation)),
x_(x), x_(x),
y_(y), y_(y),
@@ -26,42 +26,42 @@ Balloon::Balloon(float x, float y, BalloonType type, BalloonSize size, float vel
speed_(speed), speed_(speed),
play_area_(play_area) { play_area_(play_area) {
switch (type_) { switch (type_) {
case BalloonType::BALLOON: { case Type::BALLOON: {
vy_ = 0; vy_ = 0;
max_vy_ = 3.0F; max_vy_ = 3.0F;
const int INDEX = static_cast<int>(size_); const int INDEX = static_cast<int>(size_);
gravity_ = param.balloon.settings.at(INDEX).grav; gravity_ = param.balloon.settings.at(INDEX).grav;
default_vy_ = param.balloon.settings.at(INDEX).vel; default_vy_ = param.balloon.settings.at(INDEX).vel;
h_ = w_ = BALLOON_SIZE[INDEX]; h_ = w_ = SIZE[INDEX];
power_ = BALLOON_POWER[INDEX]; power_ = POWER[INDEX];
menace_ = BALLOON_MENACE[INDEX]; menace_ = MENACE[INDEX];
score_ = BALLOON_SCORE[INDEX]; score_ = SCORE[INDEX];
bouncing_sound_ = BALLOON_BOUNCING_SOUND[INDEX]; bouncing_sound_ = BOUNCING_SOUND[INDEX];
popping_sound_ = BALLOON_POPPING_SOUND[INDEX]; popping_sound_ = POPPING_SOUND[INDEX];
break; break;
} }
case BalloonType::FLOATER: { case Type::FLOATER: {
default_vy_ = max_vy_ = vy_ = fabs(vx_ * 2.0F); default_vy_ = max_vy_ = vy_ = fabs(vx_ * 2.0F);
gravity_ = 0.00F; gravity_ = 0.00F;
const int INDEX = static_cast<int>(size_); const int INDEX = static_cast<int>(size_);
h_ = w_ = BALLOON_SIZE[INDEX]; h_ = w_ = SIZE[INDEX];
power_ = BALLOON_POWER[INDEX]; power_ = POWER[INDEX];
menace_ = BALLOON_MENACE[INDEX]; menace_ = MENACE[INDEX];
score_ = BALLOON_SCORE[INDEX]; score_ = SCORE[INDEX];
bouncing_sound_ = BALLOON_BOUNCING_SOUND[INDEX]; bouncing_sound_ = BOUNCING_SOUND[INDEX];
popping_sound_ = BALLOON_POPPING_SOUND[INDEX]; popping_sound_ = POPPING_SOUND[INDEX];
break; break;
} }
case BalloonType::POWERBALL: { case Type::POWERBALL: {
constexpr int INDEX = 3; constexpr int INDEX = 3;
h_ = w_ = BALLOON_SIZE[4]; h_ = w_ = SIZE[4];
bouncing_sound_ = BALLOON_BOUNCING_SOUND[3]; bouncing_sound_ = BOUNCING_SOUND[3];
popping_sound_ = "power_ball_explosion.wav"; popping_sound_ = "power_ball_explosion.wav";
power_ = score_ = menace_ = 0; power_ = score_ = menace_ = 0;
@@ -103,11 +103,11 @@ void Balloon::alignTo(int x) {
// Pinta el globo en la pantalla // Pinta el globo en la pantalla
void Balloon::render() { void Balloon::render() {
if (type_ == BalloonType::POWERBALL) { if (type_ == Type::POWERBALL) {
// Renderiza el fondo azul // Renderiza el fondo azul
{ {
auto sp = std::make_unique<Sprite>(sprite_->getTexture(), sprite_->getPosition()); auto sp = std::make_unique<Sprite>(sprite_->getTexture(), sprite_->getPosition());
sp->setSpriteClip(0, 0, BALLOON_SIZE[4], BALLOON_SIZE[4]); sp->setSpriteClip(0, 0, SIZE[4], SIZE[4]);
sp->render(); sp->render();
} }
@@ -121,7 +121,7 @@ void Balloon::render() {
// Añade la máscara del borde y los reflejos // Añade la máscara del borde y los reflejos
{ {
auto sp = std::make_unique<Sprite>(sprite_->getTexture(), sprite_->getPosition()); auto sp = std::make_unique<Sprite>(sprite_->getTexture(), sprite_->getPosition());
sp->setSpriteClip(BALLOON_SIZE[4] * 2, 0, BALLOON_SIZE[4], BALLOON_SIZE[4]); sp->setSpriteClip(SIZE[4] * 2, 0, SIZE[4], SIZE[4]);
sp->render(); sp->render();
} }
} else { } else {
@@ -180,7 +180,7 @@ void Balloon::handleHorizontalBounce(float min_x, float max_x) {
x_ = std::clamp(x_, min_x, max_x); x_ = std::clamp(x_, min_x, max_x);
vx_ = -vx_; vx_ = -vx_;
if (type_ == BalloonType::POWERBALL) { if (type_ == Type::POWERBALL) {
sprite_->switchRotate(); sprite_->switchRotate();
} else { } else {
enableBounceEffect(); enableBounceEffect();
@@ -209,7 +209,7 @@ void Balloon::handleBottomCollision() {
y_ = MAX_Y; y_ = MAX_Y;
vy_ = -default_vy_; vy_ = -default_vy_;
if (type_ != BalloonType::POWERBALL) { if (type_ != Type::POWERBALL) {
enableBounceEffect(); enableBounceEffect();
} else { } else {
setInvulnerable(false); setInvulnerable(false);
@@ -293,11 +293,11 @@ void Balloon::setAnimation() {
std::string normal_animation; std::string normal_animation;
switch (type_) { switch (type_) {
case BalloonType::POWERBALL: case Type::POWERBALL:
creating_animation = "powerball"; creating_animation = "powerball";
normal_animation = "powerball"; normal_animation = "powerball";
break; break;
case BalloonType::FLOATER: case Type::FLOATER:
creating_animation = param.balloon.color.at(2); creating_animation = param.balloon.color.at(2);
normal_animation = param.balloon.color.at(3); normal_animation = param.balloon.color.at(3);
break; break;
@@ -352,7 +352,7 @@ void Balloon::applyBounceEffect() {
// Activa el efecto // Activa el efecto
void Balloon::enableBounceEffect() { void Balloon::enableBounceEffect() {
// Los globos pequeños no tienen efecto de rebote // Los globos pequeños no tienen efecto de rebote
if (size_ == BalloonSize::SIZE1) { if (size_ == Size::SIZE_0) {
return; return;
} }
bounce_effect_.enabled = true; bounce_effect_.enabled = true;

View File

@@ -12,54 +12,54 @@
class Texture; class Texture;
// --- Constantes relacionadas con globos ---
constexpr int MAX_BOUNCE = 10; // Cantidad de elementos del vector de deformación
constexpr std::array<int, 4> BALLOON_SCORE = {50, 100, 200, 400};
constexpr std::array<int, 4> BALLOON_POWER = {1, 3, 7, 15};
constexpr std::array<int, 4> BALLOON_MENACE = {1, 2, 4, 8};
constexpr std::array<int, 5> BALLOON_SIZE = {10, 16, 26, 48, 49};
const std::array<std::string, 4> BALLOON_BOUNCING_SOUND = {
"bubble1.wav", "bubble2.wav", "bubble3.wav", "bubble4.wav"};
const std::array<std::string, 4> BALLOON_POPPING_SOUND = {
"balloon1.wav", "balloon2.wav", "balloon3.wav", "balloon4.wav"};
enum class BalloonSize : Uint8 {
SIZE1 = 0,
SIZE2 = 1,
SIZE3 = 2,
SIZE4 = 3,
};
enum class BalloonType : Uint8 {
BALLOON = 0,
FLOATER = 1,
POWERBALL = 2,
};
constexpr float BALLOON_VELX_POSITIVE = 0.7F;
constexpr float BALLOON_VELX_NEGATIVE = -0.7F;
constexpr int BALLOON_MOVING_ANIMATION = 0;
constexpr int BALLOON_POP_ANIMATION = 1;
constexpr int BALLOON_BORN_ANIMATION = 2;
constexpr std::array<float, 5> BALLOON_SPEED = {0.60F, 0.70F, 0.80F, 0.90F, 1.00F};
constexpr int POWERBALL_SCREENPOWER_MINIMUM = 10;
constexpr int POWERBALL_COUNTER = 8;
// --- Clase Balloon --- // --- Clase Balloon ---
class Balloon { class Balloon {
public: public:
// --- Constantes relacionadas con globos ---
static constexpr int MAX_BOUNCE = 10; // Cantidad de elementos del vector de deformación
static constexpr std::array<int, 4> SCORE = {50, 100, 200, 400};
static constexpr std::array<int, 4> POWER = {1, 3, 7, 15};
static constexpr std::array<int, 4> MENACE = {1, 2, 4, 8};
static constexpr std::array<int, 5> SIZE = {10, 16, 26, 48, 49};
const std::array<std::string, 4> BOUNCING_SOUND = {
"balloon_bounce0.wav", "balloon_bounce1.wav", "balloon_bounce2.wav", "balloon_bounce3.wav"};
const std::array<std::string, 4> POPPING_SOUND = {
"balloon_pop0.wav", "balloon_pop1.wav", "balloon_pop2.wav", "balloon_pop3.wav"};
static constexpr float VELX_POSITIVE = 0.7F;
static constexpr float VELX_NEGATIVE = -0.7F;
static constexpr int MOVING_ANIMATION = 0;
static constexpr int POP_ANIMATION = 1;
static constexpr int BORN_ANIMATION = 2;
static constexpr std::array<float, 5> SPEED = {0.60F, 0.70F, 0.80F, 0.90F, 1.00F};
static constexpr int POWERBALL_SCREENPOWER_MINIMUM = 10;
static constexpr int POWERBALL_COUNTER = 8;
enum class Size : Uint8 {
SIZE_0 = 0,
SIZE_1 = 1,
SIZE_2 = 2,
SIZE_3 = 3,
};
enum class Type : Uint8 {
BALLOON = 0,
FLOATER = 1,
POWERBALL = 2,
};
// --- Constructores y destructor --- // --- Constructores y destructor ---
Balloon( Balloon(
float x, float x,
float y, float y,
BalloonType type, Type type,
BalloonSize size, Size size,
float vel_x, float vel_x,
float speed, float speed,
Uint16 creation_timer, Uint16 creation_timer,
@@ -86,14 +86,14 @@ class Balloon {
[[nodiscard]] auto getPosY() const -> float { return y_; } [[nodiscard]] auto getPosY() const -> float { return y_; }
[[nodiscard]] auto getWidth() const -> int { return w_; } [[nodiscard]] auto getWidth() const -> int { return w_; }
[[nodiscard]] auto getHeight() const -> int { return h_; } [[nodiscard]] auto getHeight() const -> int { return h_; }
[[nodiscard]] auto getSize() const -> BalloonSize { return size_; } [[nodiscard]] auto getSize() const -> Size { return size_; }
[[nodiscard]] auto getType() const -> BalloonType { return type_; } [[nodiscard]] auto getType() const -> Type { return type_; }
[[nodiscard]] auto getScore() const -> Uint16 { return score_; } [[nodiscard]] auto getScore() const -> Uint16 { return score_; }
auto getCollider() -> Circle & { return collider_; } auto getCollider() -> Circle & { return collider_; }
[[nodiscard]] auto getMenace() const -> Uint8 { return isEnabled() ? menace_ : 0; } [[nodiscard]] auto getMenace() const -> Uint8 { return isEnabled() ? menace_ : 0; }
[[nodiscard]] auto getPower() const -> Uint8 { return power_; } [[nodiscard]] auto getPower() const -> Uint8 { return power_; }
[[nodiscard]] auto isStopped() const -> bool { return stopped_; } [[nodiscard]] auto isStopped() const -> bool { return stopped_; }
[[nodiscard]] auto isPowerBall() const -> bool { return type_ == BalloonType::POWERBALL; } [[nodiscard]] auto isPowerBall() const -> bool { return type_ == Type::POWERBALL; }
[[nodiscard]] auto isInvulnerable() const -> bool { return invulnerable_; } [[nodiscard]] auto isInvulnerable() const -> bool { return invulnerable_; }
[[nodiscard]] auto isBeingCreated() const -> bool { return being_created_; } [[nodiscard]] auto isBeingCreated() const -> bool { return being_created_; }
[[nodiscard]] auto isEnabled() const -> bool { return enabled_; } [[nodiscard]] auto isEnabled() const -> bool { return enabled_; }
@@ -154,8 +154,8 @@ class Balloon {
Uint16 creation_counter_; // Temporizador de creación Uint16 creation_counter_; // Temporizador de creación
Uint16 creation_counter_ini_; // Valor inicial del temporizador de creación Uint16 creation_counter_ini_; // Valor inicial del temporizador de creación
Uint16 score_; // Puntos al destruir el globo Uint16 score_; // Puntos al destruir el globo
BalloonType type_; // Tipo de globo Type type_; // Tipo de globo
BalloonSize size_; // Tamaño de globo Size size_; // Tamaño de globo
Uint8 menace_; // Amenaza que genera el globo Uint8 menace_; // Amenaza que genera el globo
Uint32 counter_ = 0; // Contador interno Uint32 counter_ = 0; // Contador interno
float travel_y_ = 1.0F; // Distancia a recorrer en Y antes de aplicar gravedad float travel_y_ = 1.0F; // Distancia a recorrer en Y antes de aplicar gravedad

View File

@@ -141,17 +141,17 @@ auto BalloonFormations::parseBalloonLine(const std::string& line, const std::map
BalloonType type = (tokens.at(4) == "BALLOON") ? BalloonType::BALLOON : BalloonType::FLOATER; BalloonType type = (tokens.at(4) == "BALLOON") ? BalloonType::BALLOON : BalloonType::FLOATER;
BalloonSize size; BalloonSize size;
if (tokens.at(5) == "SIZE1") { if (tokens.at(5) == "SIZE_0") {
size = BalloonSize::SIZE1; size = BalloonSize::SIZE_0;
desp = desp * (BALLOON_SIZE.at(0) + 1); desp = desp * (BALLOON_SIZE.at(0) + 1);
} else if (tokens.at(5) == "SIZE2") { } else if (tokens.at(5) == "SIZE_1") {
size = BalloonSize::SIZE2; size = BalloonSize::SIZE_1;
desp = desp * (BALLOON_SIZE.at(1) + 1); desp = desp * (BALLOON_SIZE.at(1) + 1);
} else if (tokens.at(5) == "SIZE3") { } else if (tokens.at(5) == "SIZE_2") {
size = BalloonSize::SIZE3; size = BalloonSize::SIZE_2;
desp = desp * (BALLOON_SIZE.at(2) + 1); desp = desp * (BALLOON_SIZE.at(2) + 1);
} else if (tokens.at(5) == "SIZE4") { } else if (tokens.at(5) == "SIZE_3") {
size = BalloonSize::SIZE4; size = BalloonSize::SIZE_3;
desp = desp * (BALLOON_SIZE.at(3) + 1); desp = desp * (BALLOON_SIZE.at(3) + 1);
} else { } else {
return std::nullopt; return std::nullopt;
@@ -240,10 +240,10 @@ void BalloonFormations::createFloaterVariants() {
void BalloonFormations::addTestFormation() { void BalloonFormations::addTestFormation() {
std::vector<BalloonFormationParams> test_params = { std::vector<BalloonFormationParams> test_params = {
{10, -BLOCK, 0, BalloonType::FLOATER, BalloonSize::SIZE1, 200}, {10, -BLOCK, 0, BalloonType::FLOATER, BalloonSize::SIZE_0, 200},
{50, -BLOCK, 0, BalloonType::FLOATER, BalloonSize::SIZE2, 200}, {50, -BLOCK, 0, BalloonType::FLOATER, BalloonSize::SIZE_1, 200},
{90, -BLOCK, 0, BalloonType::FLOATER, BalloonSize::SIZE3, 200}, {90, -BLOCK, 0, BalloonType::FLOATER, BalloonSize::SIZE_2, 200},
{140, -BLOCK, 0, BalloonType::FLOATER, BalloonSize::SIZE4, 200}}; {140, -BLOCK, 0, BalloonType::FLOATER, BalloonSize::SIZE_3, 200}};
balloon_formation_.at(99) = BalloonFormationUnit(4, test_params); balloon_formation_.at(99) = BalloonFormationUnit(4, test_params);
} }
@@ -258,8 +258,8 @@ void BalloonFormations::loadDefaultFormations() {
// Formación básica #00 // Formación básica #00
std::vector<BalloonFormationParams> basic_formation = { std::vector<BalloonFormationParams> basic_formation = {
BalloonFormationParams(X4_0, DEFAULT_POS_Y, BALLOON_VELX_POSITIVE, BalloonType::BALLOON, BalloonSize::SIZE4, CREATION_TIME), BalloonFormationParams(X4_0, DEFAULT_POS_Y, BALLOON_VELX_POSITIVE, BalloonType::BALLOON, BalloonSize::SIZE_3, CREATION_TIME),
BalloonFormationParams(X4_100, DEFAULT_POS_Y, BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE4, CREATION_TIME)}; BalloonFormationParams(X4_100, DEFAULT_POS_Y, BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE_3, CREATION_TIME)};
balloon_formation_.emplace_back(2, basic_formation); balloon_formation_.emplace_back(2, basic_formation);
} }

View File

@@ -16,7 +16,7 @@ struct BalloonFormationParams {
int y = 0; // Posición en el eje Y donde crear el globo int y = 0; // Posición en el eje Y donde crear el globo
float vel_x = 0.0F; // Velocidad inicial en el eje X float vel_x = 0.0F; // Velocidad inicial en el eje X
BalloonType type = BalloonType::BALLOON; // Tipo de globo BalloonType type = BalloonType::BALLOON; // Tipo de globo
BalloonSize size = BalloonSize::SIZE1; // Tamaño de globo BalloonSize size = BalloonSize::SIZE_0; // Tamaño de globo
int creation_counter = 0; // Temporizador para la creación del globo int creation_counter = 0; // Temporizador para la creación del globo
// Constructor por defecto // Constructor por defecto

View File

@@ -5,7 +5,7 @@
#include <cstdlib> // Para rand #include <cstdlib> // Para rand
#include <numeric> // Para accumulate #include <numeric> // Para accumulate
#include "balloon.h" // Para Balloon, BALLOON_SCORE, BALLOON_VELX... #include "balloon.h" // Para Balloon, Balloon::SCORE.at( )ALLOON_VELX...
#include "balloon_formations.h" // Para BalloonFormationParams, BalloonForma... #include "balloon_formations.h" // Para BalloonFormationParams, BalloonForma...
#include "color.h" // Para Zone, Color, flash_color #include "color.h" // Para Zone, Color, flash_color
#include "explosions.h" // Para Explosions #include "explosions.h" // Para Explosions
@@ -23,30 +23,30 @@ BalloonManager::BalloonManager()
// Inicializa // Inicializa
void BalloonManager::init() { void BalloonManager::init() {
// Texturas - Globos // Texturas - Globos
balloon_textures_.emplace_back(Resource::get()->getTexture("balloon0.png"));
balloon_textures_.emplace_back(Resource::get()->getTexture("balloon1.png")); balloon_textures_.emplace_back(Resource::get()->getTexture("balloon1.png"));
balloon_textures_.emplace_back(Resource::get()->getTexture("balloon2.png")); balloon_textures_.emplace_back(Resource::get()->getTexture("balloon2.png"));
balloon_textures_.emplace_back(Resource::get()->getTexture("balloon3.png")); balloon_textures_.emplace_back(Resource::get()->getTexture("balloon3.png"));
balloon_textures_.emplace_back(Resource::get()->getTexture("balloon4.png"));
balloon_textures_.emplace_back(Resource::get()->getTexture("powerball.png")); balloon_textures_.emplace_back(Resource::get()->getTexture("powerball.png"));
// Animaciones -- Globos // Animaciones -- Globos
balloon_animations_.emplace_back(Resource::get()->getAnimation("balloon0.ani"));
balloon_animations_.emplace_back(Resource::get()->getAnimation("balloon1.ani")); balloon_animations_.emplace_back(Resource::get()->getAnimation("balloon1.ani"));
balloon_animations_.emplace_back(Resource::get()->getAnimation("balloon2.ani")); balloon_animations_.emplace_back(Resource::get()->getAnimation("balloon2.ani"));
balloon_animations_.emplace_back(Resource::get()->getAnimation("balloon3.ani")); balloon_animations_.emplace_back(Resource::get()->getAnimation("balloon3.ani"));
balloon_animations_.emplace_back(Resource::get()->getAnimation("balloon4.ani"));
balloon_animations_.emplace_back(Resource::get()->getAnimation("powerball.ani")); balloon_animations_.emplace_back(Resource::get()->getAnimation("powerball.ani"));
// Texturas - Explosiones // Texturas - Explosiones
explosions_textures_.emplace_back(Resource::get()->getTexture("explosion0.png"));
explosions_textures_.emplace_back(Resource::get()->getTexture("explosion1.png")); explosions_textures_.emplace_back(Resource::get()->getTexture("explosion1.png"));
explosions_textures_.emplace_back(Resource::get()->getTexture("explosion2.png")); explosions_textures_.emplace_back(Resource::get()->getTexture("explosion2.png"));
explosions_textures_.emplace_back(Resource::get()->getTexture("explosion3.png")); explosions_textures_.emplace_back(Resource::get()->getTexture("explosion3.png"));
explosions_textures_.emplace_back(Resource::get()->getTexture("explosion4.png"));
// Animaciones -- Explosiones // Animaciones -- Explosiones
explosions_animations_.emplace_back(Resource::get()->getAnimation("explosion0.ani"));
explosions_animations_.emplace_back(Resource::get()->getAnimation("explosion1.ani")); explosions_animations_.emplace_back(Resource::get()->getAnimation("explosion1.ani"));
explosions_animations_.emplace_back(Resource::get()->getAnimation("explosion2.ani")); explosions_animations_.emplace_back(Resource::get()->getAnimation("explosion2.ani"));
explosions_animations_.emplace_back(Resource::get()->getAnimation("explosion3.ani")); explosions_animations_.emplace_back(Resource::get()->getAnimation("explosion3.ani"));
explosions_animations_.emplace_back(Resource::get()->getAnimation("explosion4.ani"));
// Añade texturas // Añade texturas
explosions_->addTexture(0, explosions_textures_[0], explosions_animations_[0]); explosions_->addTexture(0, explosions_textures_[0], explosions_animations_[0]);
@@ -150,7 +150,7 @@ void BalloonManager::updateBalloonDeployCounter() {
} }
// Indica si se puede crear una powerball // Indica si se puede crear una powerball
auto BalloonManager::canPowerBallBeCreated() -> bool { return (!power_ball_enabled_) && (calculateScreenPower() > POWERBALL_SCREENPOWER_MINIMUM) && (power_ball_counter_ == 0); } auto BalloonManager::canPowerBallBeCreated() -> bool { return (!power_ball_enabled_) && (calculateScreenPower() > Balloon::POWERBALL_SCREENPOWER_MINIMUM) && (power_ball_counter_ == 0); }
// Calcula el poder actual de los globos en pantalla // Calcula el poder actual de los globos en pantalla
auto BalloonManager::calculateScreenPower() -> int { auto BalloonManager::calculateScreenPower() -> int {
@@ -158,7 +158,7 @@ auto BalloonManager::calculateScreenPower() -> int {
} }
// Crea un globo nuevo en el vector de globos // Crea un globo nuevo en el vector de globos
auto BalloonManager::createBalloon(float x, int y, BalloonType type, BalloonSize size, float velx, float speed, int creation_timer) -> std::shared_ptr<Balloon> { auto BalloonManager::createBalloon(float x, int y, Balloon::Type type, Balloon::Size size, float velx, float speed, int creation_timer) -> std::shared_ptr<Balloon> {
if (can_deploy_balloons_) { if (can_deploy_balloons_) {
const int INDEX = static_cast<int>(size); const int INDEX = static_cast<int>(size);
balloons_.emplace_back(std::make_shared<Balloon>(x, y, type, size, velx, speed, creation_timer, play_area_, balloon_textures_.at(INDEX), balloon_animations_.at(INDEX))); balloons_.emplace_back(std::make_shared<Balloon>(x, y, type, size, velx, speed, creation_timer, play_area_, balloon_textures_.at(INDEX), balloon_animations_.at(INDEX)));
@@ -175,10 +175,10 @@ auto BalloonManager::createBalloon(float x, int y, BalloonType type, BalloonSize
void BalloonManager::createChildBalloon(const std::shared_ptr<Balloon> &balloon, const std::string &direction) { void BalloonManager::createChildBalloon(const std::shared_ptr<Balloon> &balloon, const std::string &direction) {
if (can_deploy_balloons_) { if (can_deploy_balloons_) {
// Calcula parametros // Calcula parametros
const float VX = direction == "LEFT" ? BALLOON_VELX_NEGATIVE : BALLOON_VELX_POSITIVE; const float VX = direction == "LEFT" ? Balloon::VELX_NEGATIVE : Balloon::VELX_POSITIVE;
const auto SIZE = static_cast<BalloonSize>(static_cast<int>(balloon->getSize()) - 1); const auto SIZE = static_cast<Balloon::Size>(static_cast<int>(balloon->getSize()) - 1);
const int PARENT_HEIGHT = balloon->getHeight(); const int PARENT_HEIGHT = balloon->getHeight();
const int CHILD_HEIGHT = BALLOON_SIZE[static_cast<int>(balloon->getSize()) - 1]; const int CHILD_HEIGHT = Balloon::SIZE.at(static_cast<int>(balloon->getSize()) - 1);
const int Y = balloon->getPosY() + (PARENT_HEIGHT - CHILD_HEIGHT) / 2; const int Y = balloon->getPosY() + (PARENT_HEIGHT - CHILD_HEIGHT) / 2;
const int X = direction == "LEFT" ? balloon->getPosX() + (balloon->getWidth() / 3) : balloon->getPosX() + 2 * (balloon->getWidth() / 3); const int X = direction == "LEFT" ? balloon->getPosX() + (balloon->getWidth() / 3) : balloon->getPosX() + 2 * (balloon->getWidth() / 3);
@@ -187,7 +187,7 @@ void BalloonManager::createChildBalloon(const std::shared_ptr<Balloon> &balloon,
// Establece parametros // Establece parametros
b->alignTo(X); b->alignTo(X);
b->setVelY(b->getType() == BalloonType::BALLOON ? -2.50F : BALLOON_VELX_NEGATIVE * 2.0F); b->setVelY(b->getType() == Balloon::Type::BALLOON ? -2.50F : Balloon::VELX_NEGATIVE * 2.0F);
// Herencia de estados // Herencia de estados
if (balloon->isStopped()) { if (balloon->isStopped()) {
@@ -203,22 +203,22 @@ void BalloonManager::createChildBalloon(const std::shared_ptr<Balloon> &balloon,
void BalloonManager::createPowerBall() { void BalloonManager::createPowerBall() {
if (can_deploy_balloons_) { if (can_deploy_balloons_) {
constexpr int VALUES = 6; constexpr int VALUES = 6;
constexpr float POS_Y = -BALLOON_SIZE[4]; constexpr float POS_Y = -Balloon::SIZE.at(4);
constexpr int CREATION_TIME = 0; constexpr int CREATION_TIME = 0;
const float LEFT = param.game.play_area.rect.x; const float LEFT = param.game.play_area.rect.x;
const float CENTER = param.game.play_area.center_x - (BALLOON_SIZE[4] / 2); const float CENTER = param.game.play_area.center_x - (Balloon::SIZE.at(4) / 2);
const float RIGHT = param.game.play_area.rect.w - BALLOON_SIZE[4]; const float RIGHT = param.game.play_area.rect.w - Balloon::SIZE.at(4);
const int LUCK = rand() % VALUES; const int LUCK = rand() % VALUES;
const std::array<float, VALUES> POS_X = {LEFT, LEFT, CENTER, CENTER, RIGHT, RIGHT}; const std::array<float, VALUES> POS_X = {LEFT, LEFT, CENTER, CENTER, RIGHT, RIGHT};
const std::array<float, VALUES> VEL_X = {BALLOON_VELX_POSITIVE, BALLOON_VELX_POSITIVE, BALLOON_VELX_POSITIVE, BALLOON_VELX_NEGATIVE, BALLOON_VELX_NEGATIVE, BALLOON_VELX_NEGATIVE}; const std::array<float, VALUES> VEL_X = {Balloon::VELX_POSITIVE, Balloon::VELX_POSITIVE, Balloon::VELX_POSITIVE, Balloon::VELX_NEGATIVE, Balloon::VELX_NEGATIVE, Balloon::VELX_NEGATIVE};
balloons_.emplace_back(std::make_unique<Balloon>(POS_X[LUCK], POS_Y, BalloonType::POWERBALL, BalloonSize::SIZE4, VEL_X[LUCK], balloon_speed_, CREATION_TIME, play_area_, balloon_textures_[4], balloon_animations_[4])); balloons_.emplace_back(std::make_unique<Balloon>(POS_X[LUCK], POS_Y, Balloon::Type::POWERBALL, Balloon::Size::SIZE_3, VEL_X[LUCK], balloon_speed_, CREATION_TIME, play_area_, balloon_textures_[4], balloon_animations_[4]));
balloons_.back()->setInvulnerable(true); balloons_.back()->setInvulnerable(true);
power_ball_enabled_ = true; power_ball_enabled_ = true;
power_ball_counter_ = POWERBALL_COUNTER; power_ball_counter_ = Balloon::POWERBALL_COUNTER;
} }
} }
@@ -235,14 +235,14 @@ auto BalloonManager::popBalloon(std::shared_ptr<Balloon> balloon) -> int {
Stage::addPower(1); Stage::addPower(1);
int score = 0; int score = 0;
if (balloon->getType() == BalloonType::POWERBALL) { if (balloon->getType() == Balloon::Type::POWERBALL) {
balloon->pop(true); balloon->pop(true);
score = destroyAllBalloons(); score = destroyAllBalloons();
power_ball_enabled_ = false; power_ball_enabled_ = false;
balloon_deploy_counter_ = 20; balloon_deploy_counter_ = 20;
} else { } else {
score = balloon->getScore(); score = balloon->getScore();
if (balloon->getSize() != BalloonSize::SIZE1) { if (balloon->getSize() != Balloon::Size::SIZE_0) {
createChildBalloon(balloon, "LEFT"); createChildBalloon(balloon, "LEFT");
createChildBalloon(balloon, "RIGHT"); createChildBalloon(balloon, "RIGHT");
} }
@@ -261,17 +261,17 @@ auto BalloonManager::destroyBalloon(std::shared_ptr<Balloon> &balloon) -> int {
// Calcula la puntuación y el poder que generaria el globo en caso de romperlo a él y a sus hijos // Calcula la puntuación y el poder que generaria el globo en caso de romperlo a él y a sus hijos
switch (balloon->getSize()) { switch (balloon->getSize()) {
case BalloonSize::SIZE4: case Balloon::Size::SIZE_3:
score = BALLOON_SCORE[3] + (2 * BALLOON_SCORE[2]) + (4 * BALLOON_SCORE[1]) + (8 * BALLOON_SCORE[0]); score = Balloon::SCORE.at(3) + (2 * Balloon::SCORE.at(2)) + (4 * Balloon::SCORE.at(1)) + (8 * Balloon::SCORE.at(0));
break; break;
case BalloonSize::SIZE3: case Balloon::Size::SIZE_2:
score = BALLOON_SCORE[2] + (2 * BALLOON_SCORE[1]) + (4 * BALLOON_SCORE[0]); score = Balloon::SCORE.at(2) + (2 * Balloon::SCORE.at(1)) + (4 * Balloon::SCORE.at(0));
break; break;
case BalloonSize::SIZE2: case Balloon::Size::SIZE_1:
score = BALLOON_SCORE[1] + (2 * BALLOON_SCORE[0]); score = Balloon::SCORE.at(1) + (2 * Balloon::SCORE.at(0));
break; break;
case BalloonSize::SIZE1: case Balloon::Size::SIZE_0:
score = BALLOON_SCORE[0]; score = Balloon::SCORE.at(0);
break; break;
default: default:
score = 0; score = 0;
@@ -343,12 +343,12 @@ void BalloonManager::createTwoBigBalloons() {
void BalloonManager::createRandomBalloons() { void BalloonManager::createRandomBalloons() {
const int NUM_BALLOONS = 2 + rand() % 4; const int NUM_BALLOONS = 2 + rand() % 4;
for (int i = 0; i < NUM_BALLOONS; ++i) { for (int i = 0; i < NUM_BALLOONS; ++i) {
const float X = param.game.game_area.rect.x + (rand() % static_cast<int>(param.game.game_area.rect.w)) - BALLOON_SIZE[3]; const float X = param.game.game_area.rect.x + (rand() % static_cast<int>(param.game.game_area.rect.w)) - Balloon::SIZE.at(3);
const int Y = param.game.game_area.rect.y + (rand() % 50); const int Y = param.game.game_area.rect.y + (rand() % 50);
const auto SIZE = static_cast<BalloonSize>(rand() % 4); const auto SIZE = static_cast<Balloon::Size>(rand() % 4);
const float VEL_X = (rand() % 2 == 0) ? BALLOON_VELX_POSITIVE : BALLOON_VELX_NEGATIVE; const float VEL_X = (rand() % 2 == 0) ? Balloon::VELX_POSITIVE : Balloon::VELX_NEGATIVE;
const int CREATION_COUNTER = 0; const int CREATION_COUNTER = 0;
createBalloon(X, Y, BalloonType::BALLOON, SIZE, VEL_X, balloon_speed_, CREATION_COUNTER); createBalloon(X, Y, Balloon::Type::BALLOON, SIZE, VEL_X, balloon_speed_, CREATION_COUNTER);
} }
} }

View File

@@ -8,7 +8,7 @@
#include <string> // Para string #include <string> // Para string
#include <vector> // Para vector #include <vector> // Para vector
#include "balloon.h" // Para BALLOON_SPEED, Balloon, BalloonSize (ptr only), BalloonType (ptr only) #include "balloon.h" // Para BALLOON_SPEED, Balloon, Balloon::Size (ptr only), Balloon::Type (ptr only)
#include "balloon_formations.h" // Para BalloonFormations #include "balloon_formations.h" // Para BalloonFormations
#include "explosions.h" // Para Explosions #include "explosions.h" // Para Explosions
#include "param.h" // Para Param, ParamGame, param #include "param.h" // Para Param, ParamGame, param
@@ -38,7 +38,7 @@ class BalloonManager {
void deploySet(int set, int y); // Crea una formación específica con coordenadas void deploySet(int set, int y); // Crea una formación específica con coordenadas
// Creación de globos // Creación de globos
auto createBalloon(float x, int y, BalloonType type, BalloonSize size, float velx, float speed, int creation_timer) -> std::shared_ptr<Balloon>; // Crea un nuevo globo auto createBalloon(float x, int y, Balloon::Type type, Balloon::Size size, float velx, float speed, int creation_timer) -> std::shared_ptr<Balloon>; // Crea un nuevo globo
void createChildBalloon(const std::shared_ptr<Balloon> &balloon, const std::string &direction); // Crea un globo a partir de otro void createChildBalloon(const std::shared_ptr<Balloon> &balloon, const std::string &direction); // Crea un globo a partir de otro
void createPowerBall(); // Crea una PowerBall void createPowerBall(); // Crea una PowerBall
void createTwoBigBalloons(); // Crea dos globos grandes void createTwoBigBalloons(); // Crea dos globos grandes
@@ -91,8 +91,8 @@ class BalloonManager {
std::vector<std::vector<std::string>> explosions_animations_; // Animaciones de las explosiones std::vector<std::vector<std::string>> explosions_animations_; // Animaciones de las explosiones
// Variables de control de globos // Variables de control de globos
float balloon_speed_ = BALLOON_SPEED[0]; float balloon_speed_ = Balloon::SPEED.at(0);
float default_balloon_speed_ = BALLOON_SPEED[0]; float default_balloon_speed_ = Balloon::SPEED.at(0);
int balloon_deploy_counter_ = 0; int balloon_deploy_counter_ = 0;
bool power_ball_enabled_ = false; bool power_ball_enabled_ = false;
int power_ball_counter_ = 0; int power_ball_counter_ = 0;

View File

@@ -268,14 +268,14 @@ void Director::setFileList() {
Asset::get()->add(PREFIX + "/data/music/credits.ogg", AssetType::MUSIC); Asset::get()->add(PREFIX + "/data/music/credits.ogg", AssetType::MUSIC);
// Sonidos // Sonidos
Asset::get()->add(PREFIX + "/data/sound/balloon1.wav", AssetType::SOUND); Asset::get()->add(PREFIX + "/data/sound/balloon_pop0.wav", AssetType::SOUND);
Asset::get()->add(PREFIX + "/data/sound/balloon2.wav", AssetType::SOUND); Asset::get()->add(PREFIX + "/data/sound/balloon_pop1.wav", AssetType::SOUND);
Asset::get()->add(PREFIX + "/data/sound/balloon3.wav", AssetType::SOUND); Asset::get()->add(PREFIX + "/data/sound/balloon_pop2.wav", AssetType::SOUND);
Asset::get()->add(PREFIX + "/data/sound/balloon4.wav", AssetType::SOUND); Asset::get()->add(PREFIX + "/data/sound/balloon_pop3.wav", AssetType::SOUND);
Asset::get()->add(PREFIX + "/data/sound/bubble1.wav", AssetType::SOUND); Asset::get()->add(PREFIX + "/data/sound/balloon_bounce0.wav", AssetType::SOUND);
Asset::get()->add(PREFIX + "/data/sound/bubble2.wav", AssetType::SOUND); Asset::get()->add(PREFIX + "/data/sound/balloon_bounce1.wav", AssetType::SOUND);
Asset::get()->add(PREFIX + "/data/sound/bubble3.wav", AssetType::SOUND); Asset::get()->add(PREFIX + "/data/sound/balloon_bounce2.wav", AssetType::SOUND);
Asset::get()->add(PREFIX + "/data/sound/bubble4.wav", AssetType::SOUND); Asset::get()->add(PREFIX + "/data/sound/balloon_bounce3.wav", AssetType::SOUND);
Asset::get()->add(PREFIX + "/data/sound/bullet.wav", AssetType::SOUND); Asset::get()->add(PREFIX + "/data/sound/bullet.wav", AssetType::SOUND);
Asset::get()->add(PREFIX + "/data/sound/clock.wav", AssetType::SOUND); Asset::get()->add(PREFIX + "/data/sound/clock.wav", AssetType::SOUND);
Asset::get()->add(PREFIX + "/data/sound/coffee_out.wav", AssetType::SOUND); Asset::get()->add(PREFIX + "/data/sound/coffee_out.wav", AssetType::SOUND);
@@ -310,24 +310,24 @@ void Director::setFileList() {
Asset::get()->add(PREFIX + "/data/shaders/crtpi_240.glsl", AssetType::DATA); Asset::get()->add(PREFIX + "/data/shaders/crtpi_240.glsl", AssetType::DATA);
// Texturas - Balloons // Texturas - Balloons
Asset::get()->add(PREFIX + "/data/gfx/balloon/balloon0.png", AssetType::BITMAP);
Asset::get()->add(PREFIX + "/data/gfx/balloon/balloon0.ani", AssetType::ANIMATION);
Asset::get()->add(PREFIX + "/data/gfx/balloon/balloon1.png", AssetType::BITMAP); Asset::get()->add(PREFIX + "/data/gfx/balloon/balloon1.png", AssetType::BITMAP);
Asset::get()->add(PREFIX + "/data/gfx/balloon/balloon1.ani", AssetType::ANIMATION); Asset::get()->add(PREFIX + "/data/gfx/balloon/balloon1.ani", AssetType::ANIMATION);
Asset::get()->add(PREFIX + "/data/gfx/balloon/balloon2.png", AssetType::BITMAP); Asset::get()->add(PREFIX + "/data/gfx/balloon/balloon2.png", AssetType::BITMAP);
Asset::get()->add(PREFIX + "/data/gfx/balloon/balloon2.ani", AssetType::ANIMATION); Asset::get()->add(PREFIX + "/data/gfx/balloon/balloon2.ani", AssetType::ANIMATION);
Asset::get()->add(PREFIX + "/data/gfx/balloon/balloon3.png", AssetType::BITMAP); Asset::get()->add(PREFIX + "/data/gfx/balloon/balloon3.png", AssetType::BITMAP);
Asset::get()->add(PREFIX + "/data/gfx/balloon/balloon3.ani", AssetType::ANIMATION); Asset::get()->add(PREFIX + "/data/gfx/balloon/balloon3.ani", AssetType::ANIMATION);
Asset::get()->add(PREFIX + "/data/gfx/balloon/balloon4.png", AssetType::BITMAP);
Asset::get()->add(PREFIX + "/data/gfx/balloon/balloon4.ani", AssetType::ANIMATION);
// Texturas - Explosiones // Texturas - Explosiones
Asset::get()->add(PREFIX + "/data/gfx/balloon/explosion0.png", AssetType::BITMAP);
Asset::get()->add(PREFIX + "/data/gfx/balloon/explosion0.ani", AssetType::ANIMATION);
Asset::get()->add(PREFIX + "/data/gfx/balloon/explosion1.png", AssetType::BITMAP); Asset::get()->add(PREFIX + "/data/gfx/balloon/explosion1.png", AssetType::BITMAP);
Asset::get()->add(PREFIX + "/data/gfx/balloon/explosion1.ani", AssetType::ANIMATION); Asset::get()->add(PREFIX + "/data/gfx/balloon/explosion1.ani", AssetType::ANIMATION);
Asset::get()->add(PREFIX + "/data/gfx/balloon/explosion2.png", AssetType::BITMAP); Asset::get()->add(PREFIX + "/data/gfx/balloon/explosion2.png", AssetType::BITMAP);
Asset::get()->add(PREFIX + "/data/gfx/balloon/explosion2.ani", AssetType::ANIMATION); Asset::get()->add(PREFIX + "/data/gfx/balloon/explosion2.ani", AssetType::ANIMATION);
Asset::get()->add(PREFIX + "/data/gfx/balloon/explosion3.png", AssetType::BITMAP); Asset::get()->add(PREFIX + "/data/gfx/balloon/explosion3.png", AssetType::BITMAP);
Asset::get()->add(PREFIX + "/data/gfx/balloon/explosion3.ani", AssetType::ANIMATION); Asset::get()->add(PREFIX + "/data/gfx/balloon/explosion3.ani", AssetType::ANIMATION);
Asset::get()->add(PREFIX + "/data/gfx/balloon/explosion4.png", AssetType::BITMAP);
Asset::get()->add(PREFIX + "/data/gfx/balloon/explosion4.ani", AssetType::ANIMATION);
// Texturas - Power Ball // Texturas - Power Ball
Asset::get()->add(PREFIX + "/data/gfx/balloon/powerball.png", AssetType::BITMAP); Asset::get()->add(PREFIX + "/data/gfx/balloon/powerball.png", AssetType::BITMAP);