From 1043008ba88b510cd3bf4ee4afabff0039e77225 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Wed, 22 Jan 2020 15:55:04 -0800 Subject: [PATCH] and bus lanes [rebuild] --- game/assets/map/bus_only.svg | 3 +++ game/src/render/lane.rs | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 game/assets/map/bus_only.svg diff --git a/game/assets/map/bus_only.svg b/game/assets/map/bus_only.svg new file mode 100644 index 0000000000..c2e8a27d8a --- /dev/null +++ b/game/assets/map/bus_only.svg @@ -0,0 +1,3 @@ + + + diff --git a/game/src/render/lane.rs b/game/src/render/lane.rs index 565aadce26..111aa2442a 100644 --- a/game/src/render/lane.rs +++ b/game/src/render/lane.rs @@ -82,6 +82,26 @@ impl DrawLane { cs.get("general road marking"), calculate_turn_markings(map, lane, timer), ); + + if lane.is_bus() { + let buffer = Distance::meters(2.0); + let btwn = Distance::meters(30.0); + let len = lane.lane_center_pts.length(); + + let mut dist = buffer; + while dist + buffer <= len { + let (pt, angle) = lane.lane_center_pts.dist_along(dist); + draw.add_svg( + "assets/map/bus_only.svg", + pt, + 0.06, + angle + .shortest_rotation_towards(Angle::new_degs(-90.0)) + .invert_y(), + ); + dist += btwn; + } + } } LaneType::Biking => { let buffer = Distance::meters(2.0);