Commit 975662da authored by Kevin Balz's avatar Kevin Balz
Browse files

tweaks

parent 8d67ff9d
Pipeline #3391 failed with stage
in 4 minutes and 12 seconds
......@@ -23,7 +23,7 @@
"attack_width": 0.5
},
"Stationary_attack": {
"radius": 7
"radius": 5.5
},
"Rigid_body": {
"radius": 0.5
......
......@@ -36,8 +36,8 @@ namespace phase_shifter::gameplay {
}
glm::vec2 k_position(k_transform.position.x, k_transform.position.z);
if(glm::length(position - k_position) < attack.radius + 1) {
auto attack_direction = glm::normalize(k_position - position);
_bus.send<Enemy_killed_msg>(k_transform.position, glm::vec3(attack_direction.x, 0, attack_direction.y));
//auto attack_direction = glm::normalize(k_position - position);
//_bus.send<Enemy_killed_msg>(k_transform.position, glm::vec3(attack_direction.x, 0, attack_direction.y));
_ecs.erase(entity);
}
}
......
......@@ -73,18 +73,21 @@ namespace phase_shifter::ui {
while (beat_index < static_cast<int>(beats.size())) {
auto x_offset = (beats[beat_index] - _passed) * bar_speed;
if(x_offset > beat_bar_length) {
break;
}
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;
float alpha = 1 - (x_offset / beat_bar_length);
auto bar_color_float = beat_index < static_cast<int>(beats.size() * 0.8f) ? ImVec4(1, 1, 1, alpha)
: ImVec4(1, 0, 0, alpha);
auto bar_color = ImGui::ColorConvertFloat4ToU32(bar_color_float);
ImVec2 p(cursor.x + viewport.z / 2 - x_offset, cursor.y - height / 2.f);
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}, bar_color, 1);
if(x_offset > beat_bar_length + 50) {
break;
}
beat_index++;
}
......
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