summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/level.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/level.c b/src/level.c
index 73f12a6..9febd7c 100644
--- a/src/level.c
+++ b/src/level.c
@@ -80,6 +80,7 @@ db_level_play(SDL_Renderer *renderer, struct db_level *level)
{
struct db_map *map;
SDL_Texture *map_texture;
+ SDL_Rect dstrect;
db_dbg("Playing %s/%s", level->game_id, level->level_id);
@@ -103,6 +104,16 @@ db_level_play(SDL_Renderer *renderer, struct db_level *level)
db_err("Failed to copy texture (%s)", SDL_GetError());
return -1;
}
+ dstrect.x = level->player_x - level->player_r;
+ dstrect.y = level->player_y - level->player_r;
+ dstrect.w = level->player_r * 2;
+ dstrect.h = level->player_r * 2;
+ db_tile_render(level->tilesets, renderer, level->player_gid, &dstrect);
+ dstrect.x = level->target_x - level->target_r;
+ dstrect.y = level->target_y - level->target_r;
+ dstrect.w = level->target_r * 2;
+ dstrect.h = level->target_r * 2;
+ db_tile_render(level->tilesets, renderer, level->target_gid, &dstrect);
db_balls_render(level->balls, renderer);
SDL_RenderPresent(renderer);
SDL_Delay(1000);