Skip to content

Commit

Permalink
collision debug hud
Browse files Browse the repository at this point in the history
  • Loading branch information
bitten2up committed Nov 2, 2024
1 parent 7b853e0 commit de8cf73
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bit_game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ void bit_main()
#ifdef DISCORD
updateDiscordPresence("Overworld", "e");
#endif
p_moveOverworld();
render_map(bitgame.map);
r_sprite(&bitgame.player.entitySprite);
p_moveOverworld();
break;
case platformer:
#ifdef DISCORD
Expand Down
5 changes: 4 additions & 1 deletion src/e_collision.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <string.h>
#include <time.h>
#include <SDL2/SDL.h>
#include "r_render.h"
#include "tmx.h"


Expand Down Expand Up @@ -105,7 +106,9 @@ int32_t checkCollision(tmx_map* map, int x, int y)
else if (chests->type == L_LAYER)
{
#ifdef DEBUG
printf("value of tile: %i\n", chests->content.gids[(y-2) * map->width + (x - 2)]);
char buffer[2042];
sprintf(buffer, "value of tile: %i", chests->content.gids[((y - 3) * map->width) + (x - 2)]);
r_textbox(buffer, 200, 20);
#endif

return chests->content.gids[((y - 3) * map->width) + (x - 2)];
Expand Down

0 comments on commit de8cf73

Please sign in to comment.