zombie-escape 1.2.0__tar.gz → 1.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/PKG-INFO +1 -1
  2. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/__about__.py +1 -1
  3. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/constants.py +3 -1
  4. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/gameplay/logic.py +19 -5
  5. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/models.py +1 -0
  6. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/screens/gameplay.py +7 -2
  7. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/.gitignore +0 -0
  8. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/LICENSE.txt +0 -0
  9. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/README.md +0 -0
  10. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/pyproject.toml +0 -0
  11. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/__init__.py +0 -0
  12. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/assets/fonts/Silkscreen-Regular.ttf +0 -0
  13. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/assets/fonts/misaki_gothic.ttf +0 -0
  14. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/colors.py +0 -0
  15. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/config.py +0 -0
  16. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/entities.py +0 -0
  17. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/font_utils.py +0 -0
  18. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/gameplay/__init__.py +0 -0
  19. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/level_blueprints.py +0 -0
  20. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/locales/ui.en.json +0 -0
  21. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/locales/ui.ja.json +0 -0
  22. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/localization.py +0 -0
  23. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/render.py +0 -0
  24. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/render_assets.py +0 -0
  25. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/screens/__init__.py +0 -0
  26. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/screens/game_over.py +0 -0
  27. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/screens/settings.py +0 -0
  28. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/screens/title.py +0 -0
  29. {zombie_escape-1.2.0 → zombie_escape-1.2.1}/src/zombie_escape/zombie_escape.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zombie-escape
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: Top-down zombie survival game built with pygame.
5
5
  Project-URL: Homepage, https://github.com/tos-kamiya/zombie-escape
6
6
  Author-email: Toshihiro Kamiya <kamiya@mbj.nifty.com>
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2025-present Toshihiro Kamiya <kamiya@mbj.nifty.com>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "1.2.0"
4
+ __version__ = "1.2.1"
@@ -53,6 +53,7 @@ SURVIVOR_CONVERSION_LINE_KEYS = [
53
53
  "stages.stage4.conversion_lines.line2",
54
54
  "stages.stage4.conversion_lines.line3",
55
55
  ]
56
+ SURVIVOR_STAGE_WAITING_CAR_COUNT = 2
56
57
 
57
58
  # --- Flashlight settings ---
58
59
  DEFAULT_FLASHLIGHT_BONUS_SCALE = float(
@@ -83,7 +84,7 @@ ZOMBIE_INTERIOR_SPAWN_RATE = 0.015
83
84
  ZOMBIE_SPAWN_PLAYER_BUFFER = 140
84
85
  ZOMBIE_MODE_CHANGE_INTERVAL_MS = 5000
85
86
  ZOMBIE_SIGHT_RANGE = FOV_RADIUS * 2.0
86
- FAST_ZOMBIE_BASE_SPEED = PLAYER_SPEED * 0.81
87
+ FAST_ZOMBIE_BASE_SPEED = PLAYER_SPEED * 0.77
87
88
  FAST_ZOMBIE_SPEED_JITTER = 0.075
88
89
  ZOMBIE_SEPARATION_DISTANCE = ZOMBIE_RADIUS * 2.2
89
90
 
@@ -170,6 +171,7 @@ __all__ = [
170
171
  "SURVIVOR_OVERLOAD_DAMAGE_RATIO",
171
172
  "SURVIVOR_MESSAGE_DURATION_MS",
172
173
  "SURVIVOR_CONVERSION_LINE_KEYS",
174
+ "SURVIVOR_STAGE_WAITING_CAR_COUNT",
173
175
  "DEFAULT_FLASHLIGHT_BONUS_SCALE",
174
176
  "FLASHLIGHT_WIDTH",
175
177
  "FLASHLIGHT_HEIGHT",
@@ -45,6 +45,7 @@ from ..constants import (
45
45
  SURVIVOR_RADIUS,
46
46
  SURVIVOR_SPAWN_RATE,
47
47
  SURVIVOR_SPEED_PENALTY_PER_PASSENGER,
48
+ SURVIVOR_STAGE_WAITING_CAR_COUNT,
48
49
  ZOMBIE_INTERIOR_SPAWN_RATE,
49
50
  ZOMBIE_RADIUS,
50
51
  ZOMBIE_SEPARATION_DISTANCE,
@@ -83,6 +84,7 @@ __all__ = [
83
84
  "spawn_survivors",
84
85
  "update_survivors",
85
86
  "alive_waiting_cars",
87
+ "log_waiting_car_count",
86
88
  "nearest_waiting_car",
87
89
  "calculate_car_speed_for_passengers",
88
90
  "apply_passenger_speed_penalty",
@@ -571,7 +573,7 @@ def rect_visible_on_screen(camera: Camera | None, rect: pygame.Rect) -> bool:
571
573
 
572
574
 
573
575
  def waiting_car_target_count(stage: Stage) -> int:
574
- return 3 if stage.survivor_stage else 1
576
+ return SURVIVOR_STAGE_WAITING_CAR_COUNT if stage.survivor_stage else 1
575
577
 
576
578
 
577
579
  def spawn_waiting_car(game_data: GameData) -> Car | None:
@@ -609,11 +611,13 @@ def spawn_waiting_car(game_data: GameData) -> Car | None:
609
611
  return None
610
612
 
611
613
 
612
- def maintain_waiting_car_supply(game_data: GameData) -> None:
613
- """Ensure at least one parked car remains on the field."""
614
- minimum = 1
614
+ def maintain_waiting_car_supply(
615
+ game_data: GameData, *, minimum: int | None = None
616
+ ) -> None:
617
+ """Ensure a baseline count of parked cars exists."""
618
+ target = 1 if minimum is None else max(0, minimum)
615
619
  current = len(alive_waiting_cars(game_data))
616
- while current < minimum:
620
+ while current < target:
617
621
  new_car = spawn_waiting_car(game_data)
618
622
  if not new_car:
619
623
  break
@@ -624,9 +628,19 @@ def alive_waiting_cars(game_data: GameData) -> list[Car]:
624
628
  """Return the list of parked cars that still exist, pruning any destroyed sprites."""
625
629
  cars = [car for car in game_data.waiting_cars if car.alive()]
626
630
  game_data.waiting_cars = cars
631
+ log_waiting_car_count(game_data)
627
632
  return cars
628
633
 
629
634
 
635
+ def log_waiting_car_count(game_data: GameData, *, force: bool = False) -> None:
636
+ """Print the number of waiting cars when it changes."""
637
+ current = len(game_data.waiting_cars)
638
+ if not force and current == game_data.last_logged_waiting_cars:
639
+ return
640
+ stage_id = getattr(game_data.stage, "id", "unknown")
641
+ game_data.last_logged_waiting_cars = current
642
+
643
+
630
644
  def nearest_waiting_car(
631
645
  game_data: GameData, origin: tuple[float, float]
632
646
  ) -> Car | None:
@@ -77,6 +77,7 @@ class GameData:
77
77
  car: Car | None = None
78
78
  waiting_cars: list[Car] = field(default_factory=list)
79
79
  companion: Companion | None = None
80
+ last_logged_waiting_cars: int | None = None
80
81
 
81
82
 
82
83
  @dataclass(frozen=True)
@@ -9,6 +9,7 @@ from ..colors import LIGHT_GRAY, RED, WHITE, YELLOW
9
9
  from ..constants import (
10
10
  CAR_HINT_DELAY_MS_DEFAULT,
11
11
  DEFAULT_FLASHLIGHT_SPAWN_COUNT,
12
+ SURVIVOR_STAGE_WAITING_CAR_COUNT,
12
13
  )
13
14
  from ..gameplay import logic
14
15
  from ..localization import translate as _
@@ -41,7 +42,9 @@ def gameplay_screen(
41
42
  last_fov_target = None
42
43
 
43
44
  layout_data = logic.generate_level_from_blueprint(game_data, config)
44
- initial_waiting = 3 if stage.survivor_stage else 1
45
+ initial_waiting = (
46
+ SURVIVOR_STAGE_WAITING_CAR_COUNT if stage.survivor_stage else 1
47
+ )
45
48
  player, waiting_cars = logic.setup_player_and_cars(
46
49
  game_data, layout_data, car_count=initial_waiting
47
50
  )
@@ -49,7 +52,9 @@ def gameplay_screen(
49
52
  game_data.waiting_cars = waiting_cars
50
53
  game_data.car = None
51
54
  # Only top up if initial placement spawned fewer than the intended baseline (shouldn't happen)
52
- logic.maintain_waiting_car_supply(game_data)
55
+ logic.maintain_waiting_car_supply(
56
+ game_data, minimum=logic.waiting_car_target_count(stage)
57
+ )
53
58
  logic.apply_passenger_speed_penalty(game_data)
54
59
 
55
60
  if stage.survivor_stage:
File without changes
File without changes
File without changes