#include "world.h" #include "tile.h" #include world_t * w_current; image_t * w_fond; int w_current_x; int w_current_y; world_t* world_get(int x, int y) { x/=8; y/=8; if (0<=x && xtype==TUYAU) draw_tile(sx, sy, &tuyau, cell->p1, cell->p2); if (cell->type==EARTH) draw_tile(sx, sy, &earth, cell->p1, cell->p2); if (cell->type==BRICK) draw_tile(sx, sy, &brick, 0, cell->p1); if (cell->type==GIFT) draw_tile(sx, sy, &gift, cell->p1, 0); if (cell->type==COIN) draw_tile(sx, sy, &coin, cell->p1, 0); } int world_get_ctg(int x, int y) { world_t *c=world_get(x,y); if (c==0) { return CTG_DEATH; } switch (c->type) { case COIN: case EMPTY: return CTG_EMPTY; case DEATH: return CTG_DEATH; case TUYAU: case GIFT: case BRICK: case EARTH: return CTG_SOIL; default: return CTG_EMPTY; } } static int max(const int x, const int y) { return (x