From c927bab8875d2c02af18afb36ee71ea9f4d127b7 Mon Sep 17 00:00:00 2001 From: XsedoX Date: Tue, 5 Apr 2022 10:54:30 +0200 Subject: [PATCH] wejscie na pole --- logic/field.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/logic/field.py b/logic/field.py index b4f31b2..b3a7c78 100644 --- a/logic/field.py +++ b/logic/field.py @@ -16,3 +16,6 @@ class Field(pygame.sprite.Sprite): def busy_detection(self): if self.texture_path == 'water.png' or self.texture_path == 'grass_with_tree.jpg': self.busy = True + + def step_onto(self, obj):#ustawia objekt na srodku pola + obj.rect = obj.clamp(self.rect)