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
96e3b7f8
authored
Apr 10, 2025
by
Jaime de la Chica Bergillos
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Evento de la llave y el iman
parent
f52556c4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
2 deletions
Executable
Historia.cpp
assets/NoLlegoIman_es.vtt
Executable
View file @
96e3b7f8
No preview for this file type
Historia.cpp
View file @
96e3b7f8
...
...
@@ -43,6 +43,19 @@ static Objeto generarObjetoCartera(bool (*funcion)(Objeto *, Handle&)) {
return
Cartera
;
}
static
Objeto
generarObjetoIman
()
{
Sprite
sprIman
(
"assets/iman.png"
);
Hitbox
hitIman
(
0
,
0
,
0
,
0
);
// Trivial, solo esta en el inventario
auto
funcionIman
=
[](
Objeto
*
Pantalla
,
Handle
&
handle
)
->
bool
{
play_video
(
"assets/ConseguirLlave"
,
"es"
);
historiaPrincipal
.
pasarDeEstadoA
(
Historia
::
Secuencia
::
CarteraRecuperada
,
Historia
::
Secuencia
::
LlaveConseguida
);
return
false
;
};
Objeto
Iman
(
sprIman
,
sprIman
,
sprIman
,
hitIman
,
400
,
150
,
150
,
250
,
normal
,
funcionIman
);
return
Iman
;
}
static
Objeto
generarObjetoPuerta
()
{
auto
funcionPuerta
=
[](
Objeto
*
Puerta
,
Handle
&
handle
)
->
bool
{
play_video
(
"assets/LaPuertaEstaCerrada"
,
"es"
);
...
...
@@ -190,6 +203,46 @@ static void iniciarPuzlePantallaResuelto(){
getPantalla2
()
->
anadirObjeto
(
Puerta
);
}
static
void
iniciarCajaAbierta
(){
Objeto
Puerta
=
generarObjetoPuerta
();
getPantalla2
()
->
anadirObjeto
(
Puerta
);
Sprite
sprLlave
(
"assets/llaveHighlight.png"
);
Hitbox
hitLlave
(
300
,
200
,
500
,
-
1000000000
);
auto
funcionLlave
=
[](
Objeto
*
Cajon
,
Handle
&
handle
)
->
bool
{
play_video
(
"assets/NoLlegoIman"
,
"es"
);
return
false
;
};
Objeto
llave
(
sprLlave
,
sprLlave
,
sprLlave
,
hitLlave
,
100
,
150
,
50
,
50
,
normal
,
funcionLlave
);
getPantalla1
()
->
anadirObjeto
(
llave
);
}
static
void
iniciarCarteraRecuperada
(){
Objeto
Puerta
=
generarObjetoPuerta
();
getPantalla2
()
->
anadirObjeto
(
Puerta
);
Sprite
sprLlave
(
"assets/llaveHighlight.png"
);
Hitbox
hitLlave
(
300
,
200
,
500
,
-
1000000000
);
auto
funcionLlave
=
[](
Objeto
*
Cajon
,
Handle
&
handle
)
->
bool
{
play_video
(
"assets/NoLlegoIman"
,
"es"
);
return
false
;
};
Objeto
llave
(
sprLlave
,
sprLlave
,
sprLlave
,
hitLlave
,
100
,
150
,
50
,
50
,
normal
,
funcionLlave
);
getPantalla1
()
->
anadirObjeto
(
llave
);
auto
funcionCartera
=
[](
Objeto
*
Pantalla
,
Handle
&
handle
)
->
bool
{
play_video
(
"assets/AgapitoSacaIman"
,
"es"
);
getPantallaFecha
()
->
setTieneCarne
(
true
);
Agapito
.
numObjetos
-=
1
;
Agapito
.
inventario
[
Agapito
.
numObjetos
]
=
generarObjetoIman
();
Agapito
.
numObjetos
+=
1
;
return
false
;
};
Agapito
.
inventario
[
Agapito
.
numObjetos
]
=
generarObjetoCartera
(
funcionCartera
);
Agapito
.
numObjetos
+=
1
;
}
void
Historia
::
siguienteEstado
(
Secuencia
estado
){
switch
(
estado
){
...
...
@@ -210,11 +263,11 @@ void Historia::siguienteEstado(Secuencia estado){
break
;
case
CajaAbierta
:
//
iniciarCajaAbierta();
iniciarCajaAbierta
();
break
;
case
CarteraRecuperada
:
//
iniciarCarteraRecuperada();
iniciarCarteraRecuperada
();
break
;
case
LlaveConseguida
:
...
...
assets/NoLlegoIman_es.vtt
0 → 100755
View file @
96e3b7f8
WEBVTT
1
00:00:00.550 --> 00:00:05.000
Me gusta Belén Esteban
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