This commit is contained in:
2019-02-15 16:00:24 -08:00
parent d30c3405a0
commit 931ba0e63f
3 changed files with 115 additions and 22 deletions

View File

@@ -8,6 +8,22 @@ Node::Node(sf::Vector2i position_) {
next_state = false;
}
Node::Node(sf::Vector2i position_, std::vector<int> color) {
position = position_;
curr_state = false;
next_state = false;
b_r = color[0];
b_g = color[1];
b_b = color[2];
b_a = color[3];
r = 0;
g = 0;
b = 0;
a = 0;
}
Node::~Node() {
}
@@ -17,6 +33,21 @@ void Node::Revive() {
curr_state = true;
}
void Node::Dim() {
if (CurrentState() == true) {
r = b_r;
g = b_g;
b = b_b;
a = b_a;
} else {
r *= 0.996;
g *= 0.996;
b *= 0.996;
a *= 0.996;
}
}
int Node::CurrentState() {
return curr_state;
}