Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
José Pardo Madera
/
ProjectoMultimeda2025
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c006ac39
authored
Apr 14, 2025
by
José Pardo Madera
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Arreglos de sonido
parent
e62ec81f
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
8 deletions
Executable
PantallaFecha.cpp
Personaje.cpp
Sonido.cpp
assets/SonidoClicar.wav
assets/paso2mini.wav
Executable
View file @
c006ac39
No preview for this file type
PantallaFecha.cpp
View file @
c006ac39
...
@@ -58,8 +58,6 @@ void PantallaFecha::manejarEntrada(Handle &handle) {
...
@@ -58,8 +58,6 @@ void PantallaFecha::manejarEntrada(Handle &handle) {
for
(
int
i
=
0
;
i
<
4
;
i
++
){
for
(
int
i
=
0
;
i
<
4
;
i
++
){
if
(
botonesArriba
[
i
].
colisionaObjeto
(
xRaton
,
zRaton
)){
if
(
botonesArriba
[
i
].
colisionaObjeto
(
xRaton
,
zRaton
)){
combinacionActual
[
i
]
=
(
combinacionActual
[
i
]
+
1
)
%
10
;
combinacionActual
[
i
]
=
(
combinacionActual
[
i
]
+
1
)
%
10
;
sonidoBoton
.
play
();
}
}
if
(
botonesAbajo
[
i
].
colisionaObjeto
(
xRaton
,
zRaton
)){
if
(
botonesAbajo
[
i
].
colisionaObjeto
(
xRaton
,
zRaton
)){
if
(
combinacionActual
[
i
]
==
0
){
if
(
combinacionActual
[
i
]
==
0
){
...
@@ -85,7 +83,7 @@ void PantallaFecha::manejarEntrada(Handle &handle) {
...
@@ -85,7 +83,7 @@ void PantallaFecha::manejarEntrada(Handle &handle) {
}
}
void
PantallaFecha
::
renderizar
(
SDL_Renderer
*
renderer
,
int
tamx
,
int
tamy
)
{
void
PantallaFecha
::
renderizar
(
SDL_Renderer
*
renderer
,
int
tamx
,
int
tamy
)
{
if
(
!
cancion
.
getTocada
()){
if
(
!
cancion
.
getTocada
()
&&
sonidoBoton
.
acabado
()
){
cancion
.
play
();
cancion
.
play
();
}
}
...
...
Personaje.cpp
View file @
c006ac39
...
@@ -10,7 +10,7 @@ array<array<Sprite, 4>, 4> sprites_constantes = {
...
@@ -10,7 +10,7 @@ array<array<Sprite, 4>, 4> sprites_constantes = {
Personaje
::
Personaje
()
:
movimientos
(
sprites_constantes
)
,
Personaje
::
Personaje
()
:
movimientos
(
sprites_constantes
)
,
paso1
(
"assets/paso1.wav"
,
false
),
paso1
(
"assets/paso1.wav"
,
false
),
paso2
(
"assets/paso2.wav"
,
false
),
paso2
(
"assets/paso2
mini
.wav"
,
false
),
pasoActual
(
"assets/paso1.wav"
,
false
)
pasoActual
(
"assets/paso1.wav"
,
false
)
{
{
...
@@ -25,15 +25,16 @@ void Personaje::move(Facing direction) {
...
@@ -25,15 +25,16 @@ void Personaje::move(Facing direction) {
if
(
milis
.
count
()
>
100
||
this
->
estado
!=
direction
)
{
if
(
milis
.
count
()
>
100
||
this
->
estado
!=
direction
)
{
indice_movimiento
=
(
indice_movimiento
+
1
)
%
movimientos
[
this
->
estado
].
size
();
indice_movimiento
=
(
indice_movimiento
+
1
)
%
movimientos
[
this
->
estado
].
size
();
momento_ultimo_movimiento
=
now
;
momento_ultimo_movimiento
=
now
;
if
(
pasoActual
.
acabado
())
{
if
(
primerPaso
){
if
(
primerPaso
){
pasoActual
=
paso1
;
pasoActual
=
paso1
;
pasoActual
.
play
();
pasoActual
.
play
();
}
else
if
(
!
paso
&&
pasoActual
.
acabado
())
{
}
else
{
pasoActual
=
paso1
;
pasoActual
=
paso2
;
pasoActual
.
play
();
pasoActual
.
play
();
}
}
primerPaso
=
false
;
primerPaso
=!
primerPaso
;
}
}
}
this
->
estado
=
direction
;
this
->
estado
=
direction
;
...
...
Sonido.cpp
View file @
c006ac39
...
@@ -31,6 +31,7 @@ void Sonido::play(){
...
@@ -31,6 +31,7 @@ void Sonido::play(){
void
Sonido
::
pausar
(){
void
Sonido
::
pausar
(){
Mix_HaltMusic
();
Mix_HaltMusic
();
tocada
=
false
;
}
}
bool
Sonido
::
getTocada
(){
return
tocada
;}
bool
Sonido
::
getTocada
(){
return
tocada
;}
...
...
assets/SonidoClicar.wav
View file @
c006ac39
No preview for this file type
assets/paso2mini.wav
0 → 100644
View file @
c006ac39
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment