From b3d38403adfe79c480543bed8eddc2ef5fc725fc Mon Sep 17 00:00:00 2001 From: Marcin Kostrzewski Date: Wed, 13 May 2020 19:50:53 +0200 Subject: [PATCH] Added documentation --- src/entities/Entity.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/entities/Entity.py b/src/entities/Entity.py index 0cf7471..fe88cbc 100644 --- a/src/entities/Entity.py +++ b/src/entities/Entity.py @@ -143,6 +143,11 @@ class Entity(pygame.sprite.Sprite): self.rotation = rotation def gotoToTarget(self, target, map): + """ + Attempt to find a path to a given target. If the path is found, move to the target. + :param target: Target object + :param map: Map object + """ if self.movementTarget is None: self.movementTarget = target from AI.AutomaticMovement import aStar @@ -151,6 +156,9 @@ class Entity(pygame.sprite.Sprite): self.movementTarget = None def updateEntityCoords(self): + """ + Called each frame. Will consume moves from the moveList, if there are any. + """ if self.movementTarget is not None and self.movesList: nextMove = self.movesList[0] if self.move(nextMove):