Commit 619ca8f9 authored by Tim Scheiber's avatar Tim Scheiber
Browse files

Turrets now turn

parent 1c0f88a5
Pipeline #3312 failed with stage
in 5 minutes and 1 second
......@@ -19,7 +19,8 @@
},
"Fragile": {},
"ContinuousPath": {
"direction": 270,
"curvature": 0
},
"Rigid_body": {
"radius": 0.1
}
}
......@@ -18,4 +18,6 @@ namespace phase_shifter::gameplay {
rotation += 2 * rotation_per_step;
}
}
void Shooting_comp::set_patterns(std::vector<Bulletpattern> patterns) { this->patterns = patterns; }
}
\ No newline at end of file
......@@ -28,6 +28,7 @@ namespace phase_shifter::gameplay {
Bulletpattern next_pattern();
void do_rotation();
void set_patterns(std::vector<Bulletpattern> patterns);
float default_orientation = 0; // default orientation of "forward" in degrees with 0° beeing North (-Z)
float rotation_per_step = 0; // rotation the turret does per beat in degrees during idle state
......@@ -36,7 +37,7 @@ namespace phase_shifter::gameplay {
float attack_radius = 0; // radius in which the turret targets the target
unsigned int pause_between_shots = 0; // number of beats the turret waits between shots
float target_direction = 0; // angular direction towards the target in degrees with 0° beeing North (-Z)
float target_direction = 0; // angular direction towards the target in degrees with 0° beeing North (-Z)
std::vector<Bulletpattern> patterns; // sequence of bullet patterns that are looped through
float rotation = 0; // current rotation from default_orientation in degrees
unsigned int wait_beats = 0; // number of beats the turret waits before shooting again
......
......@@ -95,7 +95,7 @@ namespace phase_shifter {
.post_create([=](auto entity) {
entity.process([&](gameplay::Fixed_path_comp& fixed_path) { fixed_path.update_path({180}); });
entity.process([&](gameplay::Shooting_comp& shooting) {
shooting.patterns.push_back(gameplay::Bulletpattern({{0, 5}}));
shooting.set_patterns({gameplay::Bulletpattern({{0, 0}})});
});
})
.create();
......
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