wave files
This commit is contained in:
parent
c07c2a422e
commit
f986d6cb2d
5 changed files with 83 additions and 14 deletions
|
@ -17,7 +17,8 @@ SOURCES += main.cpp \
|
|||
iaenemy.cpp \
|
||||
actor.cpp \
|
||||
soundmanager.cpp \
|
||||
score.cpp
|
||||
score.cpp \
|
||||
wave.cpp
|
||||
|
||||
HEADERS += \
|
||||
game.hpp \
|
||||
|
@ -33,4 +34,5 @@ HEADERS += \
|
|||
iaenemy.hpp \
|
||||
actor.hpp \
|
||||
soundmanager.hpp \
|
||||
score.hpp
|
||||
score.hpp \
|
||||
wave.hpp
|
||||
|
|
20
VaporWaveWars/wave.cpp
Normal file
20
VaporWaveWars/wave.cpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#include "wave.hpp"
|
||||
|
||||
Wave::Wave(bool dir){
|
||||
direction = dir;
|
||||
ASSERT(texture.loadFromFile(spriteFile));
|
||||
}
|
||||
|
||||
void Wave::update(float deltaTime){
|
||||
timestamp += deltaTime;
|
||||
float pos = getPosition().x;
|
||||
if (direction){
|
||||
pos += ; // AMOUNT??
|
||||
}
|
||||
else{
|
||||
pos -= ; // ""
|
||||
}
|
||||
setPosition(pos, getPosition().y);
|
||||
}
|
||||
|
||||
|
26
VaporWaveWars/wave.hpp
Normal file
26
VaporWaveWars/wave.hpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
#ifndef WAVE_HPP
|
||||
#define WAVE_HPP
|
||||
#include "commons.hpp"
|
||||
|
||||
class Wave : public sf::Sprite{
|
||||
private:
|
||||
//CONFIG
|
||||
const std::string spriteFile = WORK_DIR+"Resources/pulsation.png";
|
||||
//POSICIO PLAYER 1
|
||||
float posX1 = W_WIDTH*0.05f, posY1 = W_HEIGHT*0.6f;
|
||||
//POSICIO PLAYER 2
|
||||
float posX2 = W_WIDTH*0.65f, posY2 = W_HEIGHT*0.6f;
|
||||
//END CONFIG
|
||||
|
||||
bool direction; //TRUE => CAP A LA DRETA
|
||||
|
||||
sf::Texture texture;
|
||||
float timestamp;
|
||||
|
||||
public:
|
||||
Wave();
|
||||
Wave(bool dir);
|
||||
void update(float deltaTime);
|
||||
};
|
||||
|
||||
#endif // WAVE_HPP
|
|
@ -60,7 +60,8 @@ SOURCES = ../VaporWaveWars/main.cpp \
|
|||
../VaporWaveWars/player.cpp \
|
||||
../VaporWaveWars/iaenemy.cpp \
|
||||
../VaporWaveWars/actor.cpp \
|
||||
../VaporWaveWars/soundmanager.cpp
|
||||
../VaporWaveWars/soundmanager.cpp \
|
||||
../VaporWaveWars/score.cpp
|
||||
OBJECTS = main.o \
|
||||
game.o \
|
||||
mygame.o \
|
||||
|
@ -73,7 +74,8 @@ OBJECTS = main.o \
|
|||
player.o \
|
||||
iaenemy.o \
|
||||
actor.o \
|
||||
soundmanager.o
|
||||
soundmanager.o \
|
||||
score.o
|
||||
DIST = ../../../Qt/5.7/gcc_64/mkspecs/features/spec_pre.prf \
|
||||
../../../Qt/5.7/gcc_64/mkspecs/common/unix.conf \
|
||||
../../../Qt/5.7/gcc_64/mkspecs/common/linux.conf \
|
||||
|
@ -229,7 +231,8 @@ DIST = ../../../Qt/5.7/gcc_64/mkspecs/features/spec_pre.prf \
|
|||
player.hpp \
|
||||
iaenemy.hpp \
|
||||
actor.hpp \
|
||||
soundmanager.hpp ../VaporWaveWars/main.cpp \
|
||||
soundmanager.hpp \
|
||||
score.hpp ../VaporWaveWars/main.cpp \
|
||||
../VaporWaveWars/game.cpp \
|
||||
../VaporWaveWars/mygame.cpp \
|
||||
../VaporWaveWars/button.cpp \
|
||||
|
@ -241,7 +244,8 @@ DIST = ../../../Qt/5.7/gcc_64/mkspecs/features/spec_pre.prf \
|
|||
../VaporWaveWars/player.cpp \
|
||||
../VaporWaveWars/iaenemy.cpp \
|
||||
../VaporWaveWars/actor.cpp \
|
||||
../VaporWaveWars/soundmanager.cpp
|
||||
../VaporWaveWars/soundmanager.cpp \
|
||||
../VaporWaveWars/score.cpp
|
||||
QMAKE_TARGET = VaporWaveWars
|
||||
DESTDIR =
|
||||
TARGET = VaporWaveWars
|
||||
|
@ -588,6 +592,7 @@ compiler_clean:
|
|||
main.o: ../VaporWaveWars/main.cpp ../VaporWaveWars/mygame.hpp \
|
||||
../VaporWaveWars/game.hpp \
|
||||
../VaporWaveWars/commons.hpp \
|
||||
../VaporWaveWars/soundmanager.hpp \
|
||||
../VaporWaveWars/menu.hpp \
|
||||
../VaporWaveWars/scene.hpp \
|
||||
../VaporWaveWars/button.hpp \
|
||||
|
@ -597,16 +602,18 @@ main.o: ../VaporWaveWars/main.cpp ../VaporWaveWars/mygame.hpp \
|
|||
../VaporWaveWars/actor.hpp \
|
||||
../VaporWaveWars/character.hpp \
|
||||
../VaporWaveWars/iaenemy.hpp \
|
||||
../VaporWaveWars/soundmanager.hpp
|
||||
../VaporWaveWars/score.hpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o ../VaporWaveWars/main.cpp
|
||||
|
||||
game.o: ../VaporWaveWars/game.cpp ../VaporWaveWars/game.hpp \
|
||||
../VaporWaveWars/commons.hpp
|
||||
../VaporWaveWars/commons.hpp \
|
||||
../VaporWaveWars/soundmanager.hpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o game.o ../VaporWaveWars/game.cpp
|
||||
|
||||
mygame.o: ../VaporWaveWars/mygame.cpp ../VaporWaveWars/mygame.hpp \
|
||||
../VaporWaveWars/game.hpp \
|
||||
../VaporWaveWars/commons.hpp \
|
||||
../VaporWaveWars/soundmanager.hpp \
|
||||
../VaporWaveWars/menu.hpp \
|
||||
../VaporWaveWars/scene.hpp \
|
||||
../VaporWaveWars/button.hpp \
|
||||
|
@ -616,28 +623,33 @@ mygame.o: ../VaporWaveWars/mygame.cpp ../VaporWaveWars/mygame.hpp \
|
|||
../VaporWaveWars/actor.hpp \
|
||||
../VaporWaveWars/character.hpp \
|
||||
../VaporWaveWars/iaenemy.hpp \
|
||||
../VaporWaveWars/soundmanager.hpp
|
||||
../VaporWaveWars/score.hpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o mygame.o ../VaporWaveWars/mygame.cpp
|
||||
|
||||
button.o: ../VaporWaveWars/button.cpp ../VaporWaveWars/button.hpp \
|
||||
../VaporWaveWars/commons.hpp
|
||||
../VaporWaveWars/commons.hpp \
|
||||
../VaporWaveWars/soundmanager.hpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o button.o ../VaporWaveWars/button.cpp
|
||||
|
||||
character.o: ../VaporWaveWars/character.cpp ../VaporWaveWars/character.hpp \
|
||||
../VaporWaveWars/commons.hpp
|
||||
../VaporWaveWars/commons.hpp \
|
||||
../VaporWaveWars/soundmanager.hpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o character.o ../VaporWaveWars/character.cpp
|
||||
|
||||
compas.o: ../VaporWaveWars/compas.cpp ../VaporWaveWars/compas.hpp \
|
||||
../VaporWaveWars/commons.hpp
|
||||
../VaporWaveWars/commons.hpp \
|
||||
../VaporWaveWars/soundmanager.hpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o compas.o ../VaporWaveWars/compas.cpp
|
||||
|
||||
scene.o: ../VaporWaveWars/scene.cpp ../VaporWaveWars/scene.hpp \
|
||||
../VaporWaveWars/commons.hpp \
|
||||
../VaporWaveWars/soundmanager.hpp \
|
||||
../VaporWaveWars/game.hpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o scene.o ../VaporWaveWars/scene.cpp
|
||||
|
||||
menu.o: ../VaporWaveWars/menu.cpp ../VaporWaveWars/menu.hpp \
|
||||
../VaporWaveWars/commons.hpp \
|
||||
../VaporWaveWars/soundmanager.hpp \
|
||||
../VaporWaveWars/scene.hpp \
|
||||
../VaporWaveWars/game.hpp \
|
||||
../VaporWaveWars/button.hpp \
|
||||
|
@ -648,11 +660,12 @@ menu.o: ../VaporWaveWars/menu.cpp ../VaporWaveWars/menu.hpp \
|
|||
../VaporWaveWars/actor.hpp \
|
||||
../VaporWaveWars/character.hpp \
|
||||
../VaporWaveWars/iaenemy.hpp \
|
||||
../VaporWaveWars/soundmanager.hpp
|
||||
../VaporWaveWars/score.hpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o menu.o ../VaporWaveWars/menu.cpp
|
||||
|
||||
combat.o: ../VaporWaveWars/combat.cpp ../VaporWaveWars/combat.hpp \
|
||||
../VaporWaveWars/commons.hpp \
|
||||
../VaporWaveWars/soundmanager.hpp \
|
||||
../VaporWaveWars/compas.hpp \
|
||||
../VaporWaveWars/scene.hpp \
|
||||
../VaporWaveWars/game.hpp \
|
||||
|
@ -660,11 +673,12 @@ combat.o: ../VaporWaveWars/combat.cpp ../VaporWaveWars/combat.hpp \
|
|||
../VaporWaveWars/actor.hpp \
|
||||
../VaporWaveWars/character.hpp \
|
||||
../VaporWaveWars/iaenemy.hpp \
|
||||
../VaporWaveWars/soundmanager.hpp
|
||||
../VaporWaveWars/score.hpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o combat.o ../VaporWaveWars/combat.cpp
|
||||
|
||||
player.o: ../VaporWaveWars/player.cpp ../VaporWaveWars/player.hpp \
|
||||
../VaporWaveWars/commons.hpp \
|
||||
../VaporWaveWars/soundmanager.hpp \
|
||||
../VaporWaveWars/compas.hpp \
|
||||
../VaporWaveWars/actor.hpp \
|
||||
../VaporWaveWars/character.hpp
|
||||
|
@ -673,12 +687,14 @@ player.o: ../VaporWaveWars/player.cpp ../VaporWaveWars/player.hpp \
|
|||
iaenemy.o: ../VaporWaveWars/iaenemy.cpp ../VaporWaveWars/iaenemy.hpp \
|
||||
../VaporWaveWars/actor.hpp \
|
||||
../VaporWaveWars/commons.hpp \
|
||||
../VaporWaveWars/soundmanager.hpp \
|
||||
../VaporWaveWars/character.hpp \
|
||||
../VaporWaveWars/compas.hpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o iaenemy.o ../VaporWaveWars/iaenemy.cpp
|
||||
|
||||
actor.o: ../VaporWaveWars/actor.cpp ../VaporWaveWars/actor.hpp \
|
||||
../VaporWaveWars/commons.hpp \
|
||||
../VaporWaveWars/soundmanager.hpp \
|
||||
../VaporWaveWars/character.hpp \
|
||||
../VaporWaveWars/compas.hpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o actor.o ../VaporWaveWars/actor.cpp
|
||||
|
@ -687,6 +703,11 @@ soundmanager.o: ../VaporWaveWars/soundmanager.cpp ../VaporWaveWars/soundmanager.
|
|||
../VaporWaveWars/commons.hpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o soundmanager.o ../VaporWaveWars/soundmanager.cpp
|
||||
|
||||
score.o: ../VaporWaveWars/score.cpp ../VaporWaveWars/score.hpp \
|
||||
../VaporWaveWars/commons.hpp \
|
||||
../VaporWaveWars/soundmanager.hpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o score.o ../VaporWaveWars/score.cpp
|
||||
|
||||
####### Install
|
||||
|
||||
install: FORCE
|
||||
|
|
Binary file not shown.
Reference in a new issue