diff --git a/raycaster.cpp b/raycaster.cpp index a3a7884..44e973c 100644 --- a/raycaster.cpp +++ b/raycaster.cpp @@ -82,6 +82,9 @@ void Raycaster::position_camera(float player_x, float player_y) { $dir_y = 0; $plane_x = 0; $plane_y = 0.66; + + // BUG: make this a function? + aiming_at = { size_t($pos_x + $dir_x), size_t($pos_y + $dir_y) }; } void Raycaster::draw_pixel_buffer() { diff --git a/worldbuilder.cpp b/worldbuilder.cpp index 5138fef..f1ac1f9 100644 --- a/worldbuilder.cpp +++ b/worldbuilder.cpp @@ -88,6 +88,7 @@ DinkyECS::Entity WorldBuilder::configure_entity_in_map(DinkyECS::World &world, j dbc::check(found, "Failed to find a place for this thing."); auto item = world.entity(); + // NOTE: aiming_at is set by the rayview since it knows that world.set(item, {pos.x, pos.y}); if(entity_data["inventory_count"] > 0) {