Revert #f09eb86, was actually a intended feature

This commit is contained in:
Lncvrt committed 2024-12-13 23:17:12 -07:00
1 parent 975c16c551
commit 365ad6af60
1 file changed
+5 -4
+5 -4
View File
@@ -61,7 +61,7 @@ eat_sound = pygame.mixer.Sound(eat_path)
player_x, player_y = (WIDTH - player_width) // 2, HEIGHT - player_height player_x, player_y = (WIDTH - player_width) // 2, HEIGHT - player_height
food_x, food_y = random.randint(0, WIDTH - food_width), 0 food_x, food_y = random.randint(0, WIDTH - food_width), 0
score, draw_hitboxes, auto_mode = 1, False, False score, draw_hitboxes, auto_mode, auto_key = 1, False, False, 0
auto_color_change_interval, auto_color_change_timer = 100, pygame.time.get_ticks() auto_color_change_interval, auto_color_change_timer = 100, pygame.time.get_ticks()
font = pygame.font.Font(font_path, 36) font = pygame.font.Font(font_path, 36)
@@ -118,7 +118,7 @@ def check_collision():
return pygame.Rect(player_x, player_y, player_hitbox_width, player_hitbox_height).colliderect(pygame.Rect(food_x, food_y, food_hitbox_width, food_hitbox_height)) return pygame.Rect(player_x, player_y, player_hitbox_width, player_hitbox_height).colliderect(pygame.Rect(food_x, food_y, food_hitbox_width, food_hitbox_height))
def game_loop(): def game_loop():
global score, player_x, food_x, food_y, draw_hitboxes, auto_mode, player_image, flipped global score, player_x, food_x, food_y, draw_hitboxes, auto_mode, auto_key, player_image, flipped
dt = clock.tick(60) / 1000.0 dt = clock.tick(60) / 1000.0
@@ -135,9 +135,10 @@ def game_loop():
if event.key == pygame.K_h: if event.key == pygame.K_h:
draw_hitboxes = not draw_hitboxes draw_hitboxes = not draw_hitboxes
elif event.key == pygame.K_j: elif event.key == pygame.K_j:
if not auto_mode: auto_key += 1
if auto_key == 3:
reset_game_state("Auto") reset_game_state("Auto")
else: elif auto_key == 4:
reset_game_state() reset_game_state()
if not auto_mode: if not auto_mode: