#include "level.h" #include "lzr.h" #include "cfg.h" #include static const char level[LEVEL_HEIGHT * LEVEL_WIDTH] = { "0....." "......" "......" "......" "......" ".....0" }; void level_draw() { LZR_DrawSetColor(1, 1, 1, 1); for (int y = 0; y < LEVEL_HEIGHT; y++) for (int x = 0; x < LEVEL_WIDTH; x++) { const int dx = (x + 6) * CFG_TSIZE; const int dy = (y + 5) * CFG_TSIZE; if (level_get(x, y) == '0' && ((rand() & 3) == 3 || LZR_GetTick() & 1)) LZR_DrawRectangle(true, dx, dy, CFG_TSIZE, CFG_TSIZE); } } int level_get(int x, int y) { return level[x + y * LEVEL_WIDTH]; }