Skip to content

Commit

Permalink
Explictly test for playe in lane
Browse files Browse the repository at this point in the history
Signed-off-by: yzamir <[email protected]>
  • Loading branch information
yaacov committed Aug 21, 2023
1 parent 4589e77 commit 806e65b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rose/server/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ def reset(self):
self.score = 0

def in_lane(self):
min_x = self.lane * config.cells_per_player
next_x = min_x + config.cells_per_player
return min_x <= self.x < next_x
current_lane = self.x // config.cells_per_player
return current_lane == self.lane

def __cmp__(self, other):
x = self.score
Expand Down

0 comments on commit 806e65b

Please sign in to comment.