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
4ba78045
authored
Apr 20, 2025
by
Jaime de la Chica Bergillos
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Minijuego de la cama FINISHED TERMINATED DONE
parent
7cb94026
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
11 deletions
Executable
Mano.cpp
PantallaCama.cpp
PantallaCama.h
Executable
View file @
4ba78045
No preview for this file type
Mano.cpp
View file @
4ba78045
...
...
@@ -25,7 +25,7 @@ void Mano::move(Facing direction) {
cola
.
push_back
(
Cola
(
brazos
[
estado
],
x
,
profundidades
));
switch
(
estado
)
{
case
Frente
:
profundidades
+=
2
10
;
profundidades
+=
2
09
;
break
;
case
Derecha
:
x
+=
220
;
...
...
@@ -34,7 +34,7 @@ void Mano::move(Facing direction) {
x
-=
220
;
break
;
case
Fondo
:
profundidades
-=
2
10
;
profundidades
-=
2
09
;
break
;
}
cout
<<
" move la mano despues Se mueve a "
<<
x
<<
" "
<<
profundidades
<<
endl
;
...
...
@@ -62,7 +62,7 @@ void Mano::comprobarColision(Hitbox &hitbox){
cola
.
pop_back
();
switch
(
estado
)
{
case
Frente
:
profundidades
-=
2
10
;
profundidades
-=
2
09
;
break
;
case
Derecha
:
x
-=
220
;
...
...
@@ -71,7 +71,7 @@ void Mano::comprobarColision(Hitbox &hitbox){
x
+=
220
;
break
;
case
Fondo
:
profundidades
+=
2
10
;
profundidades
+=
2
09
;
break
;
}
}
...
...
PantallaCama.cpp
View file @
4ba78045
...
...
@@ -9,7 +9,7 @@ PantallaCama::PantallaCama() :
Fondo1
(
"assets/puzleMover.jpeg"
),
atras
(
Sprite
(
"assets/volver.png"
),
Sprite
(
"assets/volver.png"
),
Sprite
(
"assets/volver.png"
),
Hitbox
(
1800
,
1600
,
300
,
200
),
1600
,
200
,
100
,
100
,
normal
,
nullptr
),
reiniciar
(
Sprite
(
"assets/reiniciar.png"
),
Sprite
(
"assets/reiniciar.png"
),
Sprite
(
"assets/reiniciar.png"
),
Hitbox
(
1
800
,
1600
,
300
,
2
00
),
1600
,
400
,
100
,
100
,
normal
,
nullptr
),
reiniciar
(
Sprite
(
"assets/reiniciar.png"
),
Sprite
(
"assets/reiniciar.png"
),
Sprite
(
"assets/reiniciar.png"
),
Hitbox
(
1
700
,
1600
,
500
,
4
00
),
1600
,
400
,
100
,
100
,
normal
,
nullptr
),
cartera
(
"assets/cartera.png"
),
obstaculos
{
Sprite
(
"assets/nuez.png"
),
...
...
@@ -22,9 +22,16 @@ PantallaCama::PantallaCama() :
Sprite
(
"assets/pinguino.png"
)
},
hitObs
{
Hitbox
(
500
,
300
,
300
,
200
)
Hitbox
(
420
,
0
,
10000
,
0
),
Hitbox
(
10000
,
1480
,
10000
,
0
),
Hitbox
(
10000
,
0
,
10000
,
800
),
Hitbox
(
10000
,
0
,
19
,
-
2000
),
Hitbox
(
840
,
400
,
840
,
400
),
Hitbox
(
1280
,
840
,
630
,
430
),
Hitbox
(
1300
,
1050
,
430
,
230
),
Hitbox
(
835
,
610
,
230
,
0
)
},
hitCartera
(
0
,
0
,
0
,
0
),
hitCartera
(
630
,
0
,
23
0
,
0
),
cancion
(
"assets/LonesomeJourneyByKeysOfMoonMusic.wav"
,
true
),
sonidoBoton
(
"assets/SonidoClicar.wav"
,
false
)
...
...
@@ -40,9 +47,12 @@ void PantallaCama::comprobarColisionesActivas() {
}
}
void
PantallaCama
::
comprobarColisionesPasivas
()
{
void
PantallaCama
::
comprobarColisionesPasivas
(
Handle
&
handle
)
{
if
(
mano
.
comprobarColisionPasiva
(
hitCartera
)){
carteraTocada
=
true
;
cancion
.
pausar
();
historiaPrincipal
.
pasarDeEstadoA
(
historiaPrincipal
.
CajaAbierta
,
historiaPrincipal
.
CarteraRecuperada
);
handle
.
removeme
();
}
}
...
...
@@ -71,7 +81,7 @@ void PantallaCama::manejarEntrada(Handle &handle) {
break
;
};
comprobarColisionesActivas
();
comprobarColisionesPasivas
();
comprobarColisionesPasivas
(
handle
);
break
;
case
SDL_KEYUP
:
...
...
PantallaCama.h
View file @
4ba78045
...
...
@@ -39,7 +39,7 @@ public:
return
false
;
};
void
comprobarColisionesPasivas
();
void
comprobarColisionesPasivas
(
Handle
&
handle
);
void
comprobarColisionesActivas
();
};
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