QUOTE: Let your heart guide you always.

tile.h - freezo - A retro platform game

freezo

A retro platform game
git clone git@soophie.de:/srv/git/freezo
log | files | refs | readme

tile.h (748B)


      1 #pragma once
      2 
      3 typedef struct Tile tile_t;
      4 
      5 #include "util.h"
      6 #include "game.h"
      7 
      8 typedef enum {
      9   TILE_AIR,
     10   TILE_WOOD_PLATFORM,
     11   TILE_STONE_JOINT,
     12   TILE_STONE_WALL,
     13   TILE_GRASS,
     14   TILE_STONE,
     15   TILE_SNOW,
     16   TILE_SAND,
     17   TILE_BOX,
     18   TILE_BG_CHANDELIER,
     19   TILE_BG_WINDOW_1,
     20   TILE_BG_WINDOW_2,
     21   TILE_BG_BANNER,
     22   TILE_BG_BRICK_1,
     23   TILE_BG_BRICK_2,
     24   TILE_BG_BRICK_3,
     25   TILE_BG_INFO,
     26 } tile_e;
     27 
     28 struct Tile {
     29   pos_t pos;
     30   tile_e type;
     31 };
     32 
     33 tile_t *tile_create(pos_t pos, tile_e type);
     34 void tile_update(tile_t *tile, game_t *game);
     35 void tile_draw(tile_t *tile, game_t *game);
     36 tile_t *tile_get(game_t *game, int x, int y);
     37 bool tile_ground(tile_t *tile);
     38 bool tile_solid(tile_t *tile);
     39 bool tile_wall(tile_t *tile);
     40 void tile_free(tile_t *tile);