diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-21 15:37:31 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-21 15:37:31 +0200 |
commit | e8601b35b601b0ee1486dfaa12385e71b7f2b300 (patch) | |
tree | 244fc97a12ee17e28e6fc407988508bfbc06d89a /Artist.cpp | |
parent | fe8f7273f0efdfe319a0d3e3b2fc2847992745af (diff) |
WIP quadtree visualization scaffolding
Diffstat (limited to 'Artist.cpp')
-rw-r--r-- | Artist.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -12,6 +12,7 @@ Artist::Artist(Museum & museum, ArtistData data) : museum(museum) { void Artist::update() { this->update_edge_collision(); this->update_movement(); + this->update_color(); } void Artist::update_edge_collision() { @@ -27,6 +28,11 @@ void Artist::update_edge_collision() { } void Artist::update_movement() { + if (this->data.waiting > 0) { + this->data.waiting--; + return; + } + float last_x = this->data.x; float last_y = this->data.y; @@ -37,3 +43,22 @@ void Artist::update_movement() { if (abs(int(last_y) - int(this->data.y)) > 0) this->step = true; } +void Artist::update_color() { + // waiting color + if (this->data.waiting > 0) { + this->color = { + .red = 0xff, + .green = 0x00, + .blue = 0x00, + }; + return; + } + + // default color + this->color = { + .red = 0x00, + .green = 0x00, + .blue = 0x00, + }; +} + |