Skip to content

Commit

Permalink
fix/ sound
Browse files Browse the repository at this point in the history
  • Loading branch information
swiftyjam committed May 20, 2019
1 parent 327967c commit debd80e
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 29 deletions.
44 changes: 21 additions & 23 deletions SpacePizza.depend
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
<vector>
"SFML/Audio.hpp"

1557855583 D
1557855587 D

1557853173 shed changes
"SuperSprite.h"
Expand Down Expand Up @@ -345,7 +345,7 @@

1557855587 hics.hpp>

1558373438 source:/home/samuel/FV/SpacePizza/src/Mundo.cpp
1558375785 source:/home/samuel/FV/SpacePizza/src/Mundo.cpp
"Mundo.h"
"Juego.h"
"Car.h"
Expand Down Expand Up @@ -457,7 +457,7 @@

1555240051 nyxml/tinyxml2.h"

1558373102 /home/samuel/FV/SpacePizza/include/Mundo.h
1558374562 /home/samuel/FV/SpacePizza/include/Mundo.h
<vector>
<SFML/Graphics.hpp>
<iostream>
Expand Down Expand Up @@ -538,16 +538,16 @@
<SFML/Graphics.hpp>
"Mundo.h"

1558369964 source:/home/samuel/FV/SpacePizza/src/Juego.cpp
1558374562 source:/home/samuel/FV/SpacePizza/src/Juego.cpp
"Juego.h"
"EJugando.h"
"EMenu.h"

1558369965 source:/home/samuel/FV/SpacePizza/src/Jugador.cpp
1558375716 source:/home/samuel/FV/SpacePizza/src/Jugador.cpp
"Jugador.h"
"Puntuacion.h"

1557869035 /home/samuel/FV/SpacePizza/include/Jugador.h
1558375726 /home/samuel/FV/SpacePizza/include/Jugador.h
<iostream>
<vector>
<SFML/Graphics.hpp>
Expand Down Expand Up @@ -775,7 +775,7 @@
"Item.h"
<iostream>

1558372247 source:/home/samuel/FV/SpacePizza/src/EFin.cpp
1558374562 source:/home/samuel/FV/SpacePizza/src/EFin.cpp
"EFin.h"
"Juego.h"
"EMenu.h"
Expand All @@ -786,22 +786,22 @@
<sstream>
<SFML/Graphics.hpp>

1558369964 /home/samuel/FV/SpacePizza/include/EFin.h
1558374562 /home/samuel/FV/SpacePizza/include/EFin.h
"State.h"
"SuperSprite.h"
"ControladorSonido.h"
"SFML/Graphics.hpp"

1558373876 source:/home/samuel/FV/SpacePizza/src/EJugando.cpp
1558374562 source:/home/samuel/FV/SpacePizza/src/EJugando.cpp
"EJugando.h"

1558373086 /home/samuel/FV/SpacePizza/include/EJugando.h
1558374562 /home/samuel/FV/SpacePizza/include/EJugando.h
"State.h"
"Juego.h"
"SFML/Graphics.hpp"
"Puntuacion.h"

1558369964 source:/home/samuel/FV/SpacePizza/src/EMenu.cpp
1558374562 source:/home/samuel/FV/SpacePizza/src/EMenu.cpp
"EMenu.h"
"Juego.h"
"EComo.h"
Expand Down Expand Up @@ -1419,17 +1419,15 @@
<vector>
"SFML/Audio.hpp"

<<<<<<< HEAD
1557855930 /home/samuel/FV/SpacePizza/include/ControladorSonido.h

1557855930 o.hpp"
=======
1558369964 /home/samuel/FV/SpacePizza/include/ControladorSonido.h
1558374562 /home/samuel/FV/SpacePizza/include/ControladorSonido.h
<vector>
"SFML/Audio.hpp"
>>>>>>> EstadoFin

1558369964 source:/home/samuel/FV/SpacePizza/src/ControladorSonido.cpp
1557855930 o.hpp"

1558369964 adoFin

1558374562 source:/home/samuel/FV/SpacePizza/src/ControladorSonido.cpp
"ControladorSonido.h"
<iostream>

Expand Down Expand Up @@ -1830,7 +1828,7 @@
1557844549 source:/home/claudia/Desktop/SpacePizza/src/Path.cpp
"Path.h"

1558369964 source:/home/samuel/FV/SpacePizza/src/EComo.cpp
1558375420 source:/home/samuel/FV/SpacePizza/src/EComo.cpp
"EComo.h"
"Juego.h"
"EMenu.h"
Expand All @@ -1840,7 +1838,7 @@
<sstream>
<SFML/Graphics.hpp>

1558369964 /home/samuel/FV/SpacePizza/include/EComo.h
1558375420 /home/samuel/FV/SpacePizza/include/EComo.h
<string>
<sstream>
<SFML/Graphics.hpp>
Expand Down Expand Up @@ -1949,11 +1947,11 @@
1558364384 source:/home/carlos/FV2.0/SpacePizza/src/Puntuacion.cpp
"Puntuacion.h"

1558369965 /home/samuel/FV/SpacePizza/include/Puntuacion.h
1558374562 /home/samuel/FV/SpacePizza/include/Puntuacion.h
<iostream>
<vector>
<SFML/Graphics.hpp>

1558371036 source:/home/samuel/FV/SpacePizza/src/Puntuacion.cpp
1558374562 source:/home/samuel/FV/SpacePizza/src/Puntuacion.cpp
"Puntuacion.h"

4 changes: 3 additions & 1 deletion include/Jugador.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ class Jugador
void updateVida(int change);
int getVidas();
int checkEstado();
bool checkGod();
void setEstado(int e);
void setGod(bool c);
void setCesped(bool c);
void restartEstado();
SuperSprite* getSprite(){ return jugador_sprite; };
Expand All @@ -41,7 +43,7 @@ class Jugador
PhysicsState *pState;
int vidas;
int estado;
bool cesped;
bool cesped,god;

sf::Clock timer_estado;
double limite_estado;
Expand Down
7 changes: 7 additions & 0 deletions src/Jugador.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,13 @@ void Jugador::setCesped(bool c)
{
cesped=c;
}
void Jugador::setGod(bool c)
{
god=c;
}
bool Jugador::checkGod(){
return god;
}
// Este metodo permite modifcar la vida => hay que pasarle el valor a modificar incluyendo el signo si queremos restar
void Jugador::updateVida(int change)
{
Expand Down
15 changes: 10 additions & 5 deletions src/Mundo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ void Mundo::checkPuntoEntrega()
void Mundo::procesarInteraccion(bool eRight, bool eLeft, bool eUp, bool eDown)
{
visionIA();
if(p1->checkEstado()!=11){
if(!p1->checkGod()){
atacaIA();
}
colisionItems();
Expand Down Expand Up @@ -570,7 +570,7 @@ int Mundo::getTime()
void Mundo::updateMundo(bool eRight, bool eLeft, bool eUp, bool eDown,bool godMode, sf::Time t)
{
sf::Vector2f bounce(0.0,0.0);
if(p1->checkEstado()!=11){
if(!p1->checkGod()){
bounce=colisionesMapa(godMode);
}
EnemigoGenerator();
Expand All @@ -579,9 +579,9 @@ void Mundo::updateMundo(bool eRight, bool eLeft, bool eUp, bool eDown,bool godMo
p1->updateJugador(eRight,eLeft,eUp,eDown,bounce,t);

if(godMode)
p1->setEstado(11);
p1->setGod(true);
else{
p1->setEstado(0);
p1->setGod(false);
}


Expand All @@ -598,6 +598,7 @@ void Mundo::updateMundo(bool eRight, bool eLeft, bool eUp, bool eDown,bool godMo
factorVolumen = ((float)500 - (float)distanciaEnemigo) / (float)500;

e1[en]->setVolumen(factorVolumen * 210);

}
/**coches**/
for(unsigned int i = 0; i<carsVector.size(); i++)
Expand Down Expand Up @@ -762,7 +763,7 @@ void Mundo::drawMundo(sf::RenderWindow * ventana, double inter)
text_player_lifes -> setPosition(p1->getSprite()->getRenderPos().x-140,p1->getSprite()->getRenderPos().y - 90);
ventana->draw(*text_player_lifes);

if(p1->checkEstado()==11){
if(p1->checkGod()){
text_player_lifes -> setColor(Color::Green);
}else{
text_player_lifes -> setColor(Color::Red);
Expand Down Expand Up @@ -802,6 +803,10 @@ void Mundo::drawMundo(sf::RenderWindow * ventana, double inter)

if(p1-> checkEstado() == 10)
{
for(unsigned en=0; en< e1.size(); en++)
{
e1[en]->setVolumen(0.0);
}
if( transfer.getElapsedTime().asSeconds()>0.8){
ControladorSonido::getInstance()->stopMusica();
vista = new View();
Expand Down

0 comments on commit debd80e

Please sign in to comment.