Update main.py

main
Artjoms Marians Ņečajevs 2024-02-26 08:52:01 +00:00
parent 8f3f54b0cf
commit 285cf1a71d
1 changed files with 2 additions and 3 deletions

View File

@ -75,14 +75,13 @@ class Bullet(pygame.sprite.Sprite):
def update(self):
self.rect.x += BULLET_SPEED * math.cos(math.radians(self.angle))
self.rect.y += BULLET_SPEED * math.sin(math.radians(self.angle))
# Проверка столкновения снаряда со стенами
if pygame.sprite.spritecollideany(self, walls):
self.kill() # Удаляем снаряд, если он столкнулся со стеной
# Определение класса стены
# Определение класса стены
class Wall(pygame.sprite.Sprite):
def __init__(self, x, y, image):
super().__init__()