Commit 1112fe59 authored by Florian Oetke's avatar Florian Oetke

Merge branch 'develop' of...

Merge branch 'develop' of gitlab.fsi.hochschule-trier.de:GameDevWeek/sommersemester-2019/cpp/phaseshifter into develop
parents a2c8a67c 44eb5260
Pipeline #3458 canceled with stage
......@@ -16,7 +16,8 @@
"Simple_animation_controller": {
"animations": {
"idle": "anim:idle",
"dash": "anim:dash"
"dash": "anim:dash",
"dance": "anim:dance"
},
"current_animation": {
"id": "idle"
......
No preview for this file type
......@@ -97,7 +97,7 @@ namespace phase_shifter {
ImGui::TextColored(ImVec4{0, 0, 0, 1}, "You have Won");
auto score_msg = "Score: " + std::to_string(_score);
ImGui::TextUnformatted("");
ImGui::TextColored(ImVec4{0, 0, 0, 1}, score_msg.c_str());
ImGui::TextColored(ImVec4{0, 0, 0, 1}, "%s", score_msg.c_str());
} else
ImGui::TextColored(ImVec4{0, 0, 0, 1}, "Game Over");
......
......@@ -73,6 +73,10 @@ namespace phase_shifter::gameplay {
if(entity.has<Player_comp>()) {
_bus.send<Special_attack_msg>(transform.position);
}
entity.process([](mirrage::renderer::Simple_animation_controller_comp& controller) {
controller.play("dance"_strid, 1.f, false, false, true);
controller.fade_time(0.0001f);
});
} else {
// start movement
move.step_time_left = beat.avg_beat_time * move.step_time_percentage;
......@@ -131,7 +135,8 @@ namespace phase_shifter::gameplay {
entity.process([](mirrage::renderer::Simple_animation_controller_comp& controller) {
controller.current().process([&](mirrage::renderer::Animation_state& state) {
auto time_left = state.animation->duration() - state.time;
if(state.animation_id == "dash"_strid && time_left <= 0.1f) {
if((state.animation_id == "dash"_strid || state.animation_id == "dance"_strid)
&& time_left <= 0.1f) {
controller.play("idle"_strid);
}
});
......
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