Commit dc99e616 authored by Kevin Balz's avatar Kevin Balz

more tweaks

parent 48d8bdf1
Pipeline #3417 canceled with stage
......@@ -20,7 +20,7 @@
"FixedPath": {
"pause_between_steps": 1,
"wait_beats": 1
}
},
"Shooting": {
"spawn_offset": 1,
"pause_between_shots": 1
......
dummy
#################################
####################-----########
######---|##|-----||> >|#######
##---| 7|--| 5 -- |#######
#|@ 5 |#######
##---| 7|--| 1 -- |#######
######---|##|-----||> >|#######
####################-| |-########
#####################| |#########
#####################| |#########
####################-- --########
###################|4 6|#######
###############----| |#######
##############| |#######
##############| |--| |#######
##############- -##|2 8|#######
#############|0 |##-----########
#############| |###############
#############| 0|###############
#############| |###############
#############|0 |###############
#############| |###############
#############| 0|###############
#############| |###############
##############| |################
##############| |--------########
##############| d|#######
##############| |#######
##############| d|#######
##############| |#######
##############| d|#######
##############| |#######
###############----------########
#################################
#################################
#################################
#################################
#################################
#################################
......@@ -16,7 +16,7 @@ namespace phase_shifter::gameplay {
} // namespace
Beat_system::Beat_system(mirrage::util::Message_bus& bus, mirrage::asset::Asset_manager& assets)
: _bus(bus), _assets(assets)
: _bus(bus), _mailbox(bus), _assets(assets)
{
auto input = _assets.open(mirrage::asset::AID("beat:pulse")).get_or_throw();
std::string line;
......@@ -29,6 +29,8 @@ namespace phase_shifter::gameplay {
_state.beats_left = static_cast<int>(_time_stamps.size());
_state.avg_beat_time =
static_cast<float>(_time_stamps[_time_stamps.size() - 1]) / _time_stamps.size();
_mailbox.subscribe_to([&](Beat_missed_msg& e) { decrease_beats_left(1); });
}
void Beat_system::update(mirrage::util::Time dt)
......
......@@ -7,6 +7,9 @@
namespace phase_shifter::gameplay {
struct Beat_missed_msg {
};
struct Beat_state {
bool beat = false;
float time_since_beat = 0.f;
......@@ -36,6 +39,7 @@ namespace phase_shifter::gameplay {
private:
mirrage::util::Message_bus& _bus;
mirrage::util::Mailbox_collection _mailbox;
mirrage::asset::Asset_manager& _assets;
Beat_state _state;
float _acc = 0.f;
......
......@@ -15,8 +15,8 @@ namespace phase_shifter::gameplay {
using mirrage::ecs::components::Transform_comp;
namespace {
constexpr auto damage_beat_penalty = 10;
constexpr auto kill_beat_gain = 5;
constexpr auto damage_beat_penalty = 5;
constexpr auto kill_beat_gain = 10;
}
Combat_system::Combat_system(mirrage::util::Message_bus& bus,
......
......@@ -85,7 +85,7 @@ namespace phase_shifter::gameplay {
}
} else {
_bus.send<Damaged_msg>(transform.owner_handle());
_bus.send<Beat_missed_msg>();
LOG(plog::debug) << "miss";
}
}
......
......@@ -295,10 +295,15 @@ namespace phase_shifter::level {
.post_create([=](auto entity) {
entity.process([&](gameplay::Fixed_path_comp& fixed_path) {
fixed_path.update_path({180});
fixed_path.pause_between_steps = 2;
});
entity.process([&](gameplay::Shooting_comp& shooting) {
shooting.default_orientation = 270;
shooting.set_patterns({gameplay::Bulletpattern({{0, 0}})});
shooting.pause_between_shots = 2;
});
entity.process([&](gameplay::Movement_comp& movement) {
movement.distance_per_step = 4;
});
})
.create();
......
......@@ -89,7 +89,7 @@ namespace phase_shifter {
LOG(plog::info) << "Renderer Memory usage: " << msg.str();
}
});
_level_system->load("proto");
_level_system->load("main");
auto bg_music = engine.assets().load<std::shared_ptr<eam::opus>>("music:pulse"_aid).get_blocking();
_music = engine.audio().generate_context_ptr(bg_music);
......
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