2021-06-23 21:18:33 +02:00
|
|
|
#include "classicmapcreator.h"
|
2021-09-28 05:48:06 +02:00
|
|
|
#include "classicarrownote.h"
|
2022-05-17 06:22:18 +02:00
|
|
|
#include "gamecontext.h"
|
2021-06-23 21:18:33 +02:00
|
|
|
|
2021-08-10 21:08:45 +02:00
|
|
|
// Replace with interface by dependency injection
|
2021-12-28 19:04:50 +01:00
|
|
|
#include "graphics/animations/classicflyinganimationscenario.h"
|
|
|
|
#include "graphics/animations/classicdyinganimationscenario.h"
|
2021-08-10 21:08:45 +02:00
|
|
|
//
|
|
|
|
|
2022-05-17 06:22:18 +02:00
|
|
|
auto classic::createBeatmap(const std::string& filepath, const std::shared_ptr<GameContext>& context) -> Beatmap
|
2021-06-23 21:18:33 +02:00
|
|
|
{
|
|
|
|
(void) filepath;
|
|
|
|
|
2021-12-29 15:59:18 +01:00
|
|
|
kku::microsec starting_beat_offset = 402162;
|
2021-06-23 21:18:33 +02:00
|
|
|
int amount_of_beats = 209;
|
2021-12-29 15:59:18 +01:00
|
|
|
kku::microsec interval = 1412162;
|
|
|
|
kku::microsec tempo_interval = interval / 4;
|
|
|
|
kku::microsec note_input_offset = 412162 / 2;
|
2021-07-21 20:15:56 +02:00
|
|
|
//microsec note_input_offset_fast = 412162 / 6;
|
2021-12-29 15:59:18 +01:00
|
|
|
kku::microsec bpm_iterator = starting_beat_offset;
|
|
|
|
kku::microsec bpm_end = starting_beat_offset + (interval * amount_of_beats);
|
2021-06-23 21:18:33 +02:00
|
|
|
|
2021-12-29 15:59:18 +01:00
|
|
|
std::vector<kku::microsec> input_intervals = {note_input_offset / 3, note_input_offset / 3 * 2, note_input_offset};
|
|
|
|
std::set<ClassicNote*, kku::NotePtrComparator> notes;
|
2021-06-23 21:18:33 +02:00
|
|
|
input_intervals.shrink_to_fit();
|
|
|
|
|
|
|
|
bpm_iterator += tempo_interval;
|
|
|
|
|
|
|
|
float x = 90.;
|
|
|
|
|
2021-07-15 04:45:52 +02:00
|
|
|
int counter = 3;
|
|
|
|
|
2021-06-23 21:18:33 +02:00
|
|
|
while (bpm_iterator < bpm_end)
|
|
|
|
{
|
2022-05-17 06:22:18 +02:00
|
|
|
ArrowElement element;
|
2021-09-14 21:02:23 +02:00
|
|
|
|
2022-05-17 06:22:18 +02:00
|
|
|
element.position = kku::Point(x, 390.f);
|
|
|
|
element.falling_curve_interpolation = {};
|
2022-01-11 21:15:24 +01:00
|
|
|
|
|
|
|
element.keys = {kku::SystemEvent::Key::Code::W,
|
|
|
|
kku::SystemEvent::Key::Code::Up};
|
|
|
|
|
2022-05-17 06:22:18 +02:00
|
|
|
element.type = Type::UP;
|
|
|
|
|
|
|
|
bool hold = false;
|
2021-07-15 04:45:52 +02:00
|
|
|
|
|
|
|
if (counter == 0)
|
|
|
|
{
|
2022-05-17 06:22:18 +02:00
|
|
|
hold = true;
|
2022-01-11 21:15:24 +01:00
|
|
|
|
|
|
|
element.keys = {kku::SystemEvent::Key::Code::D,
|
|
|
|
kku::SystemEvent::Key::Code::Right};
|
|
|
|
|
2022-05-17 06:22:18 +02:00
|
|
|
element.type = Type::RIGHT;
|
|
|
|
|
|
|
|
counter = 13;
|
2021-07-15 04:45:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
--counter;
|
|
|
|
|
2022-05-17 06:22:18 +02:00
|
|
|
ClassicArrowNote::Init init
|
|
|
|
{
|
|
|
|
context,
|
|
|
|
bpm_iterator,
|
|
|
|
input_intervals,
|
|
|
|
{element},
|
|
|
|
hold
|
|
|
|
};
|
2021-09-14 21:02:23 +02:00
|
|
|
|
2022-05-15 09:30:33 +02:00
|
|
|
notes.insert(new ClassicArrowNote(std::move(init)));
|
2021-07-21 20:15:56 +02:00
|
|
|
|
2021-06-23 21:18:33 +02:00
|
|
|
bpm_iterator += tempo_interval;
|
|
|
|
x += 70;
|
|
|
|
|
|
|
|
if (x >= 1200)
|
|
|
|
x = 90.;
|
|
|
|
}
|
|
|
|
|
2021-10-03 17:23:28 +02:00
|
|
|
return {std::move(notes), note_input_offset * 8};
|
2021-06-23 21:18:33 +02:00
|
|
|
}
|
2021-09-14 21:02:23 +02:00
|
|
|
|