Skip to content

Commit

Permalink
rename tentity->target_entity in entity_distance in attack.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lunathanael committed Mar 11, 2024
1 parent 36f254a commit 8b86e1c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions clash_royale/envs/game_engine/logic/attack.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ def __init__(self) -> None:

self.last_attack: int = 0 # Frame of last attack

def entity_distance(self, tentity: Entity) -> float:
def entity_distance(self, target_entity: Entity) -> float:
"""
Determines the distance between an entity and ourselves.
:param tentity: Entity to determine distance
:type tentity: Entity
:param target_entity: Entity to determine distance
:type target_entity: Entity
:return: Distance between entities
:rtype: float
"""

return distance(self.entity.x, self.entity.y, tentity.x, tentity.y)
return distance(self.entity.x, self.entity.y, target_entity.x, target_entity.y)

def can_attack(self) -> bool:
"""
Expand Down

0 comments on commit 8b86e1c

Please sign in to comment.