Lighting is now in its own class using the new Pathing class. This should allow me to make it more consistent and possibly make Pathing more efficient.
This commit is contained in:
parent
e05335b153
commit
3f7a9cc124
18 changed files with 209 additions and 257 deletions
5
gui.cpp
5
gui.cpp
|
@ -37,6 +37,7 @@ GUI::GUI(DinkyECS::World &world, Map& game_map) :
|
|||
$log({{"Welcome to the game!"}}),
|
||||
$status_ui(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT),
|
||||
$map_view(GAME_MAP_POS, 0, 0, 0, true),
|
||||
$lights(game_map.width(), game_map.height(), game_map.limit()),
|
||||
$world(world),
|
||||
$sounds("./assets"),
|
||||
$renderer()
|
||||
|
@ -71,7 +72,7 @@ void GUI::create_renderer() {
|
|||
auto player = $world.get_the<Player>();
|
||||
|
||||
$map_view.set_renderer(Renderer([&] {
|
||||
System::draw_map($world, $game_map, $canvas, $map_view.width, $map_view.height);
|
||||
System::draw_map($world, $game_map, $lights.lighting(), $canvas, $map_view.width, $map_view.height);
|
||||
return canvas($canvas);
|
||||
}));
|
||||
|
||||
|
@ -227,7 +228,7 @@ void GUI::run_systems() {
|
|||
auto player = $world.get_the<Player>();
|
||||
System::motion($world, $game_map);
|
||||
System::enemy_pathing($world, $game_map, player);
|
||||
System::lighting($world, $game_map, player);
|
||||
System::lighting($world, $game_map, $lights, player);
|
||||
System::collision($world, player);
|
||||
System::death($world);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue