birds-vs-bats 1.0.0__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 (46) hide show
  1. birds_vs_bats-1.0.0/MANIFEST.in +12 -0
  2. birds_vs_bats-1.0.0/PKG-INFO +336 -0
  3. birds_vs_bats-1.0.0/README.md +314 -0
  4. birds_vs_bats-1.0.0/birds_vs_bats.egg-info/PKG-INFO +336 -0
  5. birds_vs_bats-1.0.0/birds_vs_bats.egg-info/SOURCES.txt +44 -0
  6. birds_vs_bats-1.0.0/birds_vs_bats.egg-info/dependency_links.txt +1 -0
  7. birds_vs_bats-1.0.0/birds_vs_bats.egg-info/entry_points.txt +3 -0
  8. birds_vs_bats-1.0.0/birds_vs_bats.egg-info/requires.txt +9 -0
  9. birds_vs_bats-1.0.0/birds_vs_bats.egg-info/top_level.txt +3 -0
  10. birds_vs_bats-1.0.0/bvb/__init__.py +2 -0
  11. birds_vs_bats-1.0.0/bvb/__main__.py +31 -0
  12. birds_vs_bats-1.0.0/config.sample.yml +310 -0
  13. birds_vs_bats-1.0.0/config.schema.json +432 -0
  14. birds_vs_bats-1.0.0/config.yml +895 -0
  15. birds_vs_bats-1.0.0/config_easy.yml +87 -0
  16. birds_vs_bats-1.0.0/config_hard.yml +12 -0
  17. birds_vs_bats-1.0.0/config_hell.yml +102 -0
  18. birds_vs_bats-1.0.0/game.py +510 -0
  19. birds_vs_bats-1.0.0/pyproject.toml +48 -0
  20. birds_vs_bats-1.0.0/requirements.txt +3 -0
  21. birds_vs_bats-1.0.0/setup.cfg +4 -0
  22. birds_vs_bats-1.0.0/src/__init__.py +1 -0
  23. birds_vs_bats-1.0.0/src/core/__init__.py +3 -0
  24. birds_vs_bats-1.0.0/src/core/constants.py +204 -0
  25. birds_vs_bats-1.0.0/src/core/init.py +159 -0
  26. birds_vs_bats-1.0.0/src/core/state.py +492 -0
  27. birds_vs_bats-1.0.0/src/engine/__init__.py +1 -0
  28. birds_vs_bats-1.0.0/src/engine/game_logic.py +5223 -0
  29. birds_vs_bats-1.0.0/src/engine/input_handler.py +1439 -0
  30. birds_vs_bats-1.0.0/src/engine/physics.py +814 -0
  31. birds_vs_bats-1.0.0/src/entities/__init__.py +3 -0
  32. birds_vs_bats-1.0.0/src/entities/bird_types.py +393 -0
  33. birds_vs_bats-1.0.0/src/entities/sprites.py +1414 -0
  34. birds_vs_bats-1.0.0/src/functions.py +856 -0
  35. birds_vs_bats-1.0.0/src/services/__init__.py +1 -0
  36. birds_vs_bats-1.0.0/src/services/achievements.py +429 -0
  37. birds_vs_bats-1.0.0/src/services/audio.py +1657 -0
  38. birds_vs_bats-1.0.0/src/services/firebase_client.py +297 -0
  39. birds_vs_bats-1.0.0/src/services/music_engine.py +837 -0
  40. birds_vs_bats-1.0.0/src/services/save_manager.py +704 -0
  41. birds_vs_bats-1.0.0/src/theme.py +267 -0
  42. birds_vs_bats-1.0.0/src/ui/__init__.py +1 -0
  43. birds_vs_bats-1.0.0/src/ui/fullscreen.py +259 -0
  44. birds_vs_bats-1.0.0/src/ui/render.py +3604 -0
  45. birds_vs_bats-1.0.0/theme.yml +202 -0
  46. birds_vs_bats-1.0.0/theme_accessible.yml +161 -0
@@ -0,0 +1,12 @@
1
+ include config.yml
2
+ include config.sample.yml
3
+ include config.schema.json
4
+ include theme.yml
5
+ include theme_accessible.yml
6
+ include config_easy.yml
7
+ include config_hard.yml
8
+ include config_hell.yml
9
+ include game.py
10
+ include requirements.txt
11
+ recursive-include src *.py *.yml *.json
12
+ recursive-include bvb *.py *.yml *.json
@@ -0,0 +1,336 @@
1
+ Metadata-Version: 2.4
2
+ Name: birds-vs-bats
3
+ Version: 1.0.0
4
+ Summary: A terminal-based ASCII art game where birds battle bats across multiple biomes
5
+ Author-email: Carlo Moretti <onheiron@gmail.com>
6
+ License: BSD-3-Clause
7
+ Project-URL: Homepage, https://github.com/onheiron/birds-vs-bats
8
+ Keywords: game,terminal,ascii,birds,bats
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Environment :: Console
11
+ Classifier: Topic :: Games/Entertainment
12
+ Classifier: Programming Language :: Python :: 3
13
+ Requires-Python: >=3.9
14
+ Description-Content-Type: text/markdown
15
+ Requires-Dist: pyyaml
16
+ Requires-Dist: jsonschema
17
+ Provides-Extra: firebase
18
+ Requires-Dist: firebase-admin>=6.0.0; extra == "firebase"
19
+ Requires-Dist: requests>=2.20.0; extra == "firebase"
20
+ Provides-Extra: audio
21
+ Requires-Dist: simpleaudio>=1.0.4; extra == "audio"
22
+
23
+ # BVB - Bird vs Bat Juggling Game
24
+
25
+ A roguelike arcade game where you juggle 9 colorful birds that bounce and battle against obstacles and bats!
26
+
27
+
28
+
29
+ # BVB β€” Bird vs Bat (terminal arcade)
30
+
31
+ Bird vs Bat (BVB) is a lightweight terminal arcade/roguelike where you juggle 9 birds, use per-bird powers,
32
+ manage lanes, and fight dynamically spawning bats and obstacles. This README documents how to play,
33
+ what changed recently, developer notes and configuration.
34
+
35
+ All content below is in English.
36
+
37
+ <!-- Project media: replace the files in media/ with your real assets -->
38
+ ![Screenshot](media/screenshot.png)
39
+
40
+ ![Footage](media/footage.gif)
41
+
42
+ ## Quick start
43
+
44
+ From source (recommended for development):
45
+
46
+ ```bash
47
+ # Install dependencies
48
+ pip install pyyaml jsonschema
49
+
50
+ # Run with default config
51
+ python3 start.py
52
+
53
+ # Run with custom config
54
+ python3 start.py --config myconfig.yml
55
+ ```
56
+
57
+ Standalone binary (if present):
58
+ - macOS: `dist/BVB` (run `./dist/BVB`)
59
+ - Windows: `dist/BVB.exe`
60
+
61
+ ## Configuration
62
+
63
+ **Important**: BVB requires a configuration file to run. All game constants are loaded from `config.yml`.
64
+
65
+ ### Quick Start
66
+
67
+ ```bash
68
+ # The game expects config.yml in the current directory
69
+ # Copy the sample if you don't have one:
70
+ cp config.sample.yml config.yml
71
+
72
+ # Edit config.yml to customize game settings
73
+ # Run the game (uses config.yml by default)
74
+ python3 start.py
75
+
76
+ # Or specify a different config file:
77
+ python3 start.py --config myconfig.yml
78
+ ```
79
+
80
+ ### Configuration Structure
81
+
82
+ **All game constants are defined in config.yml** - there are no hardcoded defaults in the code. The configuration file uses a namespace structure:
83
+
84
+ ```yaml
85
+ # Example config.yml structure
86
+ layout:
87
+ width: 50 # Game field width
88
+ height: 35 # Game field height
89
+ num_balls: 12 # Number of birds
90
+
91
+ timing:
92
+ base_sleep: 0.15 # Frame delay (lower = faster)
93
+
94
+ physics:
95
+ speed_max: 8 # Maximum bird speed
96
+ ```
97
+
98
+ All namespaces must be present in config.yml:
99
+ - `layout` - Game dimensions and lane setup (required)
100
+ - `birds` - Bird formation and behavior (required)
101
+ - `timing` - Frame rates and durations (required)
102
+ - `physics` - Speed limits and movement (required)
103
+ - `eggs` - Drop rates and rarity weights (required)
104
+ - `bat_enemy` - Bat spawning and HP (required)
105
+ - `obstacle` - Obstacle spawning (required)
106
+ - `wide_cursor`, `bounce_boost`, `suction`, `tailwind` - Power-up settings
107
+ - `dinosaur`, `stealth`, `gold`, `clockwork`, `glitch`, `orange` - Special bird behaviors
108
+ - `progression`, `combo`, `combat` - Game mechanics
109
+ - `controls` - Key bindings
110
+
111
+ **See `config.sample.yml` for the complete reference configuration.** This file contains all required values and serves as documentation for available settings.
112
+
113
+ ## Controls
114
+
115
+ - ← / β†’ : Move cursor between lanes
116
+ - ↑ : Bounce the bird in the selected lane (if already rising, activates that bird's power β€” once per ascent)
117
+ - ↓ : (unused) β€” the Suction power has been removed; new loot-based power-ups (Tailwind, Shuffle) now change flock behavior when collected
118
+ - SPACE : Swap mode (select a lane, press again to swap two birds). Swap costs points (200 Γ— current level).
119
+ - Q or Ctrl+C : Quit
120
+
121
+ ## What's new (high level)
122
+
123
+ - Added new bird types: STEALTH, PATCHWORK, GOLD and their eggs.
124
+ - `stealth_egg`: a new rare egg (rarity = "rare", weight = 10) that spawns a STEALTH bird when collected.
125
+ - STEALTH bird behaviour:
126
+ - Normally invisible: rendering alternates between visible dark-gray and ANSI "conceal" (SGR 8) so it is
127
+ hidden on supporting terminals.
128
+ - Pass-through: while stealth (non-tangible) it passes through bats, obstacles and loot.
129
+ - Power (press ↑ while rising): become tangible for a short window and deal heavy damage to nearby enemies.
130
+ - Power also grants a short speed boost (speed = 6) for the power duration.
131
+ - PATCHWORK bird and `patchwork_egg` (uncommon): triggers all synergy effects of other birds.
132
+ - GOLD bird and `gold_egg` (rare): special scoring bird (higher passive score / fast speed).
133
+ - Blue sprint behaviour fixed: sprint now times out correctly and the bird returns to its normal color when the boost ends.
134
+ - Despawn: bats and loot older than 60 seconds are cleaned up automatically to avoid screen clutter.
135
+ - Firebase telemetry: total play time is now tracked and submitted with game-over events.
136
+ - Misc: audio/music backend removed for determinism in terminal builds.
137
+ - Removed legacy power-ups: Bounce Boost and Suction. These were replaced with two new loot-based power-ups (Tailwind and Shuffle) to streamline gameplay and avoid input lag issues.
138
+ - New power-up β€” Tailwind (symbol: ΰΌ„): a tiered pickup that temporarily boosts rising birds and penalizes falling birds. While active the starting line is visually highlighted and bird vertical speeds are clamped for balance.
139
+ - New power-up β€” Shuffle (symbol: π–¦Ή): a tiered pickup that smartly swaps birds between lanes (2/4/6 birds depending on tier) to compact the formation toward the center. Moved birds are reset to the starting line and begin rising.
140
+
141
+ ## Birds (summary)
142
+
143
+ Each bird has a base speed and a special power triggered while the bird is rising (↑ twice).
144
+
145
+ - Yellow (speed 2)
146
+ - Power: slow adjacent falling birds for a short duration (except other yellows, which are bounced).
147
+
148
+ - Red (speed 3)
149
+ - Power: fires a projectile upward. Projectile damage increases when adjacent red/patchwork birds are rising.
150
+
151
+ - Blue (speed 4)
152
+ - Power: temporary speed boost and +1 damage. The bird is visually highlighted (CYAN) while boosted.
153
+ - Sprint is limited-time and will stop either on bounce or when the boost duration expires.
154
+
155
+ - White (speed 4)
156
+ - Power: affects multiple lanes (Β±2 lanes). Can bounce falling birds or trigger rising birds' powers.
157
+
158
+ - Purple (speed 3)
159
+ - Knows no fear.
160
+
161
+ - Clockwork (speed 2)
162
+ - Auto-bounce on floor (helps keep lanes active). Does not die on floor like other birds.
163
+
164
+ - PATCHWORK (speed 3)
165
+ - Triggers synergy effects of all other colors.
166
+
167
+ - GOLD (speed 6)
168
+ - High-scoring special bird. Scores larger passive points each frame when alive.
169
+
170
+ - STEALTH (speed 3 base)
171
+ - Stealth behavior (see "Stealth mechanics" below).
172
+
173
+ ## Stealth mechanics (detailed)
174
+
175
+ - Stealth birds alternate between visible DARK_GRAY and ANSI conceal (hidden) while flying.
176
+ - While in stealth (non-tangible) they pass through bats, obstacles and loot β€” they won't collide or collect.
177
+ - Activating the stealth power (↑ while rising) makes the bird tangible for a short duration (configurable in code):
178
+ - During tangibility the bird deals heavy damage to nearby bats/obstacles and destroys nearby loot.
179
+ - The bird's speed is temporarily set to 6 for the duration of the tangible window.
180
+ - The bird displays a bright color (WHITE) while tangible so the player sees the power.
181
+ - The power is allowed only once per ascent (the internal `bird_power_used` flag prevents re-activation until the bird
182
+ falls and then rises again).
183
+
184
+ ## Loot system (brief)
185
+
186
+ - Loot drop logic takes the enemy tier and current empty lanes into account. Eggs are only dropped when there are
187
+ empty lanes available (to avoid unreachable eggs).
188
+ - New egg: `stealth_egg` included in the "rare" egg pool with weight 10.
189
+
190
+ Rare egg composition now includes: blue_egg, clockwork_egg, purple_egg, gold_egg, stealth_egg (weights: 40, 20, 20, 10, 10).
191
+
192
+ When a `stealth_egg` is collected, it spawns a STEALTH bird in the first available (dead) bird slot.
193
+
194
+ New loot additions: Tailwind and Shuffle
195
+
196
+ - Tailwind (symbol: 'ΰΌ„'): a loot pickup that applies a tiered modifier to bird vertical speeds. Rising birds receive a temporary upward speed bonus while falling birds receive a penalty; speeds are clamped to remain balanced (game clamps to a safe range). The starting line receives a visual indicator while Tailwind is active.
197
+ - Shuffle (symbol: 'π–¦Ή'): a loot pickup that triggers an automatic lane reorganization. Depending on tier, it swaps a small group of birds (e.g. 2 / 4 / 6) and prefers compacting birds toward the center by moving outer birds into empty or inner lanes; birds moved by Shuffle are reset to the starting line and set to rise.
198
+
199
+ ## Enemies & despawn
200
+
201
+ - Obstacles and bats spawn in tiers with increasing HP and difficulty.
202
+ - Entities older than 60 seconds are automatically removed from the world (both bats and loot) to reduce clutter.
203
+
204
+ ## Achievements & telemetry
205
+
206
+ - Basic achievements are tracked and displayed as short notifications.
207
+ - If a Firebase client is configured, the game attempts to submit analytics events in the background.
208
+ - On game over the session's elapsed play time (seconds + formatted string) is included with the score submission.
209
+
210
+ ## Developer notes
211
+
212
+ Run locally:
213
+
214
+ ```bash
215
+ pip install pyyaml jsonschema
216
+ python3 start.py
217
+ ```
218
+
219
+ **Configuration validation:**
220
+ - The game validates configuration files against `config.schema.json` if `jsonschema` is installed
221
+ - Invalid configs will cause the game to exit with a descriptive error message
222
+ - All config fields are optional with sensible defaults
223
+
224
+ **Configurable settings include:**
225
+ - Initial bird formation and lane randomization (`birds.formation`, `birds.randomize_lanes`)
226
+ - Keyboard controls (`controls.*`)
227
+ - Enemy spawning rates, HP, and tier weights
228
+ - Power-up durations and effects
229
+ - Physics speeds and timing
230
+ - Collision detection parameters
231
+ - And much more...
232
+
233
+ See `config.sample.yml` for the complete list of tunables.
234
+
235
+ Build a single-file executable with PyInstaller:
236
+
237
+ ```bash
238
+ pip install pyinstaller
239
+ pyinstaller --onefile --name BVB --console start.py
240
+ ```
241
+
242
+ Configuration & tuning
243
+
244
+ - Many gameplay timings are derived from `base_sleep` at the top of `start.py`.
245
+ - `base_sleep` controls the global frame speed; durations are converted to frame counts using `int(seconds/base_sleep)`.
246
+ - To tune power durations, search for values like `int(2.0 / base_sleep)` or `int(5.0 / base_sleep)` in `start.py`.
247
+ - Stealth tangible window and speed boost are applied near the code path where `stealth_timers[...]` is set.
248
+
249
+ Terminal compatibility notes
250
+
251
+ - The stealth effect uses ANSI SGR 8 (conceal) to hide the sprite on terminals that support it. Not all terminals honor
252
+ SGR 8; on terminals that ignore it the invisibility will be a no-op and the bird will still appear. If you see no
253
+ invisibility, the bird will still behave correctly (pass-through mechanics are logic-based).
254
+
255
+ Debugging tips
256
+
257
+ - Enable on-screen notifications (they are used for achievements and some debug messages). They appear in the footer.
258
+ - If a power doesn't look like it activated, check whether `bird_power_used` is True for that bird (logic prevents multiple
259
+ activations per ascent).
260
+
261
+ Contributing
262
+
263
+ - Open a PR with focused changes. Prefer minimal, isolated diffs. If changing tune constants, include the rationale and
264
+ observable impact (e.g. "increased blue sprint to 8s for better feel").
265
+
266
+ License & credits
267
+
268
+ - This project is provided as-is. See repository for license information and credits.
269
+
270
+ Enjoy and let me know if you want any of these behaviours tuned or documented further.
271
+
272
+ ---
273
+
274
+ ## Visual highlights & quick reference ✨
275
+
276
+ Below are compact, printable references that are easy to scan while playing.
277
+
278
+ ### Birds at a glance
279
+
280
+ | Bird | Speed | Power (while rising) | Notes |
281
+ |---:|:---:|:---|:---|
282
+ | πŸ“£ Yellow | 2 | Slow adjacent falling birds (except yellows) | Bounce other yellows instead of slowing |
283
+ | πŸ”₯ Red | 3 | Fire projectile (damage bonus with adjacent rising red/patchwork) | Great vs bats/obstacles |
284
+ | ✈️ Blue | 4 | Temporary speed + damage (+1) β€” visual: CYAN | Sprint ends on bounce or timeout |
285
+ | πŸ’ͺ🏻 White | 4 | Multi-lane effect (Β±2 lanes) β€” bounce or trigger adjacent powers | Utility / crowd control |
286
+ | πŸ¦ΈπŸ»β€β™‚οΈ Purple | 3 | Special obstacle/bat interactions | Lane-control specialist |
287
+ | πŸ€– Clockwork | 2 | Auto-bounce on floor/ceiling | Stable lane maintainer (survivor) |
288
+ | βœ‚οΈ Patchwork | 3 | Visual multicolor (counts as other colors for synergy) | Decorative + synergy |
289
+ | πŸ₯‡ Gold | 6 | High passive score | Fast and valuable |
290
+ | πŸ•ΆοΈ Stealth | 3 (base) | Become tangible briefly β€” heavy damage, speed=6 while active | Invisible while stealth; pass-through mechanics |
291
+
292
+ ---
293
+
294
+ ### Power-ups (loot) at a glance
295
+
296
+ - ΰΌ„ Tailwind β€” Tiered pickup that boosts rising birds and penalizes falling birds. Visual starting-line indicator while active. Speeds are clamped for balance.
297
+ - π–¦Ή Shuffle β€” Tiered pickup that performs smart lane swaps (2/4/6 birds depending on tier) to compact the formation toward center; moved birds reset to the starting line and begin rising.
298
+
299
+
300
+ ### Loot rarity bar chart (approximate weights)
301
+
302
+ ```
303
+ Rare/Epic egg weights (visual):
304
+ common β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ ~60
305
+ uncommon β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ ~25-35
306
+ rare β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ ~10-20
307
+ epic β–ˆβ–ˆβ–ˆβ–ˆ ~5-15
308
+ ```
309
+
310
+ Below is a tiny ASCII breakdown for *rare* egg choices (weights):
311
+
312
+ ```
313
+ blue_egg : β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ (40)
314
+ clockwork_egg : β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ (20)
315
+ purple_egg : β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ (20)
316
+ gold_egg : β–ˆβ–ˆβ–ˆβ–ˆ (10)
317
+ stealth_egg : β–ˆβ–ˆβ–ˆβ–ˆ (10)
318
+ ```
319
+
320
+ ---
321
+
322
+ ## Formatting & color notes
323
+
324
+ - This README uses emoji, **bold**, *italic* and tables for clarity.
325
+ - Terminal color samples are shown in `start.py` as ANSI escapes; not all terminals honor every SGR code (notably SGR 8 "conceal").
326
+
327
+ If you want more visual polish (SVG charts, images, or GitHub action-generated badges), tell me which graphs you prefer and I can add them.
328
+
329
+ ---
330
+
331
+ ## Full content (reference & details)
332
+
333
+ > The rest of the README documents gameplay, developer notes and tuning pointers in plain English so you can
334
+ > tune and run the game easily. See the source `start.py` for implementation specifics (timings derived from `base_sleep`).
335
+
336
+ (See the file header in `start.py` for constants and exact code pointers.)
@@ -0,0 +1,314 @@
1
+ # BVB - Bird vs Bat Juggling Game
2
+
3
+ A roguelike arcade game where you juggle 9 colorful birds that bounce and battle against obstacles and bats!
4
+
5
+
6
+
7
+ # BVB β€” Bird vs Bat (terminal arcade)
8
+
9
+ Bird vs Bat (BVB) is a lightweight terminal arcade/roguelike where you juggle 9 birds, use per-bird powers,
10
+ manage lanes, and fight dynamically spawning bats and obstacles. This README documents how to play,
11
+ what changed recently, developer notes and configuration.
12
+
13
+ All content below is in English.
14
+
15
+ <!-- Project media: replace the files in media/ with your real assets -->
16
+ ![Screenshot](media/screenshot.png)
17
+
18
+ ![Footage](media/footage.gif)
19
+
20
+ ## Quick start
21
+
22
+ From source (recommended for development):
23
+
24
+ ```bash
25
+ # Install dependencies
26
+ pip install pyyaml jsonschema
27
+
28
+ # Run with default config
29
+ python3 start.py
30
+
31
+ # Run with custom config
32
+ python3 start.py --config myconfig.yml
33
+ ```
34
+
35
+ Standalone binary (if present):
36
+ - macOS: `dist/BVB` (run `./dist/BVB`)
37
+ - Windows: `dist/BVB.exe`
38
+
39
+ ## Configuration
40
+
41
+ **Important**: BVB requires a configuration file to run. All game constants are loaded from `config.yml`.
42
+
43
+ ### Quick Start
44
+
45
+ ```bash
46
+ # The game expects config.yml in the current directory
47
+ # Copy the sample if you don't have one:
48
+ cp config.sample.yml config.yml
49
+
50
+ # Edit config.yml to customize game settings
51
+ # Run the game (uses config.yml by default)
52
+ python3 start.py
53
+
54
+ # Or specify a different config file:
55
+ python3 start.py --config myconfig.yml
56
+ ```
57
+
58
+ ### Configuration Structure
59
+
60
+ **All game constants are defined in config.yml** - there are no hardcoded defaults in the code. The configuration file uses a namespace structure:
61
+
62
+ ```yaml
63
+ # Example config.yml structure
64
+ layout:
65
+ width: 50 # Game field width
66
+ height: 35 # Game field height
67
+ num_balls: 12 # Number of birds
68
+
69
+ timing:
70
+ base_sleep: 0.15 # Frame delay (lower = faster)
71
+
72
+ physics:
73
+ speed_max: 8 # Maximum bird speed
74
+ ```
75
+
76
+ All namespaces must be present in config.yml:
77
+ - `layout` - Game dimensions and lane setup (required)
78
+ - `birds` - Bird formation and behavior (required)
79
+ - `timing` - Frame rates and durations (required)
80
+ - `physics` - Speed limits and movement (required)
81
+ - `eggs` - Drop rates and rarity weights (required)
82
+ - `bat_enemy` - Bat spawning and HP (required)
83
+ - `obstacle` - Obstacle spawning (required)
84
+ - `wide_cursor`, `bounce_boost`, `suction`, `tailwind` - Power-up settings
85
+ - `dinosaur`, `stealth`, `gold`, `clockwork`, `glitch`, `orange` - Special bird behaviors
86
+ - `progression`, `combo`, `combat` - Game mechanics
87
+ - `controls` - Key bindings
88
+
89
+ **See `config.sample.yml` for the complete reference configuration.** This file contains all required values and serves as documentation for available settings.
90
+
91
+ ## Controls
92
+
93
+ - ← / β†’ : Move cursor between lanes
94
+ - ↑ : Bounce the bird in the selected lane (if already rising, activates that bird's power β€” once per ascent)
95
+ - ↓ : (unused) β€” the Suction power has been removed; new loot-based power-ups (Tailwind, Shuffle) now change flock behavior when collected
96
+ - SPACE : Swap mode (select a lane, press again to swap two birds). Swap costs points (200 Γ— current level).
97
+ - Q or Ctrl+C : Quit
98
+
99
+ ## What's new (high level)
100
+
101
+ - Added new bird types: STEALTH, PATCHWORK, GOLD and their eggs.
102
+ - `stealth_egg`: a new rare egg (rarity = "rare", weight = 10) that spawns a STEALTH bird when collected.
103
+ - STEALTH bird behaviour:
104
+ - Normally invisible: rendering alternates between visible dark-gray and ANSI "conceal" (SGR 8) so it is
105
+ hidden on supporting terminals.
106
+ - Pass-through: while stealth (non-tangible) it passes through bats, obstacles and loot.
107
+ - Power (press ↑ while rising): become tangible for a short window and deal heavy damage to nearby enemies.
108
+ - Power also grants a short speed boost (speed = 6) for the power duration.
109
+ - PATCHWORK bird and `patchwork_egg` (uncommon): triggers all synergy effects of other birds.
110
+ - GOLD bird and `gold_egg` (rare): special scoring bird (higher passive score / fast speed).
111
+ - Blue sprint behaviour fixed: sprint now times out correctly and the bird returns to its normal color when the boost ends.
112
+ - Despawn: bats and loot older than 60 seconds are cleaned up automatically to avoid screen clutter.
113
+ - Firebase telemetry: total play time is now tracked and submitted with game-over events.
114
+ - Misc: audio/music backend removed for determinism in terminal builds.
115
+ - Removed legacy power-ups: Bounce Boost and Suction. These were replaced with two new loot-based power-ups (Tailwind and Shuffle) to streamline gameplay and avoid input lag issues.
116
+ - New power-up β€” Tailwind (symbol: ΰΌ„): a tiered pickup that temporarily boosts rising birds and penalizes falling birds. While active the starting line is visually highlighted and bird vertical speeds are clamped for balance.
117
+ - New power-up β€” Shuffle (symbol: π–¦Ή): a tiered pickup that smartly swaps birds between lanes (2/4/6 birds depending on tier) to compact the formation toward the center. Moved birds are reset to the starting line and begin rising.
118
+
119
+ ## Birds (summary)
120
+
121
+ Each bird has a base speed and a special power triggered while the bird is rising (↑ twice).
122
+
123
+ - Yellow (speed 2)
124
+ - Power: slow adjacent falling birds for a short duration (except other yellows, which are bounced).
125
+
126
+ - Red (speed 3)
127
+ - Power: fires a projectile upward. Projectile damage increases when adjacent red/patchwork birds are rising.
128
+
129
+ - Blue (speed 4)
130
+ - Power: temporary speed boost and +1 damage. The bird is visually highlighted (CYAN) while boosted.
131
+ - Sprint is limited-time and will stop either on bounce or when the boost duration expires.
132
+
133
+ - White (speed 4)
134
+ - Power: affects multiple lanes (Β±2 lanes). Can bounce falling birds or trigger rising birds' powers.
135
+
136
+ - Purple (speed 3)
137
+ - Knows no fear.
138
+
139
+ - Clockwork (speed 2)
140
+ - Auto-bounce on floor (helps keep lanes active). Does not die on floor like other birds.
141
+
142
+ - PATCHWORK (speed 3)
143
+ - Triggers synergy effects of all other colors.
144
+
145
+ - GOLD (speed 6)
146
+ - High-scoring special bird. Scores larger passive points each frame when alive.
147
+
148
+ - STEALTH (speed 3 base)
149
+ - Stealth behavior (see "Stealth mechanics" below).
150
+
151
+ ## Stealth mechanics (detailed)
152
+
153
+ - Stealth birds alternate between visible DARK_GRAY and ANSI conceal (hidden) while flying.
154
+ - While in stealth (non-tangible) they pass through bats, obstacles and loot β€” they won't collide or collect.
155
+ - Activating the stealth power (↑ while rising) makes the bird tangible for a short duration (configurable in code):
156
+ - During tangibility the bird deals heavy damage to nearby bats/obstacles and destroys nearby loot.
157
+ - The bird's speed is temporarily set to 6 for the duration of the tangible window.
158
+ - The bird displays a bright color (WHITE) while tangible so the player sees the power.
159
+ - The power is allowed only once per ascent (the internal `bird_power_used` flag prevents re-activation until the bird
160
+ falls and then rises again).
161
+
162
+ ## Loot system (brief)
163
+
164
+ - Loot drop logic takes the enemy tier and current empty lanes into account. Eggs are only dropped when there are
165
+ empty lanes available (to avoid unreachable eggs).
166
+ - New egg: `stealth_egg` included in the "rare" egg pool with weight 10.
167
+
168
+ Rare egg composition now includes: blue_egg, clockwork_egg, purple_egg, gold_egg, stealth_egg (weights: 40, 20, 20, 10, 10).
169
+
170
+ When a `stealth_egg` is collected, it spawns a STEALTH bird in the first available (dead) bird slot.
171
+
172
+ New loot additions: Tailwind and Shuffle
173
+
174
+ - Tailwind (symbol: 'ΰΌ„'): a loot pickup that applies a tiered modifier to bird vertical speeds. Rising birds receive a temporary upward speed bonus while falling birds receive a penalty; speeds are clamped to remain balanced (game clamps to a safe range). The starting line receives a visual indicator while Tailwind is active.
175
+ - Shuffle (symbol: 'π–¦Ή'): a loot pickup that triggers an automatic lane reorganization. Depending on tier, it swaps a small group of birds (e.g. 2 / 4 / 6) and prefers compacting birds toward the center by moving outer birds into empty or inner lanes; birds moved by Shuffle are reset to the starting line and set to rise.
176
+
177
+ ## Enemies & despawn
178
+
179
+ - Obstacles and bats spawn in tiers with increasing HP and difficulty.
180
+ - Entities older than 60 seconds are automatically removed from the world (both bats and loot) to reduce clutter.
181
+
182
+ ## Achievements & telemetry
183
+
184
+ - Basic achievements are tracked and displayed as short notifications.
185
+ - If a Firebase client is configured, the game attempts to submit analytics events in the background.
186
+ - On game over the session's elapsed play time (seconds + formatted string) is included with the score submission.
187
+
188
+ ## Developer notes
189
+
190
+ Run locally:
191
+
192
+ ```bash
193
+ pip install pyyaml jsonschema
194
+ python3 start.py
195
+ ```
196
+
197
+ **Configuration validation:**
198
+ - The game validates configuration files against `config.schema.json` if `jsonschema` is installed
199
+ - Invalid configs will cause the game to exit with a descriptive error message
200
+ - All config fields are optional with sensible defaults
201
+
202
+ **Configurable settings include:**
203
+ - Initial bird formation and lane randomization (`birds.formation`, `birds.randomize_lanes`)
204
+ - Keyboard controls (`controls.*`)
205
+ - Enemy spawning rates, HP, and tier weights
206
+ - Power-up durations and effects
207
+ - Physics speeds and timing
208
+ - Collision detection parameters
209
+ - And much more...
210
+
211
+ See `config.sample.yml` for the complete list of tunables.
212
+
213
+ Build a single-file executable with PyInstaller:
214
+
215
+ ```bash
216
+ pip install pyinstaller
217
+ pyinstaller --onefile --name BVB --console start.py
218
+ ```
219
+
220
+ Configuration & tuning
221
+
222
+ - Many gameplay timings are derived from `base_sleep` at the top of `start.py`.
223
+ - `base_sleep` controls the global frame speed; durations are converted to frame counts using `int(seconds/base_sleep)`.
224
+ - To tune power durations, search for values like `int(2.0 / base_sleep)` or `int(5.0 / base_sleep)` in `start.py`.
225
+ - Stealth tangible window and speed boost are applied near the code path where `stealth_timers[...]` is set.
226
+
227
+ Terminal compatibility notes
228
+
229
+ - The stealth effect uses ANSI SGR 8 (conceal) to hide the sprite on terminals that support it. Not all terminals honor
230
+ SGR 8; on terminals that ignore it the invisibility will be a no-op and the bird will still appear. If you see no
231
+ invisibility, the bird will still behave correctly (pass-through mechanics are logic-based).
232
+
233
+ Debugging tips
234
+
235
+ - Enable on-screen notifications (they are used for achievements and some debug messages). They appear in the footer.
236
+ - If a power doesn't look like it activated, check whether `bird_power_used` is True for that bird (logic prevents multiple
237
+ activations per ascent).
238
+
239
+ Contributing
240
+
241
+ - Open a PR with focused changes. Prefer minimal, isolated diffs. If changing tune constants, include the rationale and
242
+ observable impact (e.g. "increased blue sprint to 8s for better feel").
243
+
244
+ License & credits
245
+
246
+ - This project is provided as-is. See repository for license information and credits.
247
+
248
+ Enjoy and let me know if you want any of these behaviours tuned or documented further.
249
+
250
+ ---
251
+
252
+ ## Visual highlights & quick reference ✨
253
+
254
+ Below are compact, printable references that are easy to scan while playing.
255
+
256
+ ### Birds at a glance
257
+
258
+ | Bird | Speed | Power (while rising) | Notes |
259
+ |---:|:---:|:---|:---|
260
+ | πŸ“£ Yellow | 2 | Slow adjacent falling birds (except yellows) | Bounce other yellows instead of slowing |
261
+ | πŸ”₯ Red | 3 | Fire projectile (damage bonus with adjacent rising red/patchwork) | Great vs bats/obstacles |
262
+ | ✈️ Blue | 4 | Temporary speed + damage (+1) β€” visual: CYAN | Sprint ends on bounce or timeout |
263
+ | πŸ’ͺ🏻 White | 4 | Multi-lane effect (Β±2 lanes) β€” bounce or trigger adjacent powers | Utility / crowd control |
264
+ | πŸ¦ΈπŸ»β€β™‚οΈ Purple | 3 | Special obstacle/bat interactions | Lane-control specialist |
265
+ | πŸ€– Clockwork | 2 | Auto-bounce on floor/ceiling | Stable lane maintainer (survivor) |
266
+ | βœ‚οΈ Patchwork | 3 | Visual multicolor (counts as other colors for synergy) | Decorative + synergy |
267
+ | πŸ₯‡ Gold | 6 | High passive score | Fast and valuable |
268
+ | πŸ•ΆοΈ Stealth | 3 (base) | Become tangible briefly β€” heavy damage, speed=6 while active | Invisible while stealth; pass-through mechanics |
269
+
270
+ ---
271
+
272
+ ### Power-ups (loot) at a glance
273
+
274
+ - ΰΌ„ Tailwind β€” Tiered pickup that boosts rising birds and penalizes falling birds. Visual starting-line indicator while active. Speeds are clamped for balance.
275
+ - π–¦Ή Shuffle β€” Tiered pickup that performs smart lane swaps (2/4/6 birds depending on tier) to compact the formation toward center; moved birds reset to the starting line and begin rising.
276
+
277
+
278
+ ### Loot rarity bar chart (approximate weights)
279
+
280
+ ```
281
+ Rare/Epic egg weights (visual):
282
+ common β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ ~60
283
+ uncommon β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ ~25-35
284
+ rare β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ ~10-20
285
+ epic β–ˆβ–ˆβ–ˆβ–ˆ ~5-15
286
+ ```
287
+
288
+ Below is a tiny ASCII breakdown for *rare* egg choices (weights):
289
+
290
+ ```
291
+ blue_egg : β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ (40)
292
+ clockwork_egg : β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ (20)
293
+ purple_egg : β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ (20)
294
+ gold_egg : β–ˆβ–ˆβ–ˆβ–ˆ (10)
295
+ stealth_egg : β–ˆβ–ˆβ–ˆβ–ˆ (10)
296
+ ```
297
+
298
+ ---
299
+
300
+ ## Formatting & color notes
301
+
302
+ - This README uses emoji, **bold**, *italic* and tables for clarity.
303
+ - Terminal color samples are shown in `start.py` as ANSI escapes; not all terminals honor every SGR code (notably SGR 8 "conceal").
304
+
305
+ If you want more visual polish (SVG charts, images, or GitHub action-generated badges), tell me which graphs you prefer and I can add them.
306
+
307
+ ---
308
+
309
+ ## Full content (reference & details)
310
+
311
+ > The rest of the README documents gameplay, developer notes and tuning pointers in plain English so you can
312
+ > tune and run the game easily. See the source `start.py` for implementation specifics (timings derived from `base_sleep`).
313
+
314
+ (See the file header in `start.py` for constants and exact code pointers.)