From 5f7ebdbc0532fc9c5d4f8939c7b0f9fa533bceac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Artjoms=20Marians=20=C5=85e=C4=8Dajevs?=
 <anecajevs.e@rkg.lv>
Date: Mon, 26 Feb 2024 08:19:29 +0000
Subject: [PATCH] Update main.py

---
 main.py | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/main.py b/main.py
index faabd90..2fc60fa 100644
--- a/main.py
+++ b/main.py
@@ -6,11 +6,11 @@ import math
 SCREEN_WIDTH = 1920
 SCREEN_HEIGHT = 1080
 PLAYER_SIZE = 150
-BULLET_SIZE = 30
+BULLET_SIZE = 20
 FPS = 60
 BULLET_SPEED = 6
-TANK_SPEED = 2
-FIRE_DELAY = 500  
+DEFAULT_TANK_SPEED = 2
+FIRE_DELAY = 500  # Задержка между выстрелами в миллисекундах
 WHITE = (255, 255, 255)
 BLACK = (0, 0, 0)
 
@@ -38,6 +38,7 @@ class Tank(pygame.sprite.Sprite):
         self.rect = self.image.get_rect(center=(x, y))
         self.angle = -90  # Поворот на 90 градусов против часовой стрелки
         self.last_fire_time = pygame.time.get_ticks()  # Время последнего выстрела
+        self.speed = DEFAULT_TANK_SPEED
 
     def update(self):
         keys = pygame.key.get_pressed()
@@ -50,8 +51,8 @@ class Tank(pygame.sprite.Sprite):
 
     def move_forward(self):
         angle_rad = math.radians(self.angle + 270)
-        self.rect.x += TANK_SPEED * math.cos(angle_rad)
-        self.rect.y += TANK_SPEED * math.sin(angle_rad)
+        self.rect.x += self.speed * math.cos(angle_rad)
+        self.rect.y += self.speed * math.sin(angle_rad)
 
     def shoot(self):
         current_time = pygame.time.get_ticks()
@@ -98,6 +99,9 @@ while running:
             running = False
         elif event.type == pygame.MOUSEBUTTONDOWN and event.button == 1:  # Обработка левой кнопки мыши
             player.shoot()
+        elif event.type == pygame.KEYDOWN:  # Обработка нажатия клавиш
+            if event.key == pygame.K_F10:  # Если нажата клавиша пробела
+                player.speed += 5  # Увеличиваем скорость танка
 
     # Обновление всех спрайтов
     all_sprites.update()
@@ -186,8 +190,10 @@ while running:
     screen.blit(stenki, (1600, 1030))
     screen.blit(stenki, (1800, 1030))
 
+    # Остальной код отрисовки стен и спрайтов остается без изменений
+
     pygame.display.flip()
     clock.tick(FPS)
 
 # Завершение работы Pygame
-pygame.quit()
+pygame.quit()
\ No newline at end of file