Commit 8a387761 authored by Tim Scheiber's avatar Tim Scheiber
Browse files

Merge branch 'develop' into feature/7-enemy-attack

parents b3ab6f84 aa896962
Pipeline #3334 failed with stage
in 3 minutes and 1 second
......@@ -70,15 +70,17 @@ namespace phase_shifter::ui {
//auto beats = std::clamp(beat_state.beats_left, 0, 5);
ImGui::BeginChild("Line", {viewport.z, bar_height}, true);
ImDrawList* drawList = ImGui::GetWindowDrawList();
while (beat_index < static_cast<int>(beats.size())) {
auto x_offset = (beats[beat_index] - _passed) * bar_speed;
auto height = beat_bar_height * (1.f - glm::smoothstep(0.f, beat_bar_length, x_offset));
auto bar_color = beat_index < static_cast<int>(beats.size() * 0.8f) ? 0xFFFFFFFF : 0xFF0000FF;
ImVec2 p(cursor.x + viewport.z / 2 - x_offset, cursor.y - height / 2.f);
drawList->AddLine(p, {p.x, p.y + height}, 0xFFFFFFFF, 1);
drawList->AddLine(p, {p.x, p.y + height}, bar_color, 1);
p.x = cursor.x + viewport.z / 2 + x_offset;
drawList->AddLine(p, {p.x, p.y + height}, 0xFFFFFFFF, 1);
drawList->AddLine(p, {p.x, p.y + height}, bar_color, 1);
if(x_offset > beat_bar_length + 50) {
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment