This repository has been archived on 2022-12-14. You can view files and clone it, but cannot push or open issues or pull requests.
WaveGGJ17/VaporWaveWars/wave.cpp
marti.lloveras e6234333a6 aligned wave
2017-01-22 03:01:10 +01:00

30 lines
607 B
C++

#include "wave.hpp"
bool Wave::getDirection() const
{
return direction;
}
Wave::Wave(bool dir){
direction = dir;
ASSERT(texture.loadFromFile(spriteFile));
setTexture(texture);
setOrigin(texture.getSize().x/2,texture.getSize().y - 1);
// sf::IntRect rect = sf::IntRect(0, 0, texture.getSize().x, texture.getSize().y);
// setTextureRect(rect);
}
void Wave::update(float deltaTime){
float pos = getPosition().x;
if (direction){
pos += 640*deltaTime; // AMOUNT??
}
else{
pos -= 640*deltaTime; // ""
}
setPosition(pos, getPosition().y);
}