BosonX/src/level.h

53 lines
1.1 KiB
C++

#ifndef __LEVEL_H__
# define __LEVEL_H__
#include "settings.h"
#include <vector>
#include <memory>
typedef enum {
PLATFORM_EMPTY,
PLATFORM_WHITE,
PLATFORM_RED,
PLATFORM_BLUE,
PLATFORM_SEPARATING_WALL,
PLATFORM_BLOCK,
PLATFORM_BLOCK_TOP,
} platform_type_t;
struct platform {
/* Face number along the level's cylinder */
int face;
/* Depth and length; the platform lies at [z ... z+length). */
num z;
num length;
/* Platform height above the default height (cylinder quasiradius). This
can be compared with player->height. */
num height;
/* Platform kind. */
platform_type_t type;
/* Whether the platform is currently falling. This is only used for red
platforms. */
bool falling;
/* Whether the SEPARATING_WALL platform is seen from the left side and/or
seen from the right side. */
bool wall_left_sided;
bool wall_right_sided;
};
struct Generator;
struct level {
char const *name;
std::vector<struct platform> platform_buffer;
std::unique_ptr<Generator> gen;
uint16_t bgcolor;
};
extern void level_update(struct level *level, num z, int reference_face);
extern struct level level_create(int level);
#endif /* __LEVEL_H__ */