From e8601b35b601b0ee1486dfaa12385e71b7f2b300 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Mon, 21 Oct 2024 15:37:31 +0200 Subject: WIP quadtree visualization scaffolding --- Artist.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'Artist.cpp') diff --git a/Artist.cpp b/Artist.cpp index c73e695..76e0ca9 100644 --- a/Artist.cpp +++ b/Artist.cpp @@ -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, + }; +} + -- cgit v1.2.3