zombie-escape 1.3.1__tar.gz → 1.3.6__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.
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/PKG-INFO +11 -4
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/README.md +10 -3
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/__about__.py +1 -1
- zombie_escape-1.3.6/src/zombie_escape/colors.py +166 -0
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/config.py +0 -2
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/constants.py +54 -48
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/entities.py +98 -18
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/gameplay/logic.py +318 -64
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/level_blueprints.py +1 -1
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/locales/ui.en.json +30 -7
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/locales/ui.ja.json +30 -7
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/models.py +36 -5
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/render.py +295 -61
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/render_assets.py +1 -2
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/screens/__init__.py +6 -6
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/screens/game_over.py +47 -21
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/screens/gameplay.py +78 -35
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/screens/settings.py +40 -44
- zombie_escape-1.3.6/src/zombie_escape/screens/title.py +363 -0
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/zombie_escape.py +4 -3
- zombie_escape-1.3.1/src/zombie_escape/colors.py +0 -26
- zombie_escape-1.3.1/src/zombie_escape/screens/title.py +0 -185
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/.gitignore +0 -0
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/LICENSE.txt +0 -0
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/pyproject.toml +0 -0
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/__init__.py +0 -0
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/assets/fonts/Silkscreen-Regular.ttf +0 -0
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/assets/fonts/misaki_gothic.ttf +0 -0
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/font_utils.py +0 -0
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/gameplay/__init__.py +0 -0
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/localization.py +0 -0
- {zombie_escape-1.3.1 → zombie_escape-1.3.6}/src/zombie_escape/rng.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: zombie-escape
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.6
|
|
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>
|
|
@@ -48,6 +48,7 @@ This game is a simple 2D top-down action game where the player aims to escape by
|
|
|
48
48
|
- **Quit Game:** `ESC` key
|
|
49
49
|
- **Restart:** `R` key (on Game Over/Clear screen)
|
|
50
50
|
- **Window Scale (title/settings only):** `[` to shrink, `]` to enlarge
|
|
51
|
+
- **Time Acceleration:** Hold either `Shift` key to run the entire world 4x faster; release to return to normal speed.
|
|
51
52
|
|
|
52
53
|
## Settings (Title Screen)
|
|
53
54
|
|
|
@@ -56,7 +57,6 @@ Open **Settings** from the title to toggle gameplay assists:
|
|
|
56
57
|
- **Footprints:** Leave breadcrumb trails so you can backtrack in the dark.
|
|
57
58
|
- **Fast zombies:** Allow faster zombie variants; each zombie rolls a random speed between the normal and fast ranges.
|
|
58
59
|
- **Car hint:** After a delay, show a small triangle pointing toward the fuel (Stage 2 before pickup) or the car.
|
|
59
|
-
- **Flashlight pickups:** Enable flashlight spawns that expand your visible radius when collected.
|
|
60
60
|
- **Steel beams:** Adds tougher single-cell obstacles (5% density) that block movement; hidden when stacked with an inner wall until that wall is destroyed.
|
|
61
61
|
|
|
62
62
|
### Shared Seeds
|
|
@@ -73,6 +73,7 @@ At the title screen you can pick a stage:
|
|
|
73
73
|
- **Stage 2: Fuel Run** — you start with no fuel; find a fuel can first, pick it up, then find the car and escape.
|
|
74
74
|
- **Stage 3: Rescue Buddy** — same fuel hunt as Stage 2 (you begin empty) plus grab your buddy, pick them up with the car, then escape together.
|
|
75
75
|
- **Stage 4: Evacuate Survivors** — start fueled, find the car, gather nearby civilians, and escape before zombies reach them. Stage 4 sprinkles extra parked cars across the map; slamming into one while already driving fully repairs your current ride and adds five more safe seats.
|
|
76
|
+
- **Stage 5: Survive Until Dawn** — every car is bone-dry. Endure until the sun rises while the horde presses in from every direction. Once dawn hits, outdoor zombies carbonize and you must walk out through an existing exterior gap to win; cars remain unusable.
|
|
76
77
|
|
|
77
78
|
An objective reminder is shown at the top-left during play.
|
|
78
79
|
|
|
@@ -88,8 +89,8 @@ An objective reminder is shown at the top-left during play.
|
|
|
88
89
|
- After roughly 5 minutes of play, a small triangle near the player points toward the objective: fuel first (Stage 2 before pickup), car after fuel is collected (Stage 2/3), or car directly (Stage 1/4).
|
|
89
90
|
- **Walls:** Outer walls are gray; inner walls are beige.
|
|
90
91
|
- **Outer Walls:** Walls surrounding the stage that are nearly indestructible. Each side has at least three openings (exits).
|
|
91
|
-
- **Inner Walls:** Beige walls randomly placed inside the building. Inner wall segments each have durability. **The player can break these walls** by repeatedly colliding with a segment to reduce its durability; when it reaches 0, the segment is destroyed and disappears. The car cannot break walls.
|
|
92
|
-
- **Flashlight:**
|
|
92
|
+
- **Inner Walls:** Beige walls randomly placed inside the building. Inner wall segments each have durability. **The player can break these walls** by repeatedly colliding with a segment to reduce its durability; when it reaches 0, the segment is destroyed and disappears. Zombies can also wear down walls, but far more slowly. The car cannot break walls.
|
|
93
|
+
- **Flashlight:** Each pickup expands your visible radius by about 20% (grab two to reach the max boost).
|
|
93
94
|
- **Steel Beam (optional):** A square post with crossed diagonals; same collision as inner walls but with triple durability. Spawns independently of inner walls (may overlap them). If an inner wall covers a beam, the beam appears once the wall is destroyed.
|
|
94
95
|
- **Fuel Can (Stages 2 & 3):** A yellow jerrycan that only spawns on the fuel-run stages. Pick it up before driving the car; once collected the on-player indicator appears until you refuel the car.
|
|
95
96
|
- **Buddy (Stage 3):** A green circle survivor who spawns somewhere in the building and waits.
|
|
@@ -104,8 +105,10 @@ An objective reminder is shown at the top-left during play.
|
|
|
104
105
|
### Win/Lose Conditions
|
|
105
106
|
|
|
106
107
|
- **Win Condition:** Escape the stage (level) boundaries while inside the car.
|
|
108
|
+
- Stage 1 and Stage 4 follow the base rule: find the car (already fueled) and drive out.
|
|
107
109
|
- Stage 2 also requires that you have collected the fuel can before driving out.
|
|
108
110
|
- Stage 3 requires both fuel and having picked up your buddy with the car before driving out.
|
|
111
|
+
- Stage 5 has no working cars; survive until dawn, then walk out through an exterior opening on foot.
|
|
109
112
|
- **Lose Condition:**
|
|
110
113
|
- The player is touched by a zombie while *not* inside a car.
|
|
111
114
|
- In Stage 3, if your buddy is caught (when visible), it's game over.
|
|
@@ -133,6 +136,10 @@ Launch using the following command line:
|
|
|
133
136
|
zombie-escape
|
|
134
137
|
```
|
|
135
138
|
|
|
139
|
+
### Debug Mode
|
|
140
|
+
|
|
141
|
+
<!-- For Stage 5 balancing or capture needs, run `zombie-escape --debug`. This hides the pause overlay and starts survival stages with 3 minutes remaining so you can immediately test late-night behavior. -->
|
|
142
|
+
|
|
136
143
|
## License
|
|
137
144
|
|
|
138
145
|
This project is licensed under the MIT License - see the [LICENSE.txt](LICENSE.txt) file for details.
|
|
@@ -27,6 +27,7 @@ This game is a simple 2D top-down action game where the player aims to escape by
|
|
|
27
27
|
- **Quit Game:** `ESC` key
|
|
28
28
|
- **Restart:** `R` key (on Game Over/Clear screen)
|
|
29
29
|
- **Window Scale (title/settings only):** `[` to shrink, `]` to enlarge
|
|
30
|
+
- **Time Acceleration:** Hold either `Shift` key to run the entire world 4x faster; release to return to normal speed.
|
|
30
31
|
|
|
31
32
|
## Settings (Title Screen)
|
|
32
33
|
|
|
@@ -35,7 +36,6 @@ Open **Settings** from the title to toggle gameplay assists:
|
|
|
35
36
|
- **Footprints:** Leave breadcrumb trails so you can backtrack in the dark.
|
|
36
37
|
- **Fast zombies:** Allow faster zombie variants; each zombie rolls a random speed between the normal and fast ranges.
|
|
37
38
|
- **Car hint:** After a delay, show a small triangle pointing toward the fuel (Stage 2 before pickup) or the car.
|
|
38
|
-
- **Flashlight pickups:** Enable flashlight spawns that expand your visible radius when collected.
|
|
39
39
|
- **Steel beams:** Adds tougher single-cell obstacles (5% density) that block movement; hidden when stacked with an inner wall until that wall is destroyed.
|
|
40
40
|
|
|
41
41
|
### Shared Seeds
|
|
@@ -52,6 +52,7 @@ At the title screen you can pick a stage:
|
|
|
52
52
|
- **Stage 2: Fuel Run** — you start with no fuel; find a fuel can first, pick it up, then find the car and escape.
|
|
53
53
|
- **Stage 3: Rescue Buddy** — same fuel hunt as Stage 2 (you begin empty) plus grab your buddy, pick them up with the car, then escape together.
|
|
54
54
|
- **Stage 4: Evacuate Survivors** — start fueled, find the car, gather nearby civilians, and escape before zombies reach them. Stage 4 sprinkles extra parked cars across the map; slamming into one while already driving fully repairs your current ride and adds five more safe seats.
|
|
55
|
+
- **Stage 5: Survive Until Dawn** — every car is bone-dry. Endure until the sun rises while the horde presses in from every direction. Once dawn hits, outdoor zombies carbonize and you must walk out through an existing exterior gap to win; cars remain unusable.
|
|
55
56
|
|
|
56
57
|
An objective reminder is shown at the top-left during play.
|
|
57
58
|
|
|
@@ -67,8 +68,8 @@ An objective reminder is shown at the top-left during play.
|
|
|
67
68
|
- After roughly 5 minutes of play, a small triangle near the player points toward the objective: fuel first (Stage 2 before pickup), car after fuel is collected (Stage 2/3), or car directly (Stage 1/4).
|
|
68
69
|
- **Walls:** Outer walls are gray; inner walls are beige.
|
|
69
70
|
- **Outer Walls:** Walls surrounding the stage that are nearly indestructible. Each side has at least three openings (exits).
|
|
70
|
-
- **Inner Walls:** Beige walls randomly placed inside the building. Inner wall segments each have durability. **The player can break these walls** by repeatedly colliding with a segment to reduce its durability; when it reaches 0, the segment is destroyed and disappears. The car cannot break walls.
|
|
71
|
-
- **Flashlight:**
|
|
71
|
+
- **Inner Walls:** Beige walls randomly placed inside the building. Inner wall segments each have durability. **The player can break these walls** by repeatedly colliding with a segment to reduce its durability; when it reaches 0, the segment is destroyed and disappears. Zombies can also wear down walls, but far more slowly. The car cannot break walls.
|
|
72
|
+
- **Flashlight:** Each pickup expands your visible radius by about 20% (grab two to reach the max boost).
|
|
72
73
|
- **Steel Beam (optional):** A square post with crossed diagonals; same collision as inner walls but with triple durability. Spawns independently of inner walls (may overlap them). If an inner wall covers a beam, the beam appears once the wall is destroyed.
|
|
73
74
|
- **Fuel Can (Stages 2 & 3):** A yellow jerrycan that only spawns on the fuel-run stages. Pick it up before driving the car; once collected the on-player indicator appears until you refuel the car.
|
|
74
75
|
- **Buddy (Stage 3):** A green circle survivor who spawns somewhere in the building and waits.
|
|
@@ -83,8 +84,10 @@ An objective reminder is shown at the top-left during play.
|
|
|
83
84
|
### Win/Lose Conditions
|
|
84
85
|
|
|
85
86
|
- **Win Condition:** Escape the stage (level) boundaries while inside the car.
|
|
87
|
+
- Stage 1 and Stage 4 follow the base rule: find the car (already fueled) and drive out.
|
|
86
88
|
- Stage 2 also requires that you have collected the fuel can before driving out.
|
|
87
89
|
- Stage 3 requires both fuel and having picked up your buddy with the car before driving out.
|
|
90
|
+
- Stage 5 has no working cars; survive until dawn, then walk out through an exterior opening on foot.
|
|
88
91
|
- **Lose Condition:**
|
|
89
92
|
- The player is touched by a zombie while *not* inside a car.
|
|
90
93
|
- In Stage 3, if your buddy is caught (when visible), it's game over.
|
|
@@ -112,6 +115,10 @@ Launch using the following command line:
|
|
|
112
115
|
zombie-escape
|
|
113
116
|
```
|
|
114
117
|
|
|
118
|
+
### Debug Mode
|
|
119
|
+
|
|
120
|
+
<!-- For Stage 5 balancing or capture needs, run `zombie-escape --debug`. This hides the pause overlay and starts survival stages with 3 minutes remaining so you can immediately test late-night behavior. -->
|
|
121
|
+
|
|
115
122
|
## License
|
|
116
123
|
|
|
117
124
|
This project is licensed under the MIT License - see the [LICENSE.txt](LICENSE.txt) file for details.
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
|
|
5
|
+
# Basic palette
|
|
6
|
+
WHITE: tuple[int, int, int] = (255, 255, 255)
|
|
7
|
+
BLACK: tuple[int, int, int] = (0, 0, 0)
|
|
8
|
+
RED: tuple[int, int, int] = (255, 0, 0)
|
|
9
|
+
GREEN: tuple[int, int, int] = (0, 255, 0)
|
|
10
|
+
BLUE: tuple[int, int, int] = (0, 0, 255)
|
|
11
|
+
GRAY: tuple[int, int, int] = (100, 100, 100)
|
|
12
|
+
LIGHT_GRAY: tuple[int, int, int] = (200, 200, 200)
|
|
13
|
+
YELLOW: tuple[int, int, int] = (255, 255, 0)
|
|
14
|
+
ORANGE: tuple[int, int, int] = (255, 165, 0)
|
|
15
|
+
DARK_RED: tuple[int, int, int] = (139, 0, 0)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@dataclass(frozen=True)
|
|
19
|
+
class EnvironmentPalette:
|
|
20
|
+
"""Collection of colors that define the ambient environment."""
|
|
21
|
+
|
|
22
|
+
floor_primary: tuple[int, int, int]
|
|
23
|
+
floor_secondary: tuple[int, int, int]
|
|
24
|
+
outside: tuple[int, int, int]
|
|
25
|
+
inner_wall: tuple[int, int, int]
|
|
26
|
+
inner_wall_border: tuple[int, int, int]
|
|
27
|
+
outer_wall: tuple[int, int, int]
|
|
28
|
+
outer_wall_border: tuple[int, int, int]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _clamp(value: float) -> int:
|
|
32
|
+
return max(0, min(255, int(value)))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def _adjust_color(
|
|
36
|
+
color: tuple[int, int, int], *, brightness: float = 1.0, saturation: float = 1.0
|
|
37
|
+
) -> tuple[int, int, int]:
|
|
38
|
+
"""Return color tinted by brightness/saturation multipliers."""
|
|
39
|
+
|
|
40
|
+
r, g, b = color
|
|
41
|
+
gray = 0.2126 * r + 0.7152 * g + 0.0722 * b
|
|
42
|
+
def mix(component: int) -> int:
|
|
43
|
+
value = gray + (component - gray) * saturation
|
|
44
|
+
value *= brightness
|
|
45
|
+
return _clamp(value)
|
|
46
|
+
|
|
47
|
+
return mix(r), mix(g), mix(b)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
DEFAULT_AMBIENT_PALETTE_KEY = "default"
|
|
51
|
+
NO_FLASHLIGHT_PALETTE_KEY = "no_flashlight"
|
|
52
|
+
DAWN_AMBIENT_PALETTE_KEY = "dawn"
|
|
53
|
+
|
|
54
|
+
# Base palette used throughout gameplay (matches the previous constants).
|
|
55
|
+
_DEFAULT_ENVIRONMENT_PALETTE = EnvironmentPalette(
|
|
56
|
+
floor_primary=(43, 57, 70),
|
|
57
|
+
floor_secondary=(50, 64, 79),
|
|
58
|
+
outside=(32, 60, 40),
|
|
59
|
+
inner_wall=(125, 101, 78),
|
|
60
|
+
inner_wall_border=(136, 110, 85),
|
|
61
|
+
outer_wall=(136, 135, 128),
|
|
62
|
+
outer_wall_border=(147, 146, 138),
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
# Dark, desaturated palette that sells the "alone without a flashlight" vibe.
|
|
66
|
+
_GLOOM_ENVIRONMENT_PALETTE = EnvironmentPalette(
|
|
67
|
+
floor_primary=_adjust_color(
|
|
68
|
+
_DEFAULT_ENVIRONMENT_PALETTE.floor_primary, brightness=0.725, saturation=0.675
|
|
69
|
+
),
|
|
70
|
+
floor_secondary=_adjust_color(
|
|
71
|
+
_DEFAULT_ENVIRONMENT_PALETTE.floor_secondary, brightness=0.74, saturation=0.65
|
|
72
|
+
),
|
|
73
|
+
outside=_adjust_color(
|
|
74
|
+
_DEFAULT_ENVIRONMENT_PALETTE.outside, brightness=0.7, saturation=0.625
|
|
75
|
+
),
|
|
76
|
+
inner_wall=_adjust_color(
|
|
77
|
+
_DEFAULT_ENVIRONMENT_PALETTE.inner_wall, brightness=0.775, saturation=0.7
|
|
78
|
+
),
|
|
79
|
+
inner_wall_border=_adjust_color(
|
|
80
|
+
_DEFAULT_ENVIRONMENT_PALETTE.inner_wall_border, brightness=0.775, saturation=0.7
|
|
81
|
+
),
|
|
82
|
+
outer_wall=_adjust_color(
|
|
83
|
+
_DEFAULT_ENVIRONMENT_PALETTE.outer_wall, brightness=0.75, saturation=0.675
|
|
84
|
+
),
|
|
85
|
+
outer_wall_border=_adjust_color(
|
|
86
|
+
_DEFAULT_ENVIRONMENT_PALETTE.outer_wall_border, brightness=0.75, saturation=0.675
|
|
87
|
+
),
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
_DAWN_ENVIRONMENT_PALETTE = EnvironmentPalette(
|
|
91
|
+
floor_primary=(58, 70, 84),
|
|
92
|
+
floor_secondary=(66, 78, 92),
|
|
93
|
+
outside=(118, 140, 104),
|
|
94
|
+
inner_wall=(125, 101, 78),
|
|
95
|
+
inner_wall_border=(136, 110, 85),
|
|
96
|
+
outer_wall=(136, 135, 128),
|
|
97
|
+
outer_wall_border=(147, 146, 138),
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
ENVIRONMENT_PALETTES: dict[str, EnvironmentPalette] = {
|
|
101
|
+
DEFAULT_AMBIENT_PALETTE_KEY: _DEFAULT_ENVIRONMENT_PALETTE,
|
|
102
|
+
NO_FLASHLIGHT_PALETTE_KEY: _GLOOM_ENVIRONMENT_PALETTE,
|
|
103
|
+
DAWN_AMBIENT_PALETTE_KEY: _DAWN_ENVIRONMENT_PALETTE,
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def get_environment_palette(key: str | None) -> EnvironmentPalette:
|
|
108
|
+
"""Return the color palette for the provided key (falls back to default)."""
|
|
109
|
+
|
|
110
|
+
if not key:
|
|
111
|
+
return ENVIRONMENT_PALETTES[DEFAULT_AMBIENT_PALETTE_KEY]
|
|
112
|
+
return ENVIRONMENT_PALETTES.get(key, ENVIRONMENT_PALETTES[DEFAULT_AMBIENT_PALETTE_KEY])
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def ambient_palette_key_for_flashlights(count: int) -> str:
|
|
116
|
+
"""Return the palette key for the provided flashlight inventory count."""
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
DEFAULT_AMBIENT_PALETTE_KEY
|
|
120
|
+
if max(0, count) > 0
|
|
121
|
+
else NO_FLASHLIGHT_PALETTE_KEY
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
# World colors (default palette versions preserved for backwards compatibility).
|
|
126
|
+
INTERNAL_WALL_COLOR: tuple[int, int, int] = _DEFAULT_ENVIRONMENT_PALETTE.inner_wall
|
|
127
|
+
INTERNAL_WALL_BORDER_COLOR: tuple[int, int, int] = _DEFAULT_ENVIRONMENT_PALETTE.inner_wall_border
|
|
128
|
+
OUTER_WALL_COLOR: tuple[int, int, int] = _DEFAULT_ENVIRONMENT_PALETTE.outer_wall
|
|
129
|
+
OUTER_WALL_BORDER_COLOR: tuple[int, int, int] = _DEFAULT_ENVIRONMENT_PALETTE.outer_wall_border
|
|
130
|
+
FLOOR_COLOR_PRIMARY: tuple[int, int, int] = _DEFAULT_ENVIRONMENT_PALETTE.floor_primary
|
|
131
|
+
FLOOR_COLOR_SECONDARY: tuple[int, int, int] = _DEFAULT_ENVIRONMENT_PALETTE.floor_secondary
|
|
132
|
+
FLOOR_COLOR_OUTSIDE: tuple[int, int, int] = _DEFAULT_ENVIRONMENT_PALETTE.outside
|
|
133
|
+
FOOTPRINT_COLOR: tuple[int, int, int] = (110, 200, 255)
|
|
134
|
+
STEEL_BEAM_COLOR: tuple[int, int, int] = (110, 50, 50)
|
|
135
|
+
STEEL_BEAM_LINE_COLOR: tuple[int, int, int] = (180, 90, 90)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
__all__ = [
|
|
139
|
+
"WHITE",
|
|
140
|
+
"BLACK",
|
|
141
|
+
"RED",
|
|
142
|
+
"GREEN",
|
|
143
|
+
"BLUE",
|
|
144
|
+
"GRAY",
|
|
145
|
+
"LIGHT_GRAY",
|
|
146
|
+
"YELLOW",
|
|
147
|
+
"ORANGE",
|
|
148
|
+
"DARK_RED",
|
|
149
|
+
"DAWN_AMBIENT_PALETTE_KEY",
|
|
150
|
+
"INTERNAL_WALL_COLOR",
|
|
151
|
+
"INTERNAL_WALL_BORDER_COLOR",
|
|
152
|
+
"OUTER_WALL_COLOR",
|
|
153
|
+
"OUTER_WALL_BORDER_COLOR",
|
|
154
|
+
"FLOOR_COLOR_PRIMARY",
|
|
155
|
+
"FLOOR_COLOR_SECONDARY",
|
|
156
|
+
"FLOOR_COLOR_OUTSIDE",
|
|
157
|
+
"FOOTPRINT_COLOR",
|
|
158
|
+
"STEEL_BEAM_COLOR",
|
|
159
|
+
"STEEL_BEAM_LINE_COLOR",
|
|
160
|
+
"EnvironmentPalette",
|
|
161
|
+
"DEFAULT_AMBIENT_PALETTE_KEY",
|
|
162
|
+
"NO_FLASHLIGHT_PALETTE_KEY",
|
|
163
|
+
"ENVIRONMENT_PALETTES",
|
|
164
|
+
"get_environment_palette",
|
|
165
|
+
"ambient_palette_key_for_flashlights",
|
|
166
|
+
]
|
|
@@ -13,9 +13,7 @@ DEFAULT_CONFIG: dict[str, Any] = {
|
|
|
13
13
|
"footprints": {"enabled": True},
|
|
14
14
|
"fast_zombies": {"enabled": False, "ratio": 0.1},
|
|
15
15
|
"car_hint": {"enabled": True, "delay_ms": 180_000},
|
|
16
|
-
"flashlight": {"enabled": True, "bonus_scale": 1.35},
|
|
17
16
|
"steel_beams": {"enabled": False, "chance": 0.05},
|
|
18
|
-
"debug": {"hide_pause_overlay": False},
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
|
|
@@ -2,23 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from .config import DEFAULT_CONFIG
|
|
6
5
|
from .level_blueprints import GRID_COLS, GRID_ROWS, TILE_SIZE
|
|
7
6
|
from .render_assets import FogRing, RenderAssets
|
|
8
7
|
|
|
9
8
|
# --- Screen and window configuration ---
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
RENDER_SCREEN_WIDTH = 400
|
|
13
|
-
RENDER_SCREEN_HEIGHT = 300
|
|
9
|
+
SCREEN_WIDTH = 400 # Base logical render width
|
|
10
|
+
SCREEN_HEIGHT = 300 # Base logical render height
|
|
14
11
|
DEFAULT_WINDOW_SCALE = 2.0 # Keep ~800x600 OS window while rendering at 400x300
|
|
15
12
|
WINDOW_SCALE_MIN = 1.0
|
|
16
13
|
WINDOW_SCALE_MAX = DEFAULT_WINDOW_SCALE * 2 # Allow up to 1600x1200 windows
|
|
17
|
-
SCREEN_WIDTH = LOGICAL_SCREEN_WIDTH # Logical render width
|
|
18
|
-
SCREEN_HEIGHT = LOGICAL_SCREEN_HEIGHT # Logical render height
|
|
19
14
|
FPS = 60
|
|
20
15
|
STATUS_BAR_HEIGHT = 18
|
|
21
16
|
|
|
17
|
+
# --- Survival stage settings ---
|
|
18
|
+
SURVIVAL_TIME_ACCEL_SUBSTEPS = 4
|
|
19
|
+
SURVIVAL_TIME_ACCEL_MAX_SUBSTEP = 1.0 / 30.0
|
|
20
|
+
SURVIVAL_FAKE_CLOCK_RATIO = 12.0 # 20 min -> 4 hr clock
|
|
21
|
+
SURVIVAL_NEAR_SPAWN_MIN_DISTANCE = 140
|
|
22
|
+
SURVIVAL_NEAR_SPAWN_MAX_DISTANCE = 280
|
|
23
|
+
SURVIVAL_NEAR_SPAWN_CAMERA_MARGIN = 20
|
|
24
|
+
|
|
22
25
|
# --- Level dimensions derived from blueprint grid ---
|
|
23
26
|
LEVEL_GRID_COLS = GRID_COLS
|
|
24
27
|
LEVEL_GRID_ROWS = GRID_ROWS
|
|
@@ -27,18 +30,27 @@ LEVEL_WIDTH = LEVEL_GRID_COLS * CELL_SIZE
|
|
|
27
30
|
LEVEL_HEIGHT = LEVEL_GRID_ROWS * CELL_SIZE
|
|
28
31
|
|
|
29
32
|
# --- Player and companion settings ---
|
|
30
|
-
|
|
33
|
+
HUMANOID_RADIUS = 6
|
|
34
|
+
def interaction_radius(width: float, height: float) -> float:
|
|
35
|
+
"""Approximate interaction reach for a humanoid and an object."""
|
|
36
|
+
return HUMANOID_RADIUS + (width + height) / 4
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def car_body_radius(width: float, height: float) -> float:
|
|
40
|
+
"""Approximate car collision radius using only its own dimensions."""
|
|
41
|
+
return min(width, height) / 2
|
|
42
|
+
|
|
43
|
+
PLAYER_RADIUS = HUMANOID_RADIUS
|
|
31
44
|
PLAYER_SPEED = 1.4
|
|
32
|
-
FOV_RADIUS = 80
|
|
45
|
+
FOV_RADIUS = 124 # approximate legacy FOV (80) * 1.55 cap
|
|
33
46
|
FOG_RADIUS_SCALE = 1.2
|
|
34
|
-
FOG_MAX_RADIUS_FACTOR = 1.55
|
|
35
47
|
FOG_HATCH_PIXEL_SCALE = 2
|
|
36
|
-
COMPANION_RADIUS =
|
|
48
|
+
COMPANION_RADIUS = HUMANOID_RADIUS
|
|
37
49
|
COMPANION_FOLLOW_SPEED = PLAYER_SPEED * 0.7
|
|
38
50
|
COMPANION_COLOR = (0, 200, 70)
|
|
39
51
|
|
|
40
52
|
# --- Survivor settings (Stage 4) ---
|
|
41
|
-
SURVIVOR_RADIUS =
|
|
53
|
+
SURVIVOR_RADIUS = HUMANOID_RADIUS
|
|
42
54
|
SURVIVOR_COLOR = (220, 220, 255)
|
|
43
55
|
SURVIVOR_APPROACH_RADIUS = 48
|
|
44
56
|
SURVIVOR_APPROACH_SPEED = PLAYER_SPEED * 0.35
|
|
@@ -56,12 +68,9 @@ SURVIVOR_CONVERSION_LINE_KEYS = [
|
|
|
56
68
|
SURVIVOR_STAGE_WAITING_CAR_COUNT = 2
|
|
57
69
|
|
|
58
70
|
# --- Flashlight settings ---
|
|
59
|
-
|
|
60
|
-
DEFAULT_CONFIG.get("flashlight", {}).get("bonus_scale", 1.35)
|
|
61
|
-
)
|
|
71
|
+
FLASHLIGHT_FOG_SCALE_STEP = 0.3
|
|
62
72
|
FLASHLIGHT_WIDTH = 10
|
|
63
73
|
FLASHLIGHT_HEIGHT = 8
|
|
64
|
-
FLASHLIGHT_PICKUP_RADIUS = 13
|
|
65
74
|
DEFAULT_FLASHLIGHT_SPAWN_COUNT = 2
|
|
66
75
|
|
|
67
76
|
# --- Footprint settings ---
|
|
@@ -74,19 +83,21 @@ FOOTPRINT_MAX = 320
|
|
|
74
83
|
FOOTPRINT_MIN_FADE = 0.3
|
|
75
84
|
|
|
76
85
|
# --- Zombie settings ---
|
|
77
|
-
ZOMBIE_RADIUS =
|
|
86
|
+
ZOMBIE_RADIUS = HUMANOID_RADIUS
|
|
78
87
|
ZOMBIE_SPEED = 0.6
|
|
79
88
|
NORMAL_ZOMBIE_SPEED_JITTER = 0.15
|
|
80
|
-
ZOMBIE_SPAWN_DELAY_MS =
|
|
89
|
+
ZOMBIE_SPAWN_DELAY_MS = 4000
|
|
81
90
|
MAX_ZOMBIES = 400
|
|
82
91
|
INITIAL_ZOMBIES_INSIDE = 15
|
|
83
92
|
ZOMBIE_INTERIOR_SPAWN_RATE = 0.015
|
|
84
93
|
ZOMBIE_SPAWN_PLAYER_BUFFER = 140
|
|
85
94
|
ZOMBIE_MODE_CHANGE_INTERVAL_MS = 5000
|
|
86
|
-
ZOMBIE_SIGHT_RANGE = FOV_RADIUS * 2
|
|
95
|
+
ZOMBIE_SIGHT_RANGE = FOV_RADIUS * 1.2
|
|
87
96
|
FAST_ZOMBIE_BASE_SPEED = PLAYER_SPEED * 0.77
|
|
88
97
|
FAST_ZOMBIE_SPEED_JITTER = 0.075
|
|
89
98
|
ZOMBIE_SEPARATION_DISTANCE = ZOMBIE_RADIUS * 2.2
|
|
99
|
+
ZOMBIE_AGING_DURATION_FRAMES = FPS * 60 * 6 # ~6 minutes at target framerate
|
|
100
|
+
ZOMBIE_AGING_MIN_SPEED_RATIO = 0.3
|
|
90
101
|
|
|
91
102
|
# --- Car and fuel settings ---
|
|
92
103
|
CAR_WIDTH = 15
|
|
@@ -98,22 +109,23 @@ CAR_ZOMBIE_DAMAGE = 1
|
|
|
98
109
|
CAR_HINT_DELAY_MS_DEFAULT = 300000
|
|
99
110
|
FUEL_CAN_WIDTH = 11
|
|
100
111
|
FUEL_CAN_HEIGHT = 15
|
|
101
|
-
FUEL_PICKUP_RADIUS = 12
|
|
102
112
|
FUEL_HINT_DURATION_MS = 1600
|
|
103
113
|
|
|
104
114
|
# --- Wall and beam settings ---
|
|
105
115
|
INTERNAL_WALL_GRID_SNAP = CELL_SIZE
|
|
106
|
-
INTERNAL_WALL_HEALTH = 40
|
|
107
|
-
OUTER_WALL_HEALTH =
|
|
108
|
-
STEEL_BEAM_HEALTH = INTERNAL_WALL_HEALTH *
|
|
116
|
+
INTERNAL_WALL_HEALTH = 40 * 100
|
|
117
|
+
OUTER_WALL_HEALTH = 999999
|
|
118
|
+
STEEL_BEAM_HEALTH = int(INTERNAL_WALL_HEALTH * 1.5)
|
|
119
|
+
PLAYER_WALL_DAMAGE = 100
|
|
120
|
+
ZOMBIE_WALL_DAMAGE = 1
|
|
109
121
|
|
|
110
122
|
# --- Rendering assets shared with draw routines ---
|
|
111
123
|
FOG_RINGS = [
|
|
112
|
-
FogRing(radius_factor=0.
|
|
113
|
-
FogRing(radius_factor=0.
|
|
114
|
-
FogRing(radius_factor=
|
|
115
|
-
FogRing(radius_factor=
|
|
116
|
-
FogRing(radius_factor=
|
|
124
|
+
FogRing(radius_factor=0.529, thickness=2),
|
|
125
|
+
FogRing(radius_factor=0.639, thickness=4),
|
|
126
|
+
FogRing(radius_factor=0.748, thickness=6),
|
|
127
|
+
FogRing(radius_factor=0.858, thickness=8),
|
|
128
|
+
FogRing(radius_factor=0.968, thickness=12),
|
|
117
129
|
]
|
|
118
130
|
|
|
119
131
|
RENDER_ASSETS = RenderAssets(
|
|
@@ -123,7 +135,6 @@ RENDER_ASSETS = RenderAssets(
|
|
|
123
135
|
player_radius=PLAYER_RADIUS,
|
|
124
136
|
fov_radius=FOV_RADIUS,
|
|
125
137
|
fog_radius_scale=FOG_RADIUS_SCALE,
|
|
126
|
-
fog_max_radius_factor=FOG_MAX_RADIUS_FACTOR,
|
|
127
138
|
fog_hatch_pixel_scale=FOG_HATCH_PIXEL_SCALE,
|
|
128
139
|
fog_rings=FOG_RINGS,
|
|
129
140
|
footprint_radius=FOOTPRINT_RADIUS,
|
|
@@ -131,32 +142,25 @@ RENDER_ASSETS = RenderAssets(
|
|
|
131
142
|
footprint_lifetime_ms=FOOTPRINT_LIFETIME_MS,
|
|
132
143
|
footprint_min_fade=FOOTPRINT_MIN_FADE,
|
|
133
144
|
internal_wall_grid_snap=INTERNAL_WALL_GRID_SNAP,
|
|
134
|
-
|
|
145
|
+
flashlight_bonus_step=FLASHLIGHT_FOG_SCALE_STEP,
|
|
135
146
|
)
|
|
136
147
|
|
|
137
148
|
__all__ = [
|
|
138
|
-
"LOGICAL_SCREEN_WIDTH",
|
|
139
|
-
"LOGICAL_SCREEN_HEIGHT",
|
|
140
|
-
"RENDER_SCREEN_WIDTH",
|
|
141
|
-
"RENDER_SCREEN_HEIGHT",
|
|
142
149
|
"DEFAULT_WINDOW_SCALE",
|
|
143
150
|
"WINDOW_SCALE_MIN",
|
|
144
151
|
"WINDOW_SCALE_MAX",
|
|
145
152
|
"SCREEN_WIDTH",
|
|
146
153
|
"SCREEN_HEIGHT",
|
|
147
154
|
"FPS",
|
|
148
|
-
"STATUS_BAR_HEIGHT",
|
|
149
155
|
"LEVEL_GRID_COLS",
|
|
150
156
|
"LEVEL_GRID_ROWS",
|
|
151
157
|
"CELL_SIZE",
|
|
152
158
|
"LEVEL_WIDTH",
|
|
153
159
|
"LEVEL_HEIGHT",
|
|
160
|
+
"HUMANOID_RADIUS",
|
|
161
|
+
"interaction_radius",
|
|
154
162
|
"PLAYER_RADIUS",
|
|
155
163
|
"PLAYER_SPEED",
|
|
156
|
-
"FOV_RADIUS",
|
|
157
|
-
"FOG_RADIUS_SCALE",
|
|
158
|
-
"FOG_MAX_RADIUS_FACTOR",
|
|
159
|
-
"FOG_HATCH_PIXEL_SCALE",
|
|
160
164
|
"COMPANION_RADIUS",
|
|
161
165
|
"COMPANION_FOLLOW_SPEED",
|
|
162
166
|
"COMPANION_COLOR",
|
|
@@ -172,18 +176,18 @@ __all__ = [
|
|
|
172
176
|
"SURVIVOR_MESSAGE_DURATION_MS",
|
|
173
177
|
"SURVIVOR_CONVERSION_LINE_KEYS",
|
|
174
178
|
"SURVIVOR_STAGE_WAITING_CAR_COUNT",
|
|
175
|
-
"
|
|
179
|
+
"SURVIVAL_TIME_ACCEL_SUBSTEPS",
|
|
180
|
+
"SURVIVAL_TIME_ACCEL_MAX_SUBSTEP",
|
|
181
|
+
"SURVIVAL_FAKE_CLOCK_RATIO",
|
|
182
|
+
"SURVIVAL_NEAR_SPAWN_MIN_DISTANCE",
|
|
183
|
+
"SURVIVAL_NEAR_SPAWN_MAX_DISTANCE",
|
|
184
|
+
"SURVIVAL_NEAR_SPAWN_CAMERA_MARGIN",
|
|
176
185
|
"FLASHLIGHT_WIDTH",
|
|
177
186
|
"FLASHLIGHT_HEIGHT",
|
|
178
|
-
"FLASHLIGHT_PICKUP_RADIUS",
|
|
179
187
|
"DEFAULT_FLASHLIGHT_SPAWN_COUNT",
|
|
180
|
-
"FOOTPRINT_RADIUS",
|
|
181
|
-
"FOOTPRINT_OVERVIEW_RADIUS",
|
|
182
188
|
"FOOTPRINT_COLOR",
|
|
183
189
|
"FOOTPRINT_STEP_DISTANCE",
|
|
184
|
-
"FOOTPRINT_LIFETIME_MS",
|
|
185
190
|
"FOOTPRINT_MAX",
|
|
186
|
-
"FOOTPRINT_MIN_FADE",
|
|
187
191
|
"ZOMBIE_RADIUS",
|
|
188
192
|
"ZOMBIE_SPEED",
|
|
189
193
|
"NORMAL_ZOMBIE_SPEED_JITTER",
|
|
@@ -197,6 +201,9 @@ __all__ = [
|
|
|
197
201
|
"FAST_ZOMBIE_BASE_SPEED",
|
|
198
202
|
"FAST_ZOMBIE_SPEED_JITTER",
|
|
199
203
|
"ZOMBIE_SEPARATION_DISTANCE",
|
|
204
|
+
"ZOMBIE_AGING_DURATION_FRAMES",
|
|
205
|
+
"ZOMBIE_AGING_MIN_SPEED_RATIO",
|
|
206
|
+
"car_body_radius",
|
|
200
207
|
"CAR_WIDTH",
|
|
201
208
|
"CAR_HEIGHT",
|
|
202
209
|
"CAR_SPEED",
|
|
@@ -206,12 +213,11 @@ __all__ = [
|
|
|
206
213
|
"CAR_HINT_DELAY_MS_DEFAULT",
|
|
207
214
|
"FUEL_CAN_WIDTH",
|
|
208
215
|
"FUEL_CAN_HEIGHT",
|
|
209
|
-
"FUEL_PICKUP_RADIUS",
|
|
210
216
|
"FUEL_HINT_DURATION_MS",
|
|
211
|
-
"INTERNAL_WALL_GRID_SNAP",
|
|
212
217
|
"INTERNAL_WALL_HEALTH",
|
|
213
218
|
"OUTER_WALL_HEALTH",
|
|
214
219
|
"STEEL_BEAM_HEALTH",
|
|
215
|
-
"
|
|
220
|
+
"PLAYER_WALL_DAMAGE",
|
|
221
|
+
"ZOMBIE_WALL_DAMAGE",
|
|
216
222
|
"RENDER_ASSETS",
|
|
217
223
|
]
|