diff --git a/main.py b/main.py index e2920b6..52140eb 100644 --- a/main.py +++ b/main.py @@ -57,7 +57,7 @@ def play(screen, clock, running, background, isblack, WIDTH, HEIGHT): screen.blit(bg, (0, 0)) """ for thing in objects[0]: - if not thing.update(pygame.key.get_pressed()): + if not thing.update(pygame.key.get_pressed(), objects): menu(screen, clock, running, background, isblack, WIDTH, HEIGHT) thing.draw(screen) @@ -170,7 +170,7 @@ def main(): #objects.append(Button(WIDTH / 2 - 80, HEIGHT / 2 - 72, 160, 64, 'medieval', 48, "Play", play)) #objects.append(Button(WIDTH / 2 - 80, HEIGHT / 2, 160, 64, 'medieval', 48, "Options", uwu)) #objects.append(Button(WIDTH / 2 - 80, HEIGHT / 2 + 72, 160, 64, 'medieval', 48, "Exit game", quitGame)) - test(screen, clock, running, background, isblack, WIDTH, HEIGHT) + #test(screen, clock, running, background, isblack, WIDTH, HEIGHT) menu(screen, clock, running, background, isblack, WIDTH, HEIGHT) """while running: for event in pygame.event.get(): diff --git a/viecher.py b/viecher.py index 162fff4..c80ca16 100644 --- a/viecher.py +++ b/viecher.py @@ -108,7 +108,7 @@ class MainCharacter(Fighter): self.x += moveto[0] / fps self.y += moveto[1] / fps touches = pg.sprite.spritecollideany(self, objects[1] + objects[2]) - if touches is not None: + if touches is not None and not isinstance(touches, Weapons): self.x -= moveto[0] / fps #change later self.y -= moveto[1] / fps #change later