zkwul/include/main.h

30 lines
876 B
C

#pragma once
#define LEVEL_SIZE 16
#define TILE_SIZE 12
struct TwoValues {
int x, y;
};
struct Player {
struct TwoValues pos;
struct TwoValues spawn;
};
/* using a typedef is what cool kids do at least i think
* you might no remember what `int x` is :(
* if x is declared with `tile_t x` you know x is some tile :)
* knowledge is power and cool
* as bonus it looks cool in function declaration
* cool stuff told u :D */
typedef int tile_t;
struct TwoValues search(tile_t x, tile_t level[16][16]);
/* here u can see i replaced x and y arguments with your twovalues struct
* u made smthing use it
* it will be handy in the future and makes better looking code */
int collide_pixel(struct TwoValues pos, tile_t obj, tile_t level[16][16]);
int collide(struct TwoValues pos, int h, tile_t obj, tile_t level[16][16]);
struct Player level_reset(struct Player player);