#include "entity.h" #include "layers.h" #include "player.h" #include "wall.h" #include #include void main(void) { struct Player player; struct Player newb; struct Wall walls[5]; int collided = 0; player_init(&player, 16, 32); player_init(&newb, 64, 128); wall_init(&walls[0], 16, 0, DWIDTH - 32, 16); wall_init(&walls[1], 16, DHEIGHT - 16, DWIDTH - 32, 16); wall_init(&walls[2], 0, 0, 16, DHEIGHT); wall_init(&walls[3], DWIDTH - 16, 0, 16, DHEIGHT); wall_init(&walls[4], DWIDTH / 2 - 24, DHEIGHT - 64, 48, 48); do { dclear(C_BLACK); entity_grid_draw_hitboxes(); dprint(2, 2, C_WHITE, "%d", collided); dupdate(); clearevents(); collided = entity_move(&player, L_SOLID, keydown(KEY_RIGHT) - keydown(KEY_LEFT), keydown(KEY_DOWN) - keydown(KEY_UP)); } while (!keydown(KEY_EXIT)); return; }