Skip to content

Restore battle animations with delay-verifiable test infrastructure - #13

Merged
MobyNL merged 6 commits into
mainfrom
copilot/vscode-mmnxyx33-xs6k
Mar 13, 2026
Merged

Restore battle animations with delay-verifiable test infrastructure#13
MobyNL merged 6 commits into
mainfrom
copilot/vscode-mmnxyx33-xs6k

Conversation

Copilot AI commented Mar 12, 2026

Copy link
Copy Markdown

Battle animations were gone — encounter intros, fight moves, and catch attempts all wrote output instantly with no wait time. There was also no test mechanism to assert that animations actually request a non-zero delay.

Animation infrastructure

AnimatedTextWriter — records last_delay on every write_lines_with_delay call.

MockAnimatedTextWriter — records (method_name, delay, lines) per call in recorded_calls, enabling assertions like:

delays = [d for _, d, _ in term.text_animator.recorded_calls]
assert any(d > 0 for d in delays)

Battle encounter start (wild + trainer)

  • battle_ui.py: extracted get_battle_start_lines() / get_trainer_battle_start_lines() returning List[str] so callers can animate rather than write instantly.
  • battle_actions.trigger_wild_encounter / trigger_trainer_encounter: accept optional show_battle_start_callback(output, on_ready) — battle options + pending_command fire inside on_ready() after animation completes. Default (no callback) preserves instant behaviour for all existing callers.
  • BattleMixin: passes text_animator.write_medium (0.4 s/line) as the callback.

Fight move animations

  • BattleMixin._build_wild_turn_messages(): executes the opponent turn (side-effects) and returns list[str], enabling callers to animate.
  • BattleMixin.execute_player_move: chained text_animator.write_fast calls — player attack → on_complete → opponent attack → on_complete → EOT effects → show options.

Catch (Pokeball throw) animation

  • battle_actions.attempt_catch_pokemon: optional animate_shake_callback(output, lines, on_complete) param; result logic (party-add, PC-store, Pokedex, escape counter-attack) moved into _after_shake().
  • BattleMixin.attempt_catch_pokemon: passes text_animator.write_slow (0.8 s/line) for dramatic shake tension.

Tests added

Class Tests What's verified
TestBattleStartAnimation 6 Encounter intros use write_medium, delay > 0, lines contain Pokémon name
TestFightMoveAnimation 6 write_fast, delay > 0, lines contain move name, ≥ 2 calls (player + opponent), no animation on back/unknown
TestCatchAnimation 6 write_slow, delay > 0, wiggle dots in lines, no animation without balls or in trainer battle
TestMockAnimatedTextWriter 4 Mock records correct canonical delay per method (fast=0.2, medium=0.4, slow=0.8, instant=0.0)
Original prompt

It;s time to create the next steps.

Let's continue with more locations. We'll add the trainers later:
Next Locations to Add:

  • ✅ Mt. Moon (COMPLETE - dungeon with trainers and wild Pokemon)
  • ✅ Route 4 (COMPLETE - west exit from Mt. Moon)
  • ✅ Cerulean City (COMPLETE - 2nd major city)
  • ❌ Route 5 (south of Cerulean)
  • ❌ Route 6 (continuation south)
  • ❌ Underground Path (Routes 5-6 connector)
  • ❌ Vermillion City (3rd major city, Lt. Surge gym)
  • ❌ Route 11 (east of Vermillion)
  • ❌ Diglett's Cave (Route 2 → Route 11 shortcut)
  • ❌ Route 9 (east of Cerulean)
  • ❌ Route 10 (towards Rock Tunnel)
  • ❌ Rock Tunnel (dark dungeon, requires Flash)

Implementation Notes:

  • Add location data to locations.py
  • Add wild Pokemon encounters for new routes
  • Update GAME_MAP_OVERVIEW.md with new locations
  • Create unit tests in tests/game/test_locations.py
  • Try to ceate a map that is visible, with a marker where the player is
[Chronological Review: The conversation began with the user requesting an analysis of their repository and an update to the implementation plan to reflect current progress and future plans. The user then specified the next steps for adding new locations in their project, detailing completed and pending locations, along with implementation notes.]

[Intent Mapping: The user explicitly requested to analyze the repository and update the implementation plan. They also outlined specific next steps for adding new locations, indicating which locations were complete and which were pending, along with implementation notes.]

[Technical Inventory: The user is working on a project related to a Pokémon game, utilizing a file named locations.py for location data, a markdown file GAME_MAP_OVERVIEW.md for an overview of the game map, and a test file tests/game/test_locations.py for unit tests.]

[Code Archaeology: The user mentioned modifying locations.py to add location data, updating GAME_MAP_OVERVIEW.md, and creating unit tests in tests/game/test_locations.py. They also indicated the need to create a visible map with a player marker.]

[Progress Assessment: The user has completed the following locations: Mt. Moon, Route 4, and Cerulean City. The following locations are pending: Route 5, Route 6, Underground Path, Vermillion City, Route 11, Diglett's Cave, Route 9, Route 10, and Rock Tunnel.]

[Context Validation: All critical information for continuation is captured, including the list of locations to be added, the implementation notes, and the files that need to be updated.]

[Recent Commands Analysis: The last agent command involved the user requesting to create the next steps for adding more locations. The tool results included a detailed list of locations with their completion status and implementation notes. The agent was actively working on updating the implementation plan when the token budget was exceeded. These operations connect to the user's goal of progressing in their Pokémon game development by adding new locations and ensuring the implementation plan reflects this progress.]

1. Conversation Overview: - Primary Objectives: The user requested an analysis of the repository and an update to the implementation plan to reflect current progress and future plans. They specified next steps for adding new locations. - Session Context: The conversation flowed from an initial request for repository analysis to outlining specific next steps for location additions, detailing completed and pending tasks. - User Intent Evolution: The user's needs evolved from a general analysis to specific implementation steps for enhancing their Pokémon game.
  1. Technical Foundation:
  • Python: Used for the game development, particularly in managing game locations and encounters.
  • Markdown: Utilized for documentation in GAME_MAP_OVERVIEW.md.
  • Unit Testing Framework: Implied usage in tests/game/test_locations.py for testing game functionality.
  1. Codebase Status:
  • locations.py:
    • Purpose: To manage and store location data for the game.
    • Current State: Needs updates to include new locations.
    • Key Code Segments: Functions for adding and retrieving location data.
    • Dependencies: Interacts with game logic for encounters and map navigation.
  • GAME_MAP_OVERVIEW.md:
    • Purpose: To provide an overview of the game map.
    • Current State: Requires updates to reflect new locations.
  • tests/game/test_locations.py:
    • Purpose: To contain unit tests for location functionality.
    • Current State: Needs new tests for added locations.
  1. Problem Resolution:
  • Issues Encountered: None explicitly mentioned, but the need for updates indicates ongoing development challenges.
  • Solutions Implemented: The user is actively planning updates to the codebase to enhance functionality.
  • Debugging Context: No specific debugging issues were noted.
  • Lessons Learned: The importance of maintaining an updated implementation plan alongside development progress.
  1. Progress Tr...

Created from VS Code.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…lion City, Diglett's Cave, Rock Tunnel

Co-authored-by: MobyNL <59473010+MobyNL@users.noreply.github.com>
Copilot AI changed the title [WIP] Add new locations and update game map Add Kanto locations: Routes 5/6/9/10/11, Underground Path, Vermillion City, Diglett's Cave, Rock Tunnel Mar 12, 2026
Copilot AI requested a review from MobyNL March 12, 2026 21:02
Co-authored-by: MobyNL <59473010+MobyNL@users.noreply.github.com>
Copilot AI changed the title Add Kanto locations: Routes 5/6/9/10/11, Underground Path, Vermillion City, Diglett's Cave, Rock Tunnel Increase route explore counts, give bike a double-step bonus, fix evolution animations Mar 12, 2026
…AnimatedTextWriter

Co-authored-by: MobyNL <59473010+MobyNL@users.noreply.github.com>
Copilot AI changed the title Increase route explore counts, give bike a double-step bonus, fix evolution animations Restore battle animations and add delay-verifiable animation test infrastructure Mar 12, 2026
…Animation and TestCatchAnimation

Co-authored-by: MobyNL <59473010+MobyNL@users.noreply.github.com>
Copilot AI changed the title Restore battle animations and add delay-verifiable animation test infrastructure Restore battle animations with delay-verifiable test infrastructure Mar 12, 2026
@MobyNL
MobyNL marked this pull request as ready for review March 13, 2026 18:41
@MobyNL
MobyNL merged commit 164002e into main Mar 13, 2026
1 check passed
@MobyNL
MobyNL deleted the copilot/vscode-mmnxyx33-xs6k branch March 13, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants