Enemy pathing is back.

main
Zed A. Shaw 7 days ago
parent 54fa1a23ce
commit 435ad8f237
  1. 5
      map.cpp
  2. 1
      map.hpp

@ -293,6 +293,10 @@ void Map::set_target(const Point &at, int value) {
$input_map[at.y][at.x] = 0;
}
void Map::clear_light_target(const Point &at) {
$input_map[at.y][at.x] = 1;
}
void Map::clear_target(const Point &at) {
$input_map[at.y][at.x] = 1;
}
@ -407,6 +411,7 @@ int Map::light_level(int level, size_t x, size_t y) {
void Map::render_light(LightSource source, Point at) {
Point min, max;
light_box(source, at, min, max);
clear_light_target(at);
for(size_t x = min.x; x <= max.x; ++x) {
for(size_t y = min.y; y <= max.y; ++y) {

@ -85,6 +85,7 @@ public:
Point center_camera(const Point &around, size_t view_x, size_t view_y);
void reset_light();
void set_light_target(const Point &at, int value=0);
void clear_light_target(const Point &at);
void path_light();
void light_box(LightSource source, Point from, Point &min_out, Point &max_out);
int light_level(int level, size_t x, size_t y);

Loading…
Cancel
Save