Skip to content

Commit

Permalink
refactor: refactor some code
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasfremming committed Nov 5, 2024
1 parent ce6bb12 commit 7ab2232
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,15 @@ def update(
x2 = x1 + self.sight_width
try:
y1=ground.get_y(x1+scroll_offset)
self.near_periphery = Point(x1, y1)
except:
pass
try:
y2=ground.get_y(x2+scroll_offset)
self.far_periphery = Point(x2, y2)
except:
pass
if not y1 is None:
self.near_periphery = Point(x1, y1)
if not y2 is None:
self.far_periphery = Point(x2, y2)

self.render_vision(screen)

def render_vision(self, screen):
Expand Down

0 comments on commit 7ab2232

Please sign in to comment.