diff --git a/VaporWaveWars/combat.cpp b/VaporWaveWars/combat.cpp index 5b3543b..1f3746f 100644 --- a/VaporWaveWars/combat.cpp +++ b/VaporWaveWars/combat.cpp @@ -1,12 +1,12 @@ #include "combat.hpp" Combat::Combat() { -// ia = false; - ia = true; + ia = false; +// ia = true; attacking = playerOneTurn = true; player = new Player(0); - enemy = new IaEnemy(1); -// enemy = new Player(1); +// enemy = new IaEnemy(1); + enemy = new Player(1); initShader(); } diff --git a/VaporWaveWars/compas.cpp b/VaporWaveWars/compas.cpp index 86bbc4e..18a2253 100644 --- a/VaporWaveWars/compas.cpp +++ b/VaporWaveWars/compas.cpp @@ -36,6 +36,10 @@ void Compas::incraeseTime() { ++spaceTime; } +bool Compas::isPressed() const { + return isPress; +} + int Compas::get (int i) const { return notes[i]; } diff --git a/VaporWaveWars/compas.hpp b/VaporWaveWars/compas.hpp index a73a400..5afb2ff 100644 --- a/VaporWaveWars/compas.hpp +++ b/VaporWaveWars/compas.hpp @@ -20,6 +20,7 @@ public: void add(); void end(); void incraeseTime(); + bool isPressed() const; bool operator ==(const Compas& d) const; }; diff --git a/VaporWaveWars/iaenemy.cpp b/VaporWaveWars/iaenemy.cpp index 1b1a8c0..45b41bb 100644 --- a/VaporWaveWars/iaenemy.cpp +++ b/VaporWaveWars/iaenemy.cpp @@ -3,7 +3,7 @@ IaEnemy::IaEnemy() : Actor(1) {} IaEnemy::IaEnemy(int numplayer): Actor(numplayer) {} bool IaEnemy::updateLogic(float deltaTime, sf::RenderWindow *window) { - //some playe return true + return true; } diff --git a/VaporWaveWars/player.cpp b/VaporWaveWars/player.cpp index 1a2e693..d1c8520 100644 --- a/VaporWaveWars/player.cpp +++ b/VaporWaveWars/player.cpp @@ -19,7 +19,7 @@ bool Player::event(sf::Event e) { if(e.key.code == sf::Keyboard::C) compas.start(); if(e.key.code == sf::Keyboard::Space) { compas.add(); - animate = true; + if (compas.isPressed() && !animate) animate = true; } break; case (sf::Event::KeyReleased):