forked from kdx/jtmm2-old
1KBCJ3 flashbacks. Draw multiple layers.
This commit is contained in:
parent
943348e545
commit
6b3178566b
|
@ -4,11 +4,11 @@
|
|||
#include <gint/defs/types.h>
|
||||
|
||||
typedef struct Level {
|
||||
int width; /* in tiles */
|
||||
int height; /* in tiles */
|
||||
uint width; /* in tiles */
|
||||
uint height; /* in tiles */
|
||||
const uint8_t **layers; /* points toward the level content */
|
||||
int layers_count;
|
||||
uint solid_layer; /* id of the solid layer */
|
||||
uint8_t layers_count;
|
||||
uint8_t solid_layer; /* id of the solid layer */
|
||||
} Level;
|
||||
|
||||
#include "camera.h"
|
||||
|
|
|
@ -15,4 +15,4 @@ local function create_random_level(width, height, layers)
|
|||
end
|
||||
end
|
||||
|
||||
create_random_level(64, 64, 1)
|
||||
create_random_level(64, 64, 3)
|
||||
|
|
|
@ -10,7 +10,9 @@ void level_step(const Level *level) {
|
|||
}
|
||||
|
||||
void level_draw(const Level *level, Camera *camera) {
|
||||
layer_draw(level, camera, 0);
|
||||
for (int i = 0; i < level->layers_count; ++i) {
|
||||
layer_draw(level, camera, i);
|
||||
}
|
||||
}
|
||||
|
||||
void layer_draw(const Level *level, Camera *camera, uint layer_id) {
|
||||
|
|
Loading…
Reference in New Issue