From 81404a51da0c9b4547faed5b807e1f30d2686bd3 Mon Sep 17 00:00:00 2001 From: Doom-JSlayer Date: Tue, 6 May 2025 17:13:14 +0300 Subject: [PATCH] update: movement --- __pycache__/fill_level.cpython-313.pyc | Bin 2934 -> 2962 bytes main.py | 32 +++++++++++++++++++------ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/__pycache__/fill_level.cpython-313.pyc b/__pycache__/fill_level.cpython-313.pyc index 44a1f1b44772ad082869a9c6f413a7ba8a0cbaf4..60ba9c77b4b531d4305a1c5057d5a6f4babc7424 100644 GIT binary patch delta 64 zcmew+Hc6cOGcPX}0}yyHNNwcKU{rHVwu%WYPAw`1lQAy&$)&lec_qa$E~R 0: - if self.body[i].type == "body" or self.body[i].type == "tail": - self.body[i].x = self.body[i-1].x - self.body[i].y = self.body[i-1].y - self.body[i].rotate = self.body[i-1].rotate - i = i - 1 + self.body[i].x = self.body[i-1].x + self.body[i].y = self.body[i-1].y - self.body[0].x = int(-math.sin(-self.body[0].rotate * math.pi / 180)) + self.body[0].x - self.body[0].y = int(math.cos(-self.body[0].rotate * math.pi / 180)) + self.body[0].y + + if abs(math.cos(self.body[i+1].rotate)) == abs(math.cos(self.body[i-1].rotate)) or abs(math.sin(self.body[i+1].rotate)) == abs(math.sin(self.body[i-1].rotate)): + self.body[i].type = "body" + self.body[i].rotate = self.body[i-1].rotate + else: + self.body[i].type = "body-rotate" + self.body[i].rotate = (self.body[i+1].rotate - 90) % 360 + + + + i = i - 1 + self.body[0].x = int(-math.sin(-(vector * 90) * math.pi / 180)) + self.body[0].x + self.body[0].y = int(math.cos(-(vector * 90) * math.pi / 180)) + self.body[0].y # print(f"Move {vector}")