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
714c58ec
authored
Apr 06, 2025
by
Jaime de la Chica Bergillos
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Pantalla con chinchetas
parent
0166aee8
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
17 additions
and
23 deletions
Executable
Historia.cpp
Historia.h
Objeto.cpp
Objeto.h
PantallaFecha.cpp
PantallaFecha.h
PantallaInicio.cpp
PantallaMundo.cpp
assets/pantallaPantalla.png
Executable
View file @
714c58ec
No preview for this file type
Historia.cpp
View file @
714c58ec
...
...
@@ -16,7 +16,7 @@ void Historia::limpiarEstado(){
}
};
static
Objeto
generarObjetoPantalla
(
bool
(
*
funcion
)(
Objeto
*
))
{
static
Objeto
generarObjetoPantalla
(
bool
(
*
funcion
)(
Objeto
*
,
Handle
&
))
{
Sprite
sprPantalla
(
"assets/pantalla.png"
);
Hitbox
hitPantalla
(
300
,
200
,
500
,
-
1000000000
);
...
...
@@ -36,8 +36,8 @@ static Objeto generarObjetoCalendario() {
static
void
iniciarInicio
()
{
auto
funcionPantalla
=
[](
Objeto
*
Pantalla
)
->
bool
{
play_video
(
"assets/Encerrado"
,
"es"
);
auto
funcionPantalla
=
[](
Objeto
*
Pantalla
,
Handle
&
handle
)
->
bool
{
play_video
(
"assets/MiedoCalendario1"
,
"es"
);
historiaPrincipal
.
pasarDeEstadoA
(
Historia
::
Secuencia
::
Inicio
,
Historia
::
Secuencia
::
CalendarioVisto
);
return
false
;
...
...
@@ -56,7 +56,7 @@ static void iniciarInicio() {
static
void
iniciarCalendarioVisto
(){
auto
funcionPantalla
=
[](
Objeto
*
Pantalla
)
->
bool
{
auto
funcionPantalla
=
[](
Objeto
*
Pantalla
,
Handle
&
handle
)
->
bool
{
play_video
(
"assets/MiedoCalendario2"
,
"es"
);
return
false
;
};
...
...
@@ -87,8 +87,8 @@ static void iniciarCalendarioVisto(){
static
void
iniciarCalendarioQuitado
(){
auto
funcionPantalla
=
[](
Objeto
*
Pantalla
)
->
bool
{
// TODO
auto
funcionPantalla
=
[](
Objeto
*
Pantalla
,
Handle
&
handle
)
->
bool
{
handle
.
addPantalla
(
getPantallaFecha
());
return
false
;
};
...
...
Historia.h
View file @
714c58ec
...
...
@@ -16,7 +16,7 @@ class Historia{
};
private
:
Secuencia
estadoActual
=
Inici
o
;
Secuencia
estadoActual
=
CalendarioQuitad
o
;
void
limpiarEstado
();
void
siguienteEstado
(
Secuencia
estado
);
...
...
Objeto.cpp
View file @
714c58ec
...
...
@@ -19,8 +19,8 @@ void Objeto::renderizar(SDL_Renderer *renderer, int tamx, int tamy){
}
}
bool
Objeto
::
interactuar
(){
return
funcionInteraccion
(
this
);
bool
Objeto
::
interactuar
(
Handle
&
handle
){
return
funcionInteraccion
(
this
,
handle
);
}
...
...
Objeto.h
View file @
714c58ec
#pragma once
#include "GestorPantallas.h"
#include "Sprite.h"
#include "Hitbox.h"
#include <iostream>
...
...
@@ -20,12 +20,12 @@ class Objeto {
int
y
;
int
w
;
int
h
;
bool
(
*
funcionInteraccion
)(
Objeto
*
);
bool
(
*
funcionInteraccion
)(
Objeto
*
,
Handle
&
);
public
:
Hitbox
&
getHitbox
();
Objeto
(
Sprite
sprite_normal_
,
Sprite
sprite_overworld_
,
Sprite
sprite_overworld_highlight_
,
Hitbox
colision_
,
int
_x
,
int
_y
,
int
_w
,
int
_h
,
State
estado_
,
bool
(
*
_funcionInteraccion
)(
Objeto
*
))
:
Objeto
(
Sprite
sprite_normal_
,
Sprite
sprite_overworld_
,
Sprite
sprite_overworld_highlight_
,
Hitbox
colision_
,
int
_x
,
int
_y
,
int
_w
,
int
_h
,
State
estado_
,
bool
(
*
_funcionInteraccion
)(
Objeto
*
,
Handle
&
))
:
sprite_normal
(
sprite_normal_
),
sprite_overworld
(
sprite_overworld_
),
sprite_overworld_highlight
(
sprite_overworld_highlight_
),
colision
(
colision_
),
x
(
_x
),
y
(
_y
),
w
(
_w
),
h
(
_h
),
estado
(
estado_
),
funcionInteraccion
(
_funcionInteraccion
){}
...
...
@@ -42,7 +42,7 @@ public:
this
->
y
=
y
;
}
bool
interactuar
();
bool
interactuar
(
Handle
&
handle
);
bool
colisionaObjeto
(
int
x
,
int
z
);
};
PantallaFecha.cpp
View file @
714c58ec
...
...
@@ -6,9 +6,8 @@
PantallaFecha
::
PantallaFecha
()
:
fuente1
(
"assets/OpenSans-Italic.ttf"
,
100
),
Fondo1
(
"assets/PantallaPantalla.png"
),
instrucciones
(
fuente1
,
"Pon la combinación de tu cumpleaños"
,{
255
,
255
,
255
}),
interfaz
(
"assets/InterfazCinematica.png"
),
Fondo1
(
"assets/pantallaPantalla.png"
),
carne
(
Sprite
(
"assets/carneNombre.png"
),
Sprite
(
"assets/carneNombre.png"
),
Sprite
(
"assets/carneNombre.png"
),
Hitbox
(
0
,
0
,
0
,
0
),
0
,
0
,
0
,
0
,
normal
,
nullptr
),
...
...
@@ -84,8 +83,7 @@ void PantallaFecha::renderizar(SDL_Renderer *renderer, int tamx, int tamy) {
if
(
AgapitoTieneCarne
){
carne
.
renderizar
(
renderer
,
tamx
,
tamy
);
}
interfaz
.
renderizar
(
renderer
,
0
,
0
,
0
,
0
,
tamx
,
tamy
);
instrucciones
.
renderizar
(
renderer
,
0
,
0
,
tamx
,
tamy
);
Texto
num1
(
fuente1
,
std
::
to_string
(
combinacionActual
[
0
]).
c_str
(),{
0
,
0
,
0
});
Texto
num2
(
fuente1
,
std
::
to_string
(
combinacionActual
[
1
]).
c_str
(),{
0
,
0
,
0
});
...
...
PantallaFecha.h
View file @
714c58ec
...
...
@@ -16,8 +16,6 @@ class PantallaFecha : public Pantalla {
Objeto
carne
;
Fuente
fuente1
;
Sprite
Fondo1
;
Sprite
interfaz
;
Texto
instrucciones
;
int
combinacionActual
[
4
];
int
combinacionBuena
[
4
];
bool
AgapitoTieneCarne
;
...
...
PantallaInicio.cpp
View file @
714c58ec
...
...
@@ -33,7 +33,6 @@ void PantallaInicio::manejarEntrada(Handle &handle) {
switch
(
event
.
key
.
keysym
.
sym
)
{
case
13
:
Cancion
.
pausar
();
play_video
(
"assets/Encerrado"
,
"es"
);
handle
.
reemplazamePor
(
colPantallas
[
0
]);
break
;
}
...
...
@@ -48,7 +47,6 @@ void PantallaInicio::manejarEntrada(Handle &handle) {
cout
<<
"Raton x "
<<
xRaton
<<
" Raton z "
<<
zRaton
<<
endl
;
if
(
colisionesInterfaz
[
0
].
colisiona
(
xRaton
,
zRaton
)
){
Cancion
.
pausar
();
play_video
(
"assets/Encerrado"
,
"es"
);
handle
.
reemplazamePor
(
colPantallas
[
0
]);
}
}
...
...
PantallaMundo.cpp
View file @
714c58ec
...
...
@@ -80,7 +80,7 @@ void PantallaMundo::manejarEntrada(Handle &handle) {
zRaton
*=
(
1080.0
/
handle
.
getTamY
());
cout
<<
"Raton x "
<<
xRaton
<<
" Raton z "
<<
zRaton
<<
endl
;
if
(
colisionesInterfaz
[
0
].
colisiona
(
xRaton
,
zRaton
)
&&
ojo_abierto
){
if
(
objetos
[
indiceColision
].
interactuar
()){
if
(
objetos
[
indiceColision
].
interactuar
(
handle
)){
objetos
.
erase
(
objetos
.
begin
()
+
indiceColision
);
}
}
...
...
assets/pantallaPantalla.png
View file @
714c58ec
776 KB
|
W:
|
H:
942 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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