Skip to content

Commit b0fa2a1

Browse files
Optimized player trail in the editor
are you proud of me
1 parent 94bbd5a commit b0fa2a1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1559,7 +1559,10 @@ async fn main() {
15591559
}
15601560

15611561
for point in &player_trail {
1562-
draw_circle(point.x - cam_pos_x * 5.0, point.y + cam_pos_y * 5.0, 5.0, LIME);
1562+
if point.x - cam_pos_x * 5.0 > -10.0
1563+
&& point.x - cam_pos_x * 5.0 < screen_width() + 10.0 {
1564+
draw_circle(point.x - cam_pos_x * 5.0, point.y + cam_pos_y * 5.0, 5.0, LIME);
1565+
}
15631566
}
15641567

15651568
draw_rectangle(

0 commit comments

Comments
 (0)