21 lines
392 B
C++
21 lines
392 B
C++
#include "../generator.h"
|
|
#include "../level.h"
|
|
#include <stdlib.h>
|
|
|
|
#define N PLATFORM_COUNT
|
|
|
|
gen3::gen3(): m_path_carvers{{0}, {N/3}, {2*N/3}}
|
|
{
|
|
srand(123456);
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|