2022-08-20 16:32:37 +02:00
|
|
|
#include "../generator.h"
|
|
|
|
#include "../level.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2022-08-27 14:03:44 +02:00
|
|
|
#define N PLATFORM_COUNT
|
|
|
|
|
2023-05-24 13:08:59 +02:00
|
|
|
gen3::gen3(): m_path_carvers{{0}, {N/3}, {2*N/3}}
|
2022-08-20 16:32:37 +02:00
|
|
|
{
|
2023-05-24 13:08:59 +02:00
|
|
|
srand(123456);
|
|
|
|
}
|
2022-08-20 16:32:37 +02:00
|
|
|
|
2023-05-24 13:08:59 +02:00
|
|
|
void gen3::generate(struct level *level)
|
|
|
|
{
|
|
|
|
struct platform p;
|
|
|
|
for(int i = 0; i < 3; i++) {
|
|
|
|
if(m_path_carvers[i].next(SECTION_LENGTH, &p)) {
|
|
|
|
level->platform_buffer.push_back(p);
|
|
|
|
}
|
|
|
|
}
|
2022-08-20 16:32:37 +02:00
|
|
|
}
|