|
|
@ -33,7 +33,7 @@ GUI::GUI(DinkyECS::World &world, Map& game_map) : |
|
|
|
$game_map(game_map), |
|
|
|
$game_map(game_map), |
|
|
|
$log({{"Welcome to the game!"}}), |
|
|
|
$log({{"Welcome to the game!"}}), |
|
|
|
$status_ui(SCREEN_X, SCREEN_Y, 0, 0), |
|
|
|
$status_ui(SCREEN_X, SCREEN_Y, 0, 0), |
|
|
|
$map_view(0, 0, GAME_MAP_POS, 0, false), |
|
|
|
$map_view(0, 0, GAME_MAP_POS, 0, true), |
|
|
|
$view_port{0,0}, |
|
|
|
$view_port{0,0}, |
|
|
|
$world(world), |
|
|
|
$world(world), |
|
|
|
$sounds("./assets"), |
|
|
|
$sounds("./assets"), |
|
|
@ -231,7 +231,7 @@ void GUI::shake() { |
|
|
|
int x = Random::uniform<int>(-20,20); |
|
|
|
int x = Random::uniform<int>(-20,20); |
|
|
|
int y = Random::uniform<int>(-20,20); |
|
|
|
int y = Random::uniform<int>(-20,20); |
|
|
|
// add x/y back to draw screen
|
|
|
|
// add x/y back to draw screen
|
|
|
|
$renderer.draw_grid($map_view, x, y); |
|
|
|
$renderer.draw($map_view, x, y); |
|
|
|
$renderer.display(); |
|
|
|
$renderer.display(); |
|
|
|
std::this_thread::sleep_for(1ms); |
|
|
|
std::this_thread::sleep_for(1ms); |
|
|
|
} |
|
|
|
} |
|
|
@ -240,8 +240,8 @@ void GUI::shake() { |
|
|
|
void GUI::render_scene() { |
|
|
|
void GUI::render_scene() { |
|
|
|
$renderer.clear(); |
|
|
|
$renderer.clear(); |
|
|
|
|
|
|
|
|
|
|
|
$renderer.draw_text($status_ui); |
|
|
|
$renderer.draw($status_ui); |
|
|
|
$renderer.draw_grid($map_view); |
|
|
|
$renderer.draw($map_view); |
|
|
|
|
|
|
|
|
|
|
|
$renderer.display(); |
|
|
|
$renderer.display(); |
|
|
|
} |
|
|
|
} |
|
|
|