Merge branch 'master' of github.com:ralucado/WaveGGJ17

This commit is contained in:
Ralusama19 2017-01-21 18:23:49 +01:00
commit 5b3b062171
3 changed files with 10 additions and 5 deletions

View file

@ -39,5 +39,5 @@ void main(void) {
vec4 color = vec4(255, 120, 153, 255) / 255.; vec4 color = vec4(255, 120, 153, 255) / 255.;
vec4 colorB = vec4(255,255,255,255)/ 255.; vec4 colorB = vec4(255,255,255,255)/ 255.;
gl_FragColor = (grid(fract(uv))) * color; gl_FragColor = (grid(fract(uv))) * color - line(umuv.y, 0., 0.175, 0.025) * color * 2.;
} }

View file

@ -29,10 +29,15 @@ bool Actor::update(float deltaTime, sf::RenderWindow *window) {
return this->updateLogic(deltaTime, window); return this->updateLogic(deltaTime, window);
} }
bool Actor::hitBy(Compas enemy) const { bool Actor::hitBy(Compas enemy) {
if (enemy == compas) std::cout << "dodge" << std::endl; bool hit = enemy == compas;
if (hit) std::cout << "dodge" << std::endl;
else std::cout << "hit" << std::endl; else std::cout << "hit" << std::endl;
return enemy == compas; if (!hit) {
character->setState(PlayerState::hurt);
animate = PlayerState::inMidle;
}
return hit;
} }
Compas Actor::getAttack() const { Compas Actor::getAttack() const {

View file

@ -12,7 +12,7 @@ public:
Actor(int num); Actor(int num);
bool update(float deltaTime, sf::RenderWindow *window); bool update(float deltaTime, sf::RenderWindow *window);
void draw(sf::RenderWindow *window); void draw(sf::RenderWindow *window);
bool hitBy(Compas enemy) const; bool hitBy(Compas enemy);
Compas getAttack() const; Compas getAttack() const;
virtual bool event(sf::Event e, bool def) = 0; virtual bool event(sf::Event e, bool def) = 0;