25 lines
421 B
C
25 lines
421 B
C
#include "world.h"
|
|
#include "tile.h"
|
|
|
|
|
|
static world global = {0};
|
|
|
|
world_t world_get(int x, int y)
|
|
{
|
|
if (0<=x && x<=W_SIZE_X && 0<=y && y<=W_SIZE_Y)
|
|
return global[x][y];
|
|
else
|
|
{
|
|
world_t cell = {W_DEATH,0};
|
|
return cell;
|
|
}
|
|
}
|
|
|
|
void display_cell(int cx, int cy, int sx, int sy)
|
|
{
|
|
world_t cell=world_get(cx,cy);
|
|
if (cell.type==W_TUYAU)
|
|
tuyau_draw(cell.state, sx, sy);
|
|
}
|
|
|