Kungfumaster integration - #336
Conversation
📁 Previous CI results (run #33864173950)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ❌The PR's base branch is Changed Files ❌The PR changes files that should not be changed:
Please ensure that only allowed files are modified. Any changes in the Framework Tests ❌Some framework tests failed. Please check the details below: kungfumaster ❌This log was automatically created at 2026-09-04 10:16:11 UTC. |
There was a problem hiding this comment.
🟡 Changes recommended
The renderer can crash when assets are unavailable and enemy collision logic uses the wrong direction signal, both of which can cause incorrect behavior at runtime.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adds a new JAX-native Atari environment for Kung-Fu Master and wires it into the game registry, alongside a custom JAX renderer and helper scripts for generating/extracting sprites.
Changes:
- Introduces
JaxKungFuMasterenvironment with full state, enemy/projectile systems, floor progression, and mod flags. - Adds
KungFuMasterRendererwith HUD and scene drawing plus sprite-loading support. - Registers the game in
core.pyand adds sprite-generation/extraction scripts.
File summaries
| File | Description |
|---|---|
src/jaxatari/games/kungfumaster_levels.py |
Placeholder level exports (currently reusing Kangaroo levels). |
src/jaxatari/games/jax_kungfumaster.py |
New Kung-Fu Master JAX environment + renderer implementation. |
src/jaxatari/core.py |
Registers "kungfumaster" in the game import map. |
scripts/fix_kungfu_sprites.py |
Generates a subset of Kung-Fu Master sprites into .npy assets. |
scripts/fix_all_sprites.py |
Generates additional enemy/object sprites into .npy assets. |
scripts/extract_ale_kungfu.py |
Extracts background/player sprites from ALE frames into .npy assets. |
scripts/create_score_digits.py |
Generates score digit sprites (currently not used by the renderer). |
scripts/create_hud_digits.py |
Generates HUD timer digit sprites used by the renderer. |
jaxatari_play_state.json |
A saved runtime play-state snapshot for kungfumaster. |
Review details
- Files reviewed: 9/45 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| def check_enemy_contact(is_active, enemy_type, ex, ey): | ||
| extra_reach = jnp.where((enemy_type == ENEMY_BOSS) & (state.floor == 1), to_int(cfg.BOSS_STICK_RANGE), to_int(0)) | ||
| effective_enemy_w = to_int(cfg.ENEMY_WIDTH) + extra_reach | ||
| adjusted_ex = jnp.where(state.en_dir[0] < 0, ex - extra_reach, ex) | ||
|
|
||
| overlapping = is_active & check_aabb_overlap( | ||
| player_x, effective_y, to_int(cfg.PLAYER_WIDTH), effective_height, | ||
| adjusted_ex, ey, effective_enemy_w, to_int(cfg.ENEMY_HEIGHT) | ||
| ) | ||
| grab_applied = overlapping & (enemy_type == ENEMY_GRIPPER) & to_bool(not cfg.MOD_NO_GRABS) | ||
| drain_dmg = jnp.where(grab_applied & (state.grab_timer <= 0), to_int(cfg.DMG_GRAB), to_int(0)) | ||
|
|
||
| boss_dmg = jnp.where(state.floor >= 3, to_int(cfg.DMG_BOSS + 2), to_int(cfg.DMG_BOSS)) | ||
| direct_hit_dmg = ( | ||
| jnp.where(overlapping & (enemy_type == ENEMY_BOSS), boss_dmg, to_int(0)) + | ||
| jnp.where(overlapping & (enemy_type == ENEMY_DRAGON), to_int(cfg.DMG_DRAGON), to_int(0)) + | ||
| jnp.where(overlapping & (enemy_type == ENEMY_SNAKE), to_int(cfg.DMG_SNAKE), to_int(0)) + | ||
| jnp.where(overlapping & (enemy_type == ENEMY_BALL), to_int(cfg.DMG_BALL), to_int(0)) | ||
| ) | ||
| return grab_applied, drain_dmg + direct_hit_dmg | ||
|
|
||
| grabbed_flags, damage_amounts = jax.vmap(check_enemy_contact)( | ||
| state.en_active, state.en_type, state.en_x, state.en_y | ||
| ) |
| self.spr_hud_digits = jnp.array([np.load(os.path.join(asset_dir, f"hud_digit_{i}.npy")) for i in range(10)], dtype=jnp.uint8) | ||
|
|
||
| self.has_assets = True | ||
| except Exception: | ||
| self.has_assets = False | ||
|
|
| # load pre-extracted sprites from local numpy arrays | ||
| asset_dir = "src/jaxatari/assets/kungfumaster" | ||
| try: |
| { | ||
| "format": "jaxatari_play_state_v1", | ||
| "game": "kungfumaster", | ||
| "mods": [], | ||
| "state_tree": { |
📁 Previous CI results (run #33864243872)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ❌The PR changes files that should not be changed:
Please ensure that only allowed files are modified. Any changes in the Framework Tests ❌Some framework tests failed. Please check the details below: kungfumaster ❌This log was automatically created at 2026-09-04 10:40:41 UTC. |
63bcd18 to
6370f1a
Compare
📁 Previous CI results (run #33864500037)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ❌The PR changes files that should not be changed:
Please ensure that only allowed files are modified. Any changes in the Framework Tests ❌Some framework tests failed. Please check the details below: kungfumaster ❌This log was automatically created at 2026-09-04 10:42:36 UTC. |
📁 Previous CI results (run #33864773939)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ❌The PR changes files that should not be changed:
Please ensure that only allowed files are modified. Any changes in the Framework Tests ❌Some framework tests failed. Please check the details below: kungfumaster ❌This log was automatically created at 2026-09-04 10:45:04 UTC. |
6370f1a to
0447200
Compare
📁 Previous CI results (run #33865313471)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ❌The PR changes files that should not be changed:
Please ensure that only allowed files are modified. Any changes in the Framework Tests ❌Some framework tests failed. Please check the details below: kungfumaster ❌This log was automatically created at 2026-09-04 10:48:36 UTC. |
0447200 to
733ef69
Compare
📁 Previous CI results (run #33865835679)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ❌The PR changes files that should not be changed:
Please ensure that only allowed files are modified. Any changes in the Framework Tests ❌Some framework tests failed. Please check the details below: kungfumaster ❌This log was automatically created at 2026-09-04 10:57:22 UTC. |
733ef69 to
d1e92cb
Compare
📁 Previous CI results (run #33866389754)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ✅There are no forbidden file changes. Nice 👍 Framework Tests ❌Some framework tests failed. Please check the details below: kungfumaster ❌This log was automatically created at 2026-09-04 11:04:27 UTC. |
d1e92cb to
2a360e4
Compare
📁 Previous CI results (run #33866734231)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ✅There are no forbidden file changes. Nice 👍 Framework Tests ❌Some framework tests failed. Please check the details below: kungfumaster ❌This log was automatically created at 2026-09-04 11:10:17 UTC. |
2a360e4 to
3459518
Compare
📁 Previous CI results (run #33867236706)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ✅There are no forbidden file changes. Nice 👍 Framework Tests ❌Some framework tests failed. Please check the details below: kungfumaster ❌This log was automatically created at 2026-09-04 11:15:01 UTC. |
3459518 to
e051942
Compare
📁 Previous CI results (run #33867659907)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ✅There are no forbidden file changes. Nice 👍 Framework Tests ❌Some framework tests failed. Please check the details below: kungfumaster ❌This log was automatically created at 2026-09-04 11:21:36 UTC. |
e051942 to
08281df
Compare
📁 Previous CI results (run #33868487195)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ✅There are no forbidden file changes. Nice 👍 Framework Tests ❌Some framework tests failed. Please check the details below: kungfumaster ❌This log was automatically created at 2026-09-04 11:27:15 UTC. |
08281df to
bfd183b
Compare
📁 Previous CI results (run #33868942637)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ✅There are no forbidden file changes. Nice 👍 Framework Tests ❌Some framework tests failed. Please check the details below: kungfumaster ❌This log was automatically created at 2026-09-04 11:37:13 UTC. |
bfd183b to
c5d9c7c
Compare
📁 Previous CI results (run #33869401076)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ✅There are no forbidden file changes. Nice 👍 Framework Tests ❌Some framework tests failed. Please check the details below: kungfumaster ❌This log was automatically created at 2026-09-04 11:43:23 UTC. |
c5d9c7c to
ee0cd37
Compare
📁 Previous CI results (run #33869856356)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ✅There are no forbidden file changes. Nice 👍 Framework Tests ❌Some framework tests failed. Please check the details below: kungfumaster ❌This log was automatically created at 2026-09-04 11:49:15 UTC. |
ee0cd37 to
9e238b1
Compare
📁 Previous CI results (run #33870310042)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ✅There are no forbidden file changes. Nice 👍 Framework Tests ❌Some framework tests failed. Please check the details below: kungfumaster ❌This log was automatically created at 2026-09-04 11:55:15 UTC. |
9e238b1 to
6dda1bb
Compare
📁 Previous CI results (run #33871880209)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ✅There are no forbidden file changes. Nice 👍 Framework Tests ❌Some framework tests failed. Please check the details below: kungfumaster ❌This log was automatically created at 2026-09-04 12:00:06 UTC. |
📁 Previous CI results (run #33874563897)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ✅There are no forbidden file changes. Nice 👍 Framework Tests ✅All framework tests passed. Good work! 🎉 This log was automatically created at 2026-09-04 12:20:19 UTC. |
📁 Previous CI results (run #33875178504)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ✅There are no forbidden file changes. Nice 👍 Framework Tests ❌Some framework tests failed. Please check the details below: kungfumaster ❌This log was automatically created at 2026-09-04 12:50:12 UTC. |
…inalize rendering styling
📁 Previous CI results (run #33879810242)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ✅There are no forbidden file changes. Nice 👍 Framework Tests ✅All framework tests passed. Good work! 🎉 This log was automatically created at 2026-09-04 12:59:00 UTC. |
📁 Previous CI results (run #33882739406)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ✅There are no forbidden file changes. Nice 👍 Framework Tests ❌Some framework tests failed. Please check the details below: kungfumaster ❌This log was automatically created at 2026-09-04 13:49:58 UTC. |
… downscaling hot-swap
📁 Previous CI results (run #34362818105)Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ✅There are no forbidden file changes. Nice 👍 Framework Tests ✅All framework tests passed. Good work! 🎉 This log was automatically created at 2026-09-04 14:21:08 UTC. |
Test ReportThis comment was generated automatically by a GitHub Action. It summarizes the test results for this pull request. The GitHub Action run can be found here: Base Branch ✅The PR's base branch is Changed Files ✅There are no forbidden file changes. Nice 👍 Framework Tests ✅All framework tests passed. Good work! 🎉 This log was automatically created at 2026-09-09 14:24:00 UTC. |
This pull request introduces the fully functional, JIT-compliant JAX environment and custom arcade fidelity renderer for Kung-Fu Master in JAXAtari, complete with 8 proposal-backed game modifications.
Key Features Implemented:
Environment Logic (
JaxKungFuMaster): Full state dynamics, physics, gravity, jump curves, and collision handling wrapped in JAX primitives.Enemy AI & Attack States: Implemented behaviors, timers, and hitboxes for all core enemies (Gripper, Knife Thrower, Tomtom, Dragon, Vase/Snake, Exploding Ball, and Floor Bosses).
High-Fidelity Renderer (
KungFuMasterRenderer): Replicated authentic Atari backdrop walls, striped pillars with red/yellow dashes, floor borders, and bottom ornamental brackets.Custom 5x7 bitmap font rendering for the score and timer.
Real-time dynamic health bars for both the player and active bosses.
Custom Game Modifications: Added logic flags supporting 5 simple modifications (No Knives, Double Speed, Infinite Energy, No Grabs, Mirror Player) and 3 complex modifications (Boss Rush, All Knife Floor, Reversed Floors).
Testing & Verification:
Passed smoke tests and VMAP batch consistency checks.
Verified execution performance and visual accuracy via interactive testing.