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
2d25371f
authored
May 02, 2025
by
Jaime de la Chica Bergillos
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Texto debug eliminado
parent
85a9bd23
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1 additions
and
23 deletions
Executable
GestorPantallas.cpp
Historia.cpp
Hitbox.cpp
Mano.cpp
PantallaInicio.cpp
PantallaMundo.cpp
PantallaTutorial.cpp
Personaje.cpp
Sonido.cpp
Sprite.cpp
Executable
View file @
2d25371f
No preview for this file type
GestorPantallas.cpp
View file @
2d25371f
...
...
@@ -35,7 +35,6 @@ void GestorPantallas::mainLoop(){
if
(
!
inicializarSDL
())
{
return
;
}
std
::
cout
<<
"Se ha iniciicididialci SDL"
<<
std
::
endl
;
while
(
!
pantallas
.
empty
()){
int
tamx
=
0
;
...
...
Historia.cpp
View file @
2d25371f
...
...
@@ -166,10 +166,8 @@ static void iniciarPuzlePantallaResuelto(){
Agapito
.
unsetInventario
(
0
);
if
(
!
historiaPrincipal
.
soltarCartera
){
play_video
(
"assets/alternativo"
,
"es"
);
cout
<<
"Es alternativo"
<<
endl
;
}
else
{
play_video
(
"assets/colocarCaja"
,
"es"
);
cout
<<
"Es normal"
<<
endl
;
}
Sprite
sprDestornillador
(
"assets/destornillador.png"
);
...
...
Hitbox.cpp
View file @
2d25371f
...
...
@@ -2,7 +2,6 @@
bool
Hitbox
::
colisiona
(
int
x
,
int
z
){
if
(
x
<=
xMaximo
&&
x
>=
xMinimo
&&
z
<=
zMaximo
&&
z
>=
zMinimo
){
std
::
cout
<<
"Esta colisionando"
;
return
true
;
}
else
return
false
;
}
\ No newline at end of file
Mano.cpp
View file @
2d25371f
...
...
@@ -21,7 +21,6 @@ brazos(array<shared_ptr<Sprite>, 4> {
void
Mano
::
move
(
Facing
direction
)
{
this
->
estado
=
direction
;
std
::
cout
<<
" move la mano antes Se mueve a "
<<
x
<<
" "
<<
profundidades
<<
endl
;
cola
.
push_back
(
Cola
(
brazos
[
estado
],
x
,
profundidades
));
switch
(
estado
)
{
case
Frente
:
...
...
@@ -37,14 +36,10 @@ void Mano::move(Facing direction) {
profundidades
-=
209
;
break
;
}
cout
<<
" move la mano despues Se mueve a "
<<
x
<<
" "
<<
profundidades
<<
endl
;
}
void
Mano
::
renderizar
(
SDL_Renderer
*
renderer
,
int
tamx
,
int
tamy
)
{
cout
<<
" Renderizar mano Se mueve a "
<<
x
<<
" "
<<
profundidades
<<
endl
;
manos
[
estado
]
->
renderizar
(
renderer
,
x
,
profundidades
,
170
,
170
,
tamx
,
tamy
);
}
...
...
@@ -58,7 +53,6 @@ void Mano::renderizar_cola(SDL_Renderer *renderer, int tamx, int tamy) {
void
Mano
::
comprobarColision
(
Hitbox
&
hitbox
){
if
(
hitbox
.
colisiona
(
x
,
profundidades
)){
cout
<<
"Esta colisionando la mano"
<<
endl
;
cola
.
pop_back
();
switch
(
estado
)
{
case
Frente
:
...
...
PantallaInicio.cpp
View file @
2d25371f
...
...
@@ -50,7 +50,6 @@ void PantallaInicio::manejarEntrada(Handle &handle) {
SDL_GetMouseState
(
&
xRaton
,
&
zRaton
);
xRaton
*=
(
1920.0
/
handle
.
getTamX
());
zRaton
*=
(
1080.0
/
handle
.
getTamY
());
cout
<<
"Raton x "
<<
xRaton
<<
" Raton z "
<<
zRaton
<<
endl
;
if
(
colisionesInterfaz
[
0
].
colisiona
(
xRaton
,
zRaton
)
){
sonidoBoton
.
play
();
iniciar
(
handle
);
...
...
PantallaMundo.cpp
View file @
2d25371f
...
...
@@ -80,7 +80,6 @@ void PantallaMundo::manejarEntrada(Handle &handle) {
SDL_GetMouseState
(
&
xRaton
,
&
zRaton
);
xRaton
*=
(
1920.0
/
handle
.
getTamX
());
zRaton
*=
(
1080.0
/
handle
.
getTamY
());
cout
<<
"Raton x "
<<
xRaton
<<
" Raton z "
<<
zRaton
<<
endl
;
// Activar el ojo si esta abierto
if
(
colisionesInterfaz
[
0
].
colisiona
(
xRaton
,
zRaton
)
&&
ojo_abierto
){
...
...
PantallaTutorial.cpp
View file @
2d25371f
...
...
@@ -47,7 +47,6 @@ void PantallaTutorial::manejarEntrada(Handle &handle) {
SDL_GetMouseState
(
&
xRaton
,
&
zRaton
);
xRaton
*=
(
1920.0
/
handle
.
getTamX
());
zRaton
*=
(
1080.0
/
handle
.
getTamY
());
cout
<<
"Raton x "
<<
xRaton
<<
" Raton z "
<<
zRaton
<<
endl
;
if
(
colisionesInterfaz
[
0
].
colisiona
(
xRaton
,
zRaton
)
){
sonidoBoton
.
play
();
iniciar
(
handle
);
...
...
Personaje.cpp
View file @
2d25371f
...
...
@@ -38,7 +38,6 @@ void Personaje::move(Facing direction) {
}
this
->
estado
=
direction
;
cout
<<
" move antes Se mueve a "
<<
x
<<
" "
<<
profundidades
<<
endl
;
switch
(
estado
)
{
case
Frente
:
profundidades
+=
5
;
...
...
@@ -53,7 +52,7 @@ void Personaje::move(Facing direction) {
profundidades
-=
5
;
break
;
}
cout
<<
" move despues Se mueve a "
<<
x
<<
" "
<<
profundidades
<<
endl
;
}
...
...
@@ -67,7 +66,6 @@ void Personaje::renderizar(SDL_Renderer *renderer, int tamx, int tamy) {
if
(
milis
.
count
()
>
200
)
{
indice_movimiento
=
0
;
}
cout
<<
" Renderizar Se mueve a "
<<
x
<<
" "
<<
profundidades
<<
endl
;
movimientos
[
estado
][
indice_movimiento
].
renderizar
(
renderer
,
x
,
200
,
profundidades
*
0.5
,
profundidades
,
tamx
,
tamy
,
true
);
}
...
...
Sonido.cpp
View file @
2d25371f
...
...
@@ -16,15 +16,10 @@ Sonido::~Sonido(){
//-1 es loop
void
Sonido
::
play
(){
if
(
archivo
==
nullptr
){
cout
<<
"No hay cancion nano"
<<
endl
;
}
if
(
cancion
){
Mix_PlayMusic
(
archivo
,
-
1
);
cout
<<
"Ha sonado"
;
}
else
{
Mix_PlayMusic
(
archivo
,
1
);
cout
<<
"Ha sonado"
;
}
tocada
=
true
;
}
...
...
Sprite.cpp
View file @
2d25371f
...
...
@@ -23,7 +23,6 @@ SDL_Texture *Sprite::get_textura(SDL_Renderer *Renderer) {
}
void
Sprite
::
renderizar
(
SDL_Renderer
*
Renderer
,
int
x
,
int
y
,
int
w
,
int
h
,
int
tamx
,
int
tamy
,
bool
centrar
)
{
printf
(
"RENDER TEXTURA %s
\n
"
,
camino
.
c_str
());
texture
=
get_textura
(
Renderer
);
...
...
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