@playcraft/skills 0.0.2
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.
- package/README.md +333 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/skills.loader.d.ts +31 -0
- package/dist/src/skills.loader.d.ts.map +1 -0
- package/dist/src/skills.loader.js +200 -0
- package/dist/src/skills.loader.js.map +1 -0
- package/dist/src/skills.types.d.ts +44 -0
- package/dist/src/skills.types.d.ts.map +1 -0
- package/dist/src/skills.types.js +9 -0
- package/dist/src/skills.types.js.map +1 -0
- package/package.json +35 -0
- package/skills/2048_core.aigameplay/SKILL.md +123 -0
- package/skills/2048_core.aigameplay/manifest.json +159 -0
- package/skills/2048_core.aigameplay/ref/pgs-schema.json +194 -0
- package/skills/2048_core.aigameplay/ref/reducer.template.ts +189 -0
- package/skills/SKILL.md +46 -0
- package/skills/ad_compliance_rules.aiconfig/SKILL.md +85 -0
- package/skills/ad_compliance_rules.aiconfig/manifest.json +60 -0
- package/skills/agent_remix_orchestrator.aicomponent/SKILL.md +257 -0
- package/skills/agent_remix_orchestrator.aicomponent/manifest.json +12 -0
- package/skills/app_metadata.aiconfig/SKILL.md +53 -0
- package/skills/app_metadata.aiconfig/manifest.json +32 -0
- package/skills/appear_sfx.aiaudio/SKILL.md +59 -0
- package/skills/appear_sfx.aiaudio/manifest.json +45 -0
- package/skills/appear_sfx.aiaudio/ref/appear.mp3 +0 -0
- package/skills/arrow_move_error_sfx.aiaudio/SKILL.md +59 -0
- package/skills/arrow_move_error_sfx.aiaudio/manifest.json +45 -0
- package/skills/arrow_move_error_sfx.aiaudio/ref/arrow_move_error.mp3 +0 -0
- package/skills/arrow_path_data_format.aicomponent/SKILL.md +152 -0
- package/skills/arrow_path_data_format.aicomponent/manifest.json +57 -0
- package/skills/arrow_path_data_format.aicomponent/ref/LevelParser.ts +188 -0
- package/skills/arrow_path_data_format.aicomponent/ref/LevelTypes.ts +131 -0
- package/skills/arrow_pick_match_rules.aigameplay/SKILL.md +117 -0
- package/skills/arrow_pick_match_rules.aigameplay/manifest.json +105 -0
- package/skills/arrow_pick_match_rules.aigameplay/ref/pgs-schema.json +180 -0
- package/skills/asset_pipeline_scripts.aicomponent/SKILL.md +117 -0
- package/skills/asset_pipeline_scripts.aicomponent/manifest.json +17 -0
- package/skills/asset_pipeline_scripts.aicomponent/ref/gen-sprite.sh +105 -0
- package/skills/ball_sort.aigameplay/SKILL.md +109 -0
- package/skills/ball_sort.aigameplay/manifest.json +155 -0
- package/skills/ball_sort.aigameplay/ref/pgs-schema.json +192 -0
- package/skills/ball_sort.aigameplay/ref/reducer.template.ts +156 -0
- package/skills/basketball_shot.aigameplay/SKILL.md +94 -0
- package/skills/basketball_shot.aigameplay/manifest.json +150 -0
- package/skills/basketball_shot.aigameplay/ref/pgs-schema.json +229 -0
- package/skills/basketball_shot.aigameplay/ref/reducer.template.ts +189 -0
- package/skills/bg_music.aiaudio/SKILL.md +61 -0
- package/skills/bg_music.aiaudio/manifest.json +48 -0
- package/skills/bg_music.aiaudio/ref/bg.mp3 +0 -0
- package/skills/big_watermelon.aigameplay/SKILL.md +94 -0
- package/skills/big_watermelon.aigameplay/manifest.json +155 -0
- package/skills/big_watermelon.aigameplay/ref/pgs-schema.json +191 -0
- package/skills/big_watermelon.aigameplay/ref/reducer.template.ts +202 -0
- package/skills/block_puzzle.aigameplay/SKILL.md +121 -0
- package/skills/block_puzzle.aigameplay/manifest.json +154 -0
- package/skills/block_puzzle.aigameplay/ref/pgs-schema.json +170 -0
- package/skills/block_puzzle.aigameplay/ref/reducer.template.ts +182 -0
- package/skills/board_entity_sprite.aiimage/SKILL.md +255 -0
- package/skills/board_entity_sprite.aiimage/manifest.json +153 -0
- package/skills/board_entity_sprite.aiimage/ref/ProceduralCar.ts +357 -0
- package/skills/board_entity_sprite.aiimage/ref/car.png +0 -0
- package/skills/board_entity_sprite.aiimage/ref/car.webp +0 -0
- package/skills/bottom_ui_bar.aicomponent/SKILL.md +50 -0
- package/skills/bottom_ui_bar.aicomponent/manifest.json +31 -0
- package/skills/bottom_ui_bar.aicomponent/ref/GameBottomUI.ts +27 -0
- package/skills/bubble_shooter.aigameplay/SKILL.md +129 -0
- package/skills/bubble_shooter.aigameplay/manifest.json +181 -0
- package/skills/bubble_shooter.aigameplay/ref/pgs-schema.json +226 -0
- package/skills/bubble_shooter.aigameplay/ref/reducer.template.ts +228 -0
- package/skills/button_click_sfx.aiaudio/SKILL.md +59 -0
- package/skills/button_click_sfx.aiaudio/manifest.json +45 -0
- package/skills/button_click_sfx.aiaudio/ref/button_click.mp3 +0 -0
- package/skills/calm_piano.aiaudio/SKILL.md +68 -0
- package/skills/calm_piano.aiaudio/manifest.json +50 -0
- package/skills/camera_controller_3d.aicomponent/SKILL.md +100 -0
- package/skills/camera_controller_3d.aicomponent/manifest.json +52 -0
- package/skills/camera_controller_3d.aicomponent/ref/CameraController.ts +199 -0
- package/skills/camera_controller_3d.aicomponent/ref/OrbitControlsAdapter.ts +152 -0
- package/skills/candy_tile.aiimage/SKILL.md +62 -0
- package/skills/candy_tile.aiimage/manifest.json +49 -0
- package/skills/car_parking.aigameplay/SKILL.md +105 -0
- package/skills/car_parking.aigameplay/manifest.json +164 -0
- package/skills/car_parking.aigameplay/ref/pgs-schema.json +163 -0
- package/skills/car_parking.aigameplay/ref/reducer.template.ts +166 -0
- package/skills/castle.aiimage/SKILL.md +64 -0
- package/skills/castle.aiimage/manifest.json +48 -0
- package/skills/cheerful_ukulele.aiaudio/SKILL.md +72 -0
- package/skills/cheerful_ukulele.aiaudio/manifest.json +50 -0
- package/skills/click_sfx.aiaudio/SKILL.md +59 -0
- package/skills/click_sfx.aiaudio/manifest.json +45 -0
- package/skills/click_sfx.aiaudio/ref/click.mp3 +0 -0
- package/skills/combo_display.aicomponent/SKILL.md +45 -0
- package/skills/combo_display.aicomponent/manifest.json +31 -0
- package/skills/combo_display.aicomponent/ref/ComboManager.ts +362 -0
- package/skills/combo_display.aicomponent/ref/ComboSmallUI.ts +232 -0
- package/skills/combo_praise_text.aicomponent/SKILL.md +56 -0
- package/skills/combo_praise_text.aicomponent/manifest.json +34 -0
- package/skills/combo_praise_text.aicomponent/ref/ComboManager.ts +362 -0
- package/skills/countdown_timer.aicomponent/SKILL.md +44 -0
- package/skills/countdown_timer.aicomponent/manifest.json +35 -0
- package/skills/countdown_timer.aicomponent/ref/CountdownDisplay.ts +213 -0
- package/skills/cta_platform_config.aiconfig/SKILL.md +72 -0
- package/skills/cta_platform_config.aiconfig/manifest.json +56 -0
- package/skills/debug_overlay.aicomponent/SKILL.md +75 -0
- package/skills/debug_overlay.aicomponent/manifest.json +17 -0
- package/skills/debug_overlay.aicomponent/ref/DebugOverlay.ts +144 -0
- package/skills/desert.aiimage/SKILL.md +63 -0
- package/skills/desert.aiimage/manifest.json +49 -0
- package/skills/difficulty_curve_designer.aiconfig/SKILL.md +68 -0
- package/skills/difficulty_curve_designer.aiconfig/manifest.json +36 -0
- package/skills/digit_renderer.aicomponent/SKILL.md +43 -0
- package/skills/digit_renderer.aicomponent/manifest.json +25 -0
- package/skills/digit_renderer.aicomponent/ref/DigitRenderer.ts +237 -0
- package/skills/download_button.aicomponent/SKILL.md +44 -0
- package/skills/download_button.aicomponent/manifest.json +25 -0
- package/skills/download_button.aicomponent/ref/DownloadButton.ts +137 -0
- package/skills/draw_line_puzzle.aigameplay/SKILL.md +84 -0
- package/skills/draw_line_puzzle.aigameplay/manifest.json +152 -0
- package/skills/draw_line_puzzle.aigameplay/ref/pgs-schema.json +189 -0
- package/skills/draw_line_puzzle.aigameplay/ref/reducer.template.ts +194 -0
- package/skills/easy_to_hard.aiconfig/SKILL.md +52 -0
- package/skills/easy_to_hard.aiconfig/manifest.json +33 -0
- package/skills/eight_ball_pool.aigameplay/SKILL.md +104 -0
- package/skills/eight_ball_pool.aigameplay/manifest.json +152 -0
- package/skills/eight_ball_pool.aigameplay/ref/pgs-schema.json +205 -0
- package/skills/eight_ball_pool.aigameplay/ref/reducer.template.ts +198 -0
- package/skills/energetic_electronic.aiaudio/SKILL.md +69 -0
- package/skills/energetic_electronic.aiaudio/manifest.json +51 -0
- package/skills/fail_sfx.aiaudio/SKILL.md +59 -0
- package/skills/fail_sfx.aiaudio/manifest.json +44 -0
- package/skills/fail_sfx.aiaudio/ref/fail.mp3 +0 -0
- package/skills/figer_icon.aiimage/SKILL.md +58 -0
- package/skills/figer_icon.aiimage/manifest.json +48 -0
- package/skills/figer_icon.aiimage/ref/figer.png +0 -0
- package/skills/figer_icon.aiimage/ref/figer.webp +0 -0
- package/skills/forest.aiimage/SKILL.md +74 -0
- package/skills/forest.aiimage/manifest.json +48 -0
- package/skills/fruit_tile.aiimage/SKILL.md +68 -0
- package/skills/fruit_tile.aiimage/manifest.json +48 -0
- package/skills/game_over_panel.aicomponent/SKILL.md +47 -0
- package/skills/game_over_panel.aicomponent/manifest.json +61 -0
- package/skills/game_over_panel.aicomponent/ref/GameOverPanel.ts +74 -0
- package/skills/game_scene.aicomponent/SKILL.md +57 -0
- package/skills/game_scene.aicomponent/manifest.json +36 -0
- package/skills/game_scene.aicomponent/ref/Game.ts +748 -0
- package/skills/gameplay_balance_check.aivalidator/SKILL.md +69 -0
- package/skills/gameplay_balance_check.aivalidator/manifest.json +21 -0
- package/skills/gameplay_unit_test.aivalidator/SKILL.md +89 -0
- package/skills/gameplay_unit_test.aivalidator/manifest.json +17 -0
- package/skills/gameplay_unit_test.aivalidator/ref/gameplay.test.ts +202 -0
- package/skills/gameplay_unit_test.aivalidator/ref/vitest.config.ts +13 -0
- package/skills/grid_board_layout.aicomponent/SKILL.md +85 -0
- package/skills/grid_board_layout.aicomponent/manifest.json +69 -0
- package/skills/grid_board_layout.aicomponent/ref/BoardLayout.ts +416 -0
- package/skills/grid_board_layout.aicomponent/ref/BoardLayout3D.ts +125 -0
- package/skills/grid_board_layout.aicomponent/ref/BoardLayoutMath.ts +85 -0
- package/skills/grid_board_layout.aicomponent/ref/BoardRenderer3D.ts +298 -0
- package/skills/heart_lives.aicomponent/SKILL.md +42 -0
- package/skills/heart_lives.aicomponent/manifest.json +25 -0
- package/skills/heart_lives.aicomponent/ref/HeartDisplay.ts +96 -0
- package/skills/idle-breathe.aicomponent/SKILL.md +27 -0
- package/skills/idle-breathe.aicomponent/manifest.json +20 -0
- package/skills/idle-breathe.aicomponent/ref/phaser.js +25 -0
- package/skills/idle-breathe.aicomponent/ref/playcanvas.js +29 -0
- package/skills/jewel_tile.aiimage/SKILL.md +63 -0
- package/skills/jewel_tile.aiimage/manifest.json +49 -0
- package/skills/knife_hit.aigameplay/SKILL.md +103 -0
- package/skills/knife_hit.aigameplay/manifest.json +151 -0
- package/skills/knife_hit.aigameplay/ref/pgs-schema.json +202 -0
- package/skills/knife_hit.aigameplay/ref/reducer.template.ts +196 -0
- package/skills/left_right_parkour.aigameplay/SKILL.md +120 -0
- package/skills/left_right_parkour.aigameplay/manifest.json +165 -0
- package/skills/left_right_parkour.aigameplay/ref/pgs-schema.json +200 -0
- package/skills/left_right_parkour.aigameplay/ref/reducer.template.ts +194 -0
- package/skills/level_data_pack.aiconfig/SKILL.md +64 -0
- package/skills/level_data_pack.aiconfig/manifest.json +37 -0
- package/skills/level_data_validator.aivalidator/SKILL.md +85 -0
- package/skills/level_data_validator.aivalidator/manifest.json +17 -0
- package/skills/level_data_validator.aivalidator/ref/LevelValidator.ts +113 -0
- package/skills/level_lifecycle.aicomponent/SKILL.md +81 -0
- package/skills/level_lifecycle.aicomponent/manifest.json +87 -0
- package/skills/level_lifecycle.aicomponent/ref/LevelLifecycle.ts +235 -0
- package/skills/level_solvability_validator.aivalidator/SKILL.md +74 -0
- package/skills/level_solvability_validator.aivalidator/manifest.json +23 -0
- package/skills/level_solvability_validator.aivalidator/ref/LevelValidator.ts +186 -0
- package/skills/level_state.aicomponent/SKILL.md +55 -0
- package/skills/level_state.aicomponent/manifest.json +34 -0
- package/skills/level_state.aicomponent/ref/LevelDataManager.ts +26 -0
- package/skills/level_state.aicomponent/ref/LevelManager.ts +26 -0
- package/skills/loading_screen.aicomponent/SKILL.md +57 -0
- package/skills/loading_screen.aicomponent/manifest.json +43 -0
- package/skills/loading_screen.aicomponent/ref/LoadingUI.ts +339 -0
- package/skills/lose_result_panel.aiimage/SKILL.md +58 -0
- package/skills/lose_result_panel.aiimage/manifest.json +47 -0
- package/skills/lose_result_panel.aiimage/ref/lose.png +0 -0
- package/skills/lose_result_panel.aiimage/ref/lose.webp +0 -0
- package/skills/lose_sfx.aiaudio/SKILL.md +59 -0
- package/skills/lose_sfx.aiaudio/manifest.json +45 -0
- package/skills/lose_sfx.aiaudio/ref/lose.mp3 +0 -0
- package/skills/match-pop.aicomponent/SKILL.md +29 -0
- package/skills/match-pop.aicomponent/manifest.json +19 -0
- package/skills/match-pop.aicomponent/ref/phaser.js +30 -0
- package/skills/match-pop.aicomponent/ref/playcanvas.js +22 -0
- package/skills/match3_core.aigameplay/SKILL.md +125 -0
- package/skills/match3_core.aigameplay/manifest.json +107 -0
- package/skills/match3_core.aigameplay/ref/pgs-schema.json +154 -0
- package/skills/match3_core.aigameplay/ref/reducer.template.ts +191 -0
- package/skills/match_engine.aicomponent/SKILL.md +84 -0
- package/skills/match_engine.aicomponent/manifest.json +23 -0
- package/skills/match_engine.aicomponent/ref/MatchEngine.ts +75 -0
- package/skills/memory_match.aigameplay/SKILL.md +111 -0
- package/skills/memory_match.aigameplay/manifest.json +164 -0
- package/skills/memory_match.aigameplay/ref/pgs-schema.json +190 -0
- package/skills/memory_match.aigameplay/ref/reducer.template.ts +162 -0
- package/skills/merge_core.aigameplay/SKILL.md +112 -0
- package/skills/merge_core.aigameplay/manifest.json +154 -0
- package/skills/merge_core.aigameplay/ref/pgs-schema.json +202 -0
- package/skills/merge_core.aigameplay/ref/reducer.template.ts +179 -0
- package/skills/mistake_sfx.aiaudio/SKILL.md +59 -0
- package/skills/mistake_sfx.aiaudio/manifest.json +45 -0
- package/skills/mistake_sfx.aiaudio/ref/mistake.mp3 +0 -0
- package/skills/nomove_hint_overlay.aiimage/SKILL.md +58 -0
- package/skills/nomove_hint_overlay.aiimage/manifest.json +48 -0
- package/skills/nomove_hint_overlay.aiimage/ref/nomove_hint.png +0 -0
- package/skills/nomove_hint_overlay.aiimage/ref/nomove_hint.webp +0 -0
- package/skills/normal_dot.aiimage/SKILL.md +58 -0
- package/skills/normal_dot.aiimage/manifest.json +46 -0
- package/skills/normal_dot.aiimage/ref/normal_dot.png +0 -0
- package/skills/normal_dot.aiimage/ref/normal_dot.webp +0 -0
- package/skills/ocean.aiimage/SKILL.md +71 -0
- package/skills/ocean.aiimage/manifest.json +49 -0
- package/skills/particle-confetti.aicomponent/SKILL.md +32 -0
- package/skills/particle-confetti.aicomponent/manifest.json +21 -0
- package/skills/particle-confetti.aicomponent/ref/html5-spritesheet.js +17 -0
- package/skills/particle-confetti.aicomponent/ref/phaser.js +38 -0
- package/skills/particle-explosion.aicomponent/SKILL.md +37 -0
- package/skills/particle-explosion.aicomponent/manifest.json +24 -0
- package/skills/particle-explosion.aicomponent/ref/html5-spritesheet.js +40 -0
- package/skills/particle-explosion.aicomponent/ref/phaser.js +46 -0
- package/skills/particle-explosion.aicomponent/ref/playcanvas.js +33 -0
- package/skills/particle-trail.aicomponent/SKILL.md +25 -0
- package/skills/particle-trail.aicomponent/manifest.json +22 -0
- package/skills/particle-trail.aicomponent/ref/phaser.js +31 -0
- package/skills/path_animation.aicomponent/SKILL.md +82 -0
- package/skills/path_animation.aicomponent/manifest.json +77 -0
- package/skills/path_animation.aicomponent/ref/AnimationManager.ts +694 -0
- package/skills/path_animation.aicomponent/ref/AnimationManager3D.ts +317 -0
- package/skills/path_elimination_rules.aigameplay/SKILL.md +88 -0
- package/skills/path_elimination_rules.aigameplay/manifest.json +119 -0
- package/skills/path_elimination_rules.aigameplay/ref/pgs-schema.json +227 -0
- package/skills/path_input_handler.aicomponent/SKILL.md +87 -0
- package/skills/path_input_handler.aicomponent/manifest.json +97 -0
- package/skills/path_input_handler.aicomponent/ref/InputHandler.ts +714 -0
- package/skills/path_input_handler.aicomponent/ref/InputHandler3D.ts +204 -0
- package/skills/path_renderer.aicomponent/SKILL.md +101 -0
- package/skills/path_renderer.aicomponent/manifest.json +69 -0
- package/skills/path_renderer.aicomponent/ref/PathRenderer.ts +509 -0
- package/skills/path_renderer.aicomponent/ref/PathRenderer3D.ts +176 -0
- package/skills/path_renderer.aicomponent/ref/PathRenderers.ts +640 -0
- package/skills/phaser.aicomponent/SKILL.md +315 -0
- package/skills/phaser.aicomponent/manifest.json +156 -0
- package/skills/phaser.aicomponent/ref/BootScene.ts +29 -0
- package/skills/phaser.aicomponent/ref/GameConfig.ts +29 -0
- package/skills/phaser.aicomponent/ref/GameScene.ts +88 -0
- package/skills/phaser.aicomponent/ref/PreloaderScene.ts +78 -0
- package/skills/phaser.aicomponent/ref/SceneKeys.ts +7 -0
- package/skills/phaser.aicomponent/ref/SoundUtils.ts +21 -0
- package/skills/phaser.aicomponent/ref/UiLayout.ts +74 -0
- package/skills/phaser.aicomponent/ref/globals.d.ts +52 -0
- package/skills/phaser.aicomponent/ref/index.css +40 -0
- package/skills/phaser.aicomponent/ref/index.html +14 -0
- package/skills/phaser.aicomponent/ref/index.ts +48 -0
- package/skills/phaser.aicomponent/ref/main.ts +16 -0
- package/skills/phaser.aicomponent/ref/package.json +22 -0
- package/skills/phaser.aicomponent/ref/tsconfig.json +25 -0
- package/skills/phaser.aicomponent/ref/webpack.config.js +57 -0
- package/skills/phaser_scene_lifecycle.aicomponent/SKILL.md +63 -0
- package/skills/phaser_scene_lifecycle.aicomponent/manifest.json +33 -0
- package/skills/pick_and_match_rules.aigameplay/SKILL.md +113 -0
- package/skills/pick_and_match_rules.aigameplay/manifest.json +121 -0
- package/skills/pick_and_match_rules.aigameplay/ref/pgs-schema.json +354 -0
- package/skills/pin_pull.aigameplay/SKILL.md +110 -0
- package/skills/pin_pull.aigameplay/manifest.json +164 -0
- package/skills/pin_pull.aigameplay/ref/pgs-schema.json +201 -0
- package/skills/pin_pull.aigameplay/ref/reducer.template.ts +216 -0
- package/skills/playable_app_logo.aiimage/SKILL.md +58 -0
- package/skills/playable_app_logo.aiimage/manifest.json +47 -0
- package/skills/playable_app_logo.aiimage/ref/logo.png +0 -0
- package/skills/playable_app_logo.aiimage/ref/logo.webp +0 -0
- package/skills/playable_end_screen_layout.aicomponent/SKILL.md +75 -0
- package/skills/playable_end_screen_layout.aicomponent/manifest.json +24 -0
- package/skills/playable_guidance_layer.aicomponent/SKILL.md +89 -0
- package/skills/playable_guidance_layer.aicomponent/manifest.json +24 -0
- package/skills/playable_hud_layout.aicomponent/SKILL.md +96 -0
- package/skills/playable_hud_layout.aicomponent/manifest.json +24 -0
- package/skills/playable_scripts_build.aicomponent/SKILL.md +69 -0
- package/skills/playable_scripts_build.aicomponent/manifest.json +53 -0
- package/skills/playable_scripts_build.aicomponent/ref/builds.config.js +257 -0
- package/skills/playcraft-3d-flip-sprite/SKILL.md +336 -0
- package/skills/playcraft-3d-flip-sprite/renderer/flatten_glb.mjs +62 -0
- package/skills/playcraft-3d-flip-sprite/renderer/render.mjs +325 -0
- package/skills/playcraft-3d-flip-sprite/renderer/render_single.mjs +138 -0
- package/skills/playcraft-asset-management/SKILL.md +73 -0
- package/skills/playcraft-audio-generation/SKILL.md +126 -0
- package/skills/playcraft-build/SKILL.md +44 -0
- package/skills/playcraft-code-editor/SKILL.md +71 -0
- package/skills/playcraft-create-remix/SKILL.md +62 -0
- package/skills/playcraft-deploy/SKILL.md +59 -0
- package/skills/playcraft-image-generation/SKILL.md +148 -0
- package/skills/playcraft-image-processing/SKILL.md +216 -0
- package/skills/playcraft-platform-intro/SKILL.md +41 -0
- package/skills/playcraft-prefab/SKILL.md +98 -0
- package/skills/playcraft-project-management/SKILL.md +57 -0
- package/skills/playcraft-remix-workflow/SKILL.md +119 -0
- package/skills/playcraft-remix-workflow/references/xplatform.schema.json5 +31 -0
- package/skills/playcraft-save/SKILL.md +46 -0
- package/skills/playcraft-skill-recommender/SKILL.md +152 -0
- package/skills/playcraft-sprite-generation/SKILL.md +534 -0
- package/skills/playcraft-sprite-remix/SKILL.md +155 -0
- package/skills/playcraft-sprite-sheet/SKILL.md +97 -0
- package/skills/playtest_report.aivalidator/SKILL.md +103 -0
- package/skills/playtest_report.aivalidator/manifest.json +21 -0
- package/skills/preloader_scene.aicomponent/SKILL.md +58 -0
- package/skills/preloader_scene.aicomponent/manifest.json +43 -0
- package/skills/preloader_scene.aicomponent/ref/Preloader.ts +339 -0
- package/skills/progress_bar.aicomponent/SKILL.md +38 -0
- package/skills/progress_bar.aicomponent/manifest.json +25 -0
- package/skills/progress_bar.aicomponent/ref/ProgressDisplay.ts +140 -0
- package/skills/references/xplatform.schema.json5 +31 -0
- package/skills/responsive_2d_layout.aicomponent/SKILL.md +161 -0
- package/skills/responsive_2d_layout.aicomponent/manifest.json +43 -0
- package/skills/responsive_2d_layout.aicomponent/ref/UiLayout.ts +56 -0
- package/skills/run_context_state.aicomponent/SKILL.md +54 -0
- package/skills/run_context_state.aicomponent/manifest.json +40 -0
- package/skills/run_context_state.aicomponent/ref/RunContextRuntime.ts +30 -0
- package/skills/score-fly.aicomponent/SKILL.md +31 -0
- package/skills/score-fly.aicomponent/manifest.json +21 -0
- package/skills/score-fly.aicomponent/ref/phaser.js +26 -0
- package/skills/score-fly.aicomponent/ref/playcanvas.js +28 -0
- package/skills/score_goal.aiconfig/SKILL.md +46 -0
- package/skills/score_goal.aiconfig/manifest.json +33 -0
- package/skills/screen-flash.aicomponent/SKILL.md +30 -0
- package/skills/screen-flash.aicomponent/manifest.json +20 -0
- package/skills/screen-flash.aicomponent/ref/phaser.js +48 -0
- package/skills/screen-shake.aicomponent/SKILL.md +30 -0
- package/skills/screen-shake.aicomponent/manifest.json +19 -0
- package/skills/screen-shake.aicomponent/ref/phaser.js +23 -0
- package/skills/screen-shake.aicomponent/ref/playcanvas.js +44 -0
- package/skills/screw_puzzle.aigameplay/SKILL.md +116 -0
- package/skills/screw_puzzle.aigameplay/manifest.json +164 -0
- package/skills/screw_puzzle.aigameplay/ref/pgs-schema.json +235 -0
- package/skills/screw_puzzle.aigameplay/ref/reducer.template.ts +213 -0
- package/skills/settings_state.aicomponent/SKILL.md +61 -0
- package/skills/settings_state.aicomponent/manifest.json +33 -0
- package/skills/settings_state.aicomponent/ref/SettingsManager.ts +130 -0
- package/skills/slide_out_to_tray_animation.aicomponent/SKILL.md +64 -0
- package/skills/slide_out_to_tray_animation.aicomponent/manifest.json +58 -0
- package/skills/slide_out_to_tray_animation.aicomponent/ref/AnimationManager.ts +164 -0
- package/skills/slide_out_to_tray_animation.aicomponent/ref/AnimationManager3D.ts +198 -0
- package/skills/slide_out_to_tray_animation.aicomponent/ref/BezierUtils.ts +59 -0
- package/skills/slot_machine.aigameplay/SKILL.md +119 -0
- package/skills/slot_machine.aigameplay/manifest.json +166 -0
- package/skills/slot_machine.aigameplay/ref/pgs-schema.json +212 -0
- package/skills/slot_machine.aigameplay/ref/reducer.template.ts +212 -0
- package/skills/sniper_shot.aigameplay/SKILL.md +84 -0
- package/skills/sniper_shot.aigameplay/manifest.json +153 -0
- package/skills/sniper_shot.aigameplay/ref/pgs-schema.json +211 -0
- package/skills/sniper_shot.aigameplay/ref/reducer.template.ts +211 -0
- package/skills/solitaire.aigameplay/SKILL.md +101 -0
- package/skills/solitaire.aigameplay/manifest.json +151 -0
- package/skills/solitaire.aigameplay/ref/pgs-schema.json +200 -0
- package/skills/solitaire.aigameplay/ref/reducer.template.ts +176 -0
- package/skills/sound-effects/SKILL.md +46 -0
- package/skills/sound_utils.aicomponent/SKILL.md +52 -0
- package/skills/sound_utils.aicomponent/manifest.json +30 -0
- package/skills/sound_utils.aicomponent/ref/SoundUtils.ts +29 -0
- package/skills/sprite-animation-2d.aicomponent/SKILL.md +45 -0
- package/skills/sprite-animation-2d.aicomponent/manifest.json +28 -0
- package/skills/sprite-animation-2d.aicomponent/ref/html5.js +83 -0
- package/skills/sprite-animation-2d.aicomponent/ref/phaser.js +38 -0
- package/skills/sprite-animation-2d.aicomponent/ref/playcanvas.js +67 -0
- package/skills/sprite_entity_renderer.aicomponent/SKILL.md +148 -0
- package/skills/sprite_entity_renderer.aicomponent/manifest.json +17 -0
- package/skills/sprite_entity_renderer.aicomponent/ref/SpriteEntityRenderer.ts +126 -0
- package/skills/success_sfx.aiaudio/SKILL.md +59 -0
- package/skills/success_sfx.aiaudio/manifest.json +45 -0
- package/skills/success_sfx.aiaudio/ref/success.mp3 +0 -0
- package/skills/tap_blast.aigameplay/SKILL.md +116 -0
- package/skills/tap_blast.aigameplay/manifest.json +153 -0
- package/skills/tap_blast.aigameplay/ref/pgs-schema.json +208 -0
- package/skills/tap_blast.aigameplay/ref/reducer.template.ts +202 -0
- package/skills/theme_state.aicomponent/SKILL.md +53 -0
- package/skills/theme_state.aicomponent/manifest.json +33 -0
- package/skills/theme_state.aicomponent/ref/ThemeManager.ts +174 -0
- package/skills/theme_switcher_build.aicomponent/SKILL.md +62 -0
- package/skills/theme_switcher_build.aicomponent/manifest.json +38 -0
- package/skills/theme_switcher_build.aicomponent/ref/theme-index.ts +8 -0
- package/skills/theme_variant.aiconfig/SKILL.md +78 -0
- package/skills/theme_variant.aiconfig/manifest.json +39 -0
- package/skills/theme_variant.aiconfig/ref/ExampleTheme/index.ts +16 -0
- package/skills/theme_variant.aiconfig/ref/ExampleTheme/levelEasy.json +141 -0
- package/skills/threejs.aicomponent/SKILL.md +422 -0
- package/skills/threejs.aicomponent/manifest.json +166 -0
- package/skills/threejs.aicomponent/ref/AssetLoader.ts +158 -0
- package/skills/threejs.aicomponent/ref/BaseScene.ts +88 -0
- package/skills/threejs.aicomponent/ref/GameConfig.ts +47 -0
- package/skills/threejs.aicomponent/ref/MainScene.ts +170 -0
- package/skills/threejs.aicomponent/ref/PreloaderScene.ts +93 -0
- package/skills/threejs.aicomponent/ref/SceneKeys.ts +6 -0
- package/skills/threejs.aicomponent/ref/SceneManager.ts +69 -0
- package/skills/threejs.aicomponent/ref/ViewportManager.ts +62 -0
- package/skills/threejs.aicomponent/ref/globals.d.ts +74 -0
- package/skills/threejs.aicomponent/ref/index.css +80 -0
- package/skills/threejs.aicomponent/ref/index.html +20 -0
- package/skills/threejs.aicomponent/ref/index.ts +117 -0
- package/skills/threejs.aicomponent/ref/main.ts +10 -0
- package/skills/threejs.aicomponent/ref/package.json +23 -0
- package/skills/threejs.aicomponent/ref/tsconfig.json +24 -0
- package/skills/threejs.aicomponent/ref/webpack.config.js +61 -0
- package/skills/time_clear_goal.aiconfig/SKILL.md +46 -0
- package/skills/time_clear_goal.aiconfig/manifest.json +32 -0
- package/skills/time_icon.aiimage/SKILL.md +58 -0
- package/skills/time_icon.aiimage/manifest.json +47 -0
- package/skills/time_icon.aiimage/ref/time.png +0 -0
- package/skills/time_icon.aiimage/ref/time.webp +0 -0
- package/skills/top_ui_bar.aicomponent/SKILL.md +45 -0
- package/skills/top_ui_bar.aicomponent/manifest.json +27 -0
- package/skills/top_ui_bar.aicomponent/ref/GameTopUI.ts +229 -0
- package/skills/tower_defence.aigameplay/SKILL.md +117 -0
- package/skills/tower_defence.aigameplay/manifest.json +175 -0
- package/skills/tower_defence.aigameplay/ref/pgs-schema.json +247 -0
- package/skills/tower_defence.aigameplay/ref/reducer.template.ts +239 -0
- package/skills/tray_container.aicomponent/SKILL.md +143 -0
- package/skills/tray_container.aicomponent/manifest.json +58 -0
- package/skills/tray_container.aicomponent/ref/TrayRenderer.ts +155 -0
- package/skills/tray_container.aicomponent/ref/TrayRenderer3D.ts +281 -0
- package/skills/tray_container.aicomponent/ref/TrayRendererHtmlOverlay.ts +228 -0
- package/skills/tutorial_overlay.aicomponent/SKILL.md +46 -0
- package/skills/tutorial_overlay.aicomponent/manifest.json +34 -0
- package/skills/tutorial_overlay.aicomponent/ref/TutorialManager.ts +367 -0
- package/skills/tween-animation-2d.aicomponent/SKILL.md +35 -0
- package/skills/tween-animation-2d.aicomponent/manifest.json +28 -0
- package/skills/tween-animation-2d.aicomponent/ref/phaser.js +49 -0
- package/skills/tween-animation-2d.aicomponent/ref/playcanvas.js +36 -0
- package/skills/typescript_module_patterns.aicomponent/SKILL.md +209 -0
- package/skills/typescript_module_patterns.aicomponent/manifest.json +28 -0
- package/skills/typescript_module_patterns.aicomponent/ref/globals.d.ts +31 -0
- package/skills/ui-transition.aicomponent/SKILL.md +33 -0
- package/skills/ui-transition.aicomponent/manifest.json +19 -0
- package/skills/ui-transition.aicomponent/ref/phaser.js +45 -0
- package/skills/ux_flow_spec.aiconfig/SKILL.md +82 -0
- package/skills/ux_flow_spec.aiconfig/manifest.json +39 -0
- package/skills/wave_difficulty.aiconfig/SKILL.md +46 -0
- package/skills/wave_difficulty.aiconfig/manifest.json +33 -0
- package/skills/webpack_build.aicomponent/SKILL.md +204 -0
- package/skills/webpack_build.aicomponent/manifest.json +29 -0
- package/skills/webpack_build.aicomponent/ref/package.json +16 -0
- package/skills/webpack_build.aicomponent/ref/webpack.config.js +53 -0
- package/skills/win_anim_sfx.aiaudio/SKILL.md +59 -0
- package/skills/win_anim_sfx.aiaudio/manifest.json +46 -0
- package/skills/win_anim_sfx.aiaudio/ref/win_anim.mp3 +0 -0
- package/skills/win_dot.aiimage/SKILL.md +58 -0
- package/skills/win_dot.aiimage/manifest.json +47 -0
- package/skills/win_dot.aiimage/ref/win_dot.png +0 -0
- package/skills/win_dot.aiimage/ref/win_dot.webp +0 -0
- package/skills/win_result_panel.aiimage/SKILL.md +58 -0
- package/skills/win_result_panel.aiimage/manifest.json +47 -0
- package/skills/win_result_panel.aiimage/ref/win.png +0 -0
- package/skills/win_result_panel.aiimage/ref/win.webp +0 -0
- package/skills/word_connect.aigameplay/SKILL.md +86 -0
- package/skills/word_connect.aigameplay/manifest.json +154 -0
- package/skills/word_connect.aigameplay/ref/pgs-schema.json +212 -0
- package/skills/word_connect.aigameplay/ref/reducer.template.ts +186 -0
- package/src/index.ts +10 -0
- package/src/skills.loader.ts +225 -0
- package/src/skills.types.ts +42 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "PGS (PlayCraft Gameplay Schema) - 路径消除玩法(path_elimination)。棋盘上有若干彩色路径,每条路径末端有方向箭头。玩家点击箭头头部,路径沿箭头方向滑出棋盘即消除;若出口方向被其他路径占据则消除失败,扣一条命。全部路径消除则胜利。",
|
|
3
|
+
"version": "1.0",
|
|
4
|
+
"gameplayType": "path_elimination",
|
|
5
|
+
"entities": {
|
|
6
|
+
"grid": {
|
|
7
|
+
"type": "grid",
|
|
8
|
+
"rows": "dynamic (from level data, e.g. 8~14)",
|
|
9
|
+
"cols": "dynamic (from level data, e.g. 6~10)",
|
|
10
|
+
"description": "可变尺寸格子棋盘,尺寸由关卡数据决定"
|
|
11
|
+
},
|
|
12
|
+
"path": {
|
|
13
|
+
"type": "polyline",
|
|
14
|
+
"fields": {
|
|
15
|
+
"points": "GridPoint[] 路径经过的格子坐标序列(拐角点)",
|
|
16
|
+
"head": "GridPoint 箭头所在的末端格子(paths 数组最后一个点)",
|
|
17
|
+
"direction": "left | right | up | down 由路径末段方向推导",
|
|
18
|
+
"indices": "number[] 覆盖的所有格子的 row-major 索引",
|
|
19
|
+
"color": "string? 路径颜色(十六进制,如 '#ff0000')"
|
|
20
|
+
},
|
|
21
|
+
"state": "active | animating | eliminated",
|
|
22
|
+
"description": "棋盘上的一条彩色折线路径,末端有方向箭头。玩家点击箭头头部触发消除逻辑。"
|
|
23
|
+
},
|
|
24
|
+
"lives": {
|
|
25
|
+
"type": "counter",
|
|
26
|
+
"initial": "3 (可由主题配置覆盖)",
|
|
27
|
+
"description": "玩家剩余生命值。点击被阻挡的路径时扣 1 命。归零则触发游戏结束(失败)。"
|
|
28
|
+
},
|
|
29
|
+
"timer": {
|
|
30
|
+
"type": "countdown",
|
|
31
|
+
"initial": "levelTime 秒(来自关卡数据,0 表示无时限)",
|
|
32
|
+
"description": "可选倒计时。归零时触发游戏结束(失败)。"
|
|
33
|
+
},
|
|
34
|
+
"combo": {
|
|
35
|
+
"type": "streak",
|
|
36
|
+
"fields": {
|
|
37
|
+
"clickCount": "连续成功消除次数",
|
|
38
|
+
"chainWindowMs": "连击有效时间窗口(毫秒)",
|
|
39
|
+
"lastSuccessAtMs": "上一次成功消除的时间戳"
|
|
40
|
+
},
|
|
41
|
+
"description": "连击系统。在时间窗口内连续成功消除路径可触发连击表扬和奖励。"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"rules": {
|
|
45
|
+
"pathHitDetection": {
|
|
46
|
+
"description": "玩家点击棋盘某格子时,检查该格子是否是某条 active 路径的 head。命中则尝试消除该路径。",
|
|
47
|
+
"trigger": "pointer_down",
|
|
48
|
+
"hitRadius": "以格子中心为圆心,格子尺寸的一定比例(实现中由 InputHandler 决定)"
|
|
49
|
+
},
|
|
50
|
+
"pathElimination": {
|
|
51
|
+
"description": "尝试消除一条路径时:沿路径 direction 方向检查从 head 到棋盘边界的所有格子——若全部空闲(不被其他 active 路径的 indices 占据),则该路径成功消除(滑出动画后加入 removedPaths);否则消除失败(阻挡动画 + 扣命)。",
|
|
52
|
+
"steps": [
|
|
53
|
+
"1. 计算 head 位置在 direction 方向上,到棋盘边缘的所有格子坐标",
|
|
54
|
+
"2. 检查每个格子是否被其他 active 路径(非当前路径,非已消除路径)的 indices 占据",
|
|
55
|
+
"3. 若全部空闲 → 播放 animatePathOffBoard 动画 → 将 pathIndex 加入 removedPaths → 触发连击逻辑",
|
|
56
|
+
"4. 若被阻挡 → 播放 animateBlockedPath 动画 → 调用 loseLife() → 连击重置"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"winCondition": {
|
|
60
|
+
"description": "当 removedPaths.size >= level.paths.length 时,所有路径已消除,触发胜利流程。",
|
|
61
|
+
"trigger": "after_each_path_elimination",
|
|
62
|
+
"check": "removedPaths.size >= level.paths.length"
|
|
63
|
+
},
|
|
64
|
+
"loseCondition_noLives": {
|
|
65
|
+
"description": "lives 归零时触发失败流程(显示 GameOverPanel)。",
|
|
66
|
+
"trigger": "after_loseLife",
|
|
67
|
+
"check": "currentLives <= 0"
|
|
68
|
+
},
|
|
69
|
+
"loseCondition_timeout": {
|
|
70
|
+
"description": "倒计时归零时触发失败流程(仅当关卡有 levelTime > 0 时生效)。",
|
|
71
|
+
"trigger": "timer_expired",
|
|
72
|
+
"check": "levelTime > 0 && timer <= 0"
|
|
73
|
+
},
|
|
74
|
+
"comboChain": {
|
|
75
|
+
"description": "在 chainWindowMs 时间窗口内连续成功消除路径时,clickCount 递增,触发表扬文案(GOOD → NICE → GREAT → AWESOME → INCREDIBLE → LEGENDARY)。超出时间窗口后 clickCount 重置为 0。",
|
|
76
|
+
"trigger": "after_successful_elimination",
|
|
77
|
+
"chainWindowMs": 2000
|
|
78
|
+
},
|
|
79
|
+
"inputLock": {
|
|
80
|
+
"description": "路径动画播放期间、关卡胜负已定期间,输入被锁定(isInputLocked = true),防止误操作。"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"levelDataSchema": {
|
|
84
|
+
"description": "关卡数据使用 RawLevelJson 格式(来自 arrow_path_data_format.aicomponent 的 LevelTypes.ts)",
|
|
85
|
+
"format": {
|
|
86
|
+
"name": "number | string 关卡序号",
|
|
87
|
+
"row": "number 棋盘行数",
|
|
88
|
+
"col": "number 棋盘列数",
|
|
89
|
+
"arrows": "(number | string)[][][] 路径点数组(Cocos 格式,y 轴向上,LevelParser 负责转换)",
|
|
90
|
+
"levelTime": "number 关卡时限(秒,0 表示无时限)",
|
|
91
|
+
"background": "{ imageKey, dataUrl?, opacity? }? 可选背景图"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"algorithm": {
|
|
95
|
+
"description": "主循环:等待玩家点击 → 命中检测 → 消除检查 → 动画 → 胜负判断",
|
|
96
|
+
"steps": [
|
|
97
|
+
"1. 初始化:解析 RawLevelJson → ParsedLevel(坐标翻转 + 路径离散化)",
|
|
98
|
+
"2. 渲染棋盘:按 ParsedLevel.paths 绘制所有彩色路径和箭头头部",
|
|
99
|
+
"3. 等待玩家输入(点击/触摸棋盘)",
|
|
100
|
+
"4. 命中检测:定位点击格子 → 找到对应 active 路径(head 在该格子)",
|
|
101
|
+
"5. 消除检查:检查 direction 方向上是否有阻挡路径",
|
|
102
|
+
"6a. 无阻挡 → animatePathOffBoard → removedPaths.add → 连击处理",
|
|
103
|
+
"6b. 有阻挡 → animateBlockedPath → loseLife() → 连击重置",
|
|
104
|
+
"7. 胜负判断:removedPaths 全满 → 胜利;lives = 0 → 失败;timer = 0 → 失败",
|
|
105
|
+
"8. 胜利 → 下一关(或显示 GameOverPanel win),失败 → GameOverPanel lose"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"winCondition": {
|
|
109
|
+
"type": "all_paths_eliminated",
|
|
110
|
+
"description": "棋盘上所有路径都被消除(removedPaths.size >= level.paths.length)"
|
|
111
|
+
},
|
|
112
|
+
"loseConditions": [
|
|
113
|
+
{
|
|
114
|
+
"type": "no_lives",
|
|
115
|
+
"description": "生命值归零(currentLives <= 0)"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"type": "timeout",
|
|
119
|
+
"description": "倒计时归零(仅当 levelTime > 0)"
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
"testCases": [
|
|
123
|
+
{
|
|
124
|
+
"id": "tc_simple_elimination",
|
|
125
|
+
"description": "基础消除:单条路径向右,出口方向空闲,点击头部后成功消除",
|
|
126
|
+
"initialState": {
|
|
127
|
+
"grid": "4×1",
|
|
128
|
+
"paths": [
|
|
129
|
+
{ "points": [[0,0],[1,0],[2,0]], "head": [2,0], "direction": "right" }
|
|
130
|
+
],
|
|
131
|
+
"lives": 3
|
|
132
|
+
},
|
|
133
|
+
"actions": [
|
|
134
|
+
{ "type": "clickCell", "col": 2, "row": 0 }
|
|
135
|
+
],
|
|
136
|
+
"expectedState": {
|
|
137
|
+
"removedPaths": [0],
|
|
138
|
+
"lives": 3,
|
|
139
|
+
"gameOver": false
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"id": "tc_blocked_path",
|
|
144
|
+
"description": "阻挡:路径 A 向右,路径 B 横在 A 的出口方向上,点击 A 头部失败并扣命",
|
|
145
|
+
"initialState": {
|
|
146
|
+
"grid": "5×3",
|
|
147
|
+
"paths": [
|
|
148
|
+
{ "points": [[0,1],[1,1],[2,1]], "head": [2,1], "direction": "right" },
|
|
149
|
+
{ "points": [[4,0],[4,1],[4,2]], "head": [4,2], "direction": "down" }
|
|
150
|
+
],
|
|
151
|
+
"lives": 3
|
|
152
|
+
},
|
|
153
|
+
"actions": [
|
|
154
|
+
{ "type": "clickCell", "col": 2, "row": 1 }
|
|
155
|
+
],
|
|
156
|
+
"expectedState": {
|
|
157
|
+
"removedPaths": [],
|
|
158
|
+
"lives": 2,
|
|
159
|
+
"gameOver": false
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"id": "tc_win",
|
|
164
|
+
"description": "通关:消除最后一条路径后触发胜利",
|
|
165
|
+
"initialState": {
|
|
166
|
+
"grid": "3×1",
|
|
167
|
+
"paths": [
|
|
168
|
+
{ "points": [[0,0],[1,0]], "head": [1,0], "direction": "right" }
|
|
169
|
+
],
|
|
170
|
+
"lives": 3
|
|
171
|
+
},
|
|
172
|
+
"actions": [
|
|
173
|
+
{ "type": "clickCell", "col": 1, "row": 0 }
|
|
174
|
+
],
|
|
175
|
+
"expectedState": {
|
|
176
|
+
"removedPaths": [0],
|
|
177
|
+
"allPathsEliminated": true,
|
|
178
|
+
"win": true,
|
|
179
|
+
"gameOver": true
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"id": "tc_lose_no_lives",
|
|
184
|
+
"description": "失败:只剩 1 命,点击阻挡路径后命归零触发失败",
|
|
185
|
+
"initialState": {
|
|
186
|
+
"grid": "4×2",
|
|
187
|
+
"paths": [
|
|
188
|
+
{ "points": [[0,0],[1,0]], "head": [1,0], "direction": "right" },
|
|
189
|
+
{ "points": [[3,0],[3,1]], "head": [3,1], "direction": "down" }
|
|
190
|
+
],
|
|
191
|
+
"lives": 1
|
|
192
|
+
},
|
|
193
|
+
"actions": [
|
|
194
|
+
{ "type": "clickCell", "col": 1, "row": 0 }
|
|
195
|
+
],
|
|
196
|
+
"expectedState": {
|
|
197
|
+
"removedPaths": [],
|
|
198
|
+
"lives": 0,
|
|
199
|
+
"win": false,
|
|
200
|
+
"gameOver": true
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"id": "tc_combo",
|
|
205
|
+
"description": "连击:在时间窗口内连续成功消除 3 条路径,clickCount 递增",
|
|
206
|
+
"initialState": {
|
|
207
|
+
"grid": "4×3",
|
|
208
|
+
"paths": [
|
|
209
|
+
{ "points": [[0,0],[1,0]], "head": [1,0], "direction": "right" },
|
|
210
|
+
{ "points": [[0,1],[1,1]], "head": [1,1], "direction": "right" },
|
|
211
|
+
{ "points": [[0,2],[1,2]], "head": [1,2], "direction": "right" }
|
|
212
|
+
],
|
|
213
|
+
"lives": 3
|
|
214
|
+
},
|
|
215
|
+
"actions": [
|
|
216
|
+
{ "type": "clickCell", "col": 1, "row": 0, "delayAfterMs": 500 },
|
|
217
|
+
{ "type": "clickCell", "col": 1, "row": 1, "delayAfterMs": 500 },
|
|
218
|
+
{ "type": "clickCell", "col": 1, "row": 2 }
|
|
219
|
+
],
|
|
220
|
+
"expectedState": {
|
|
221
|
+
"removedPaths": [0, 1, 2],
|
|
222
|
+
"combo.clickCount": 3,
|
|
223
|
+
"win": true
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: path_input_handler.aicomponent
|
|
3
|
+
description: 路径消除玩法的棋盘输入处理器。处理点击命中路径头部的消除逻辑、单指拖拽棋盘、双指缩放,以及新手引导和连击系统的交互触发。
|
|
4
|
+
triggers: 需要处理玩家与路径消除棋盘的触摸/鼠标交互时触发。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 棋盘输入处理器(Board Input Handler)
|
|
8
|
+
|
|
9
|
+
## 说明
|
|
10
|
+
|
|
11
|
+
`InputHandler` 负责所有棋盘输入事件:
|
|
12
|
+
|
|
13
|
+
- **点击/点触路径头部**:命中检测 → `attemptMovePath()` → 消除成功或阻挡扣命
|
|
14
|
+
- **单指拖拽**:长按+移动时拖拽棋盘(边界约束)
|
|
15
|
+
- **双指缩放**:Pinch 手势缩放棋盘(最小/最大缩放限制)
|
|
16
|
+
- **鼠标滚轮**:缩放棋盘
|
|
17
|
+
- **连击触发**:成功消除路径时通知 `ComboManager`
|
|
18
|
+
- **引导系统**:一二关特殊引导逻辑的交互配合
|
|
19
|
+
|
|
20
|
+
## Scaffold
|
|
21
|
+
|
|
22
|
+
| 目标路径 | 来源 | 说明 |
|
|
23
|
+
|---------|-----|-----|
|
|
24
|
+
| `src/game/scenes/GameUI/InputHandler.ts` | `ref/InputHandler.ts` | 完整输入处理器实现 |
|
|
25
|
+
|
|
26
|
+
## Imports
|
|
27
|
+
|
|
28
|
+
- `phaser.aicomponent`(硬依赖:Phaser 输入事件 API)
|
|
29
|
+
- `grid_board_layout.aicomponent`(硬依赖:棋盘格子坐标计算)
|
|
30
|
+
- `path_renderer.aicomponent`(硬依赖:路径绘制触发刷新)
|
|
31
|
+
|
|
32
|
+
## Skill Definition
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
tools:
|
|
36
|
+
- read_file
|
|
37
|
+
- write_file
|
|
38
|
+
inputs:
|
|
39
|
+
- source: src/game/scenes/GameUI/InputHandler.ts
|
|
40
|
+
outputs:
|
|
41
|
+
- inputHandler: InputHandler class + InputGameRef interface
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## 关键接口
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
interface InputGameRef extends Phaser.Scene {
|
|
48
|
+
level: ParsedLevel | null;
|
|
49
|
+
removedPaths: Set<number>;
|
|
50
|
+
blockedPaths: Set<number>;
|
|
51
|
+
animatingPaths: Set<number>;
|
|
52
|
+
isInputLocked: boolean;
|
|
53
|
+
zoom: number; minZoom: number; maxZoom: number;
|
|
54
|
+
// ... 其他场景引用
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
class InputHandler {
|
|
58
|
+
bindEvents(): void; // 在 Scene.create() 末尾调用
|
|
59
|
+
resetState(): void; // 关卡重置时调用
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Recipe
|
|
64
|
+
|
|
65
|
+
| 决策 | 原因 |
|
|
66
|
+
|------|------|
|
|
67
|
+
| **InputGameRef 接口解耦** | InputHandler 通过接口而非具体 `Game` 类访问场景状态,避免与 GameScene 的强循环依赖;也便于测试时 mock 场景引用 |
|
|
68
|
+
| **输入与游戏状态分离** | InputHandler 负责"什么事件发生",具体的消除/扣命逻辑委托给接口方法(如 `attemptMovePath`);不直接写 `removedPaths` |
|
|
69
|
+
| **拖拽+缩放+点击三模式** | 试玩广告需支持触屏和鼠标;单指拖动、双指缩放、鼠标滚轮在同一 InputHandler 内统一处理,避免事件冲突 |
|
|
70
|
+
|
|
71
|
+
## Adapter
|
|
72
|
+
|
|
73
|
+
- **Role**: `boardInputHandler` — 棋盘触摸/鼠标输入处理器(点击消除 + 拖拽 + 缩放)
|
|
74
|
+
- **Provides**: `InputHandler` 类(`bindEvents()`、`resetState()`)、`InputGameRef` 接口
|
|
75
|
+
- **Requires**: `phaser.aicomponent`、`grid_board_layout.aicomponent`(格子坐标计算)、`path_renderer.aicomponent`(触发渲染刷新)
|
|
76
|
+
- **Consumed by**: `game_scene.aicomponent`(在 `create()` 中 `new InputHandler(this)` 并调用 `bindEvents()`)
|
|
77
|
+
- **Integration point**: `src/game/scenes/GameUI/InputHandler.ts` → `Game.ts` 的 `create()` 末尾
|
|
78
|
+
|
|
79
|
+
## 核心逻辑:attemptMovePath
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
1. 检查路径是否已消除或正在动画中 → 跳过
|
|
83
|
+
2. 计算路径 head 在 direction 上到边界的路径
|
|
84
|
+
3. 对路径上每个格子检查 isCellOccupiedByAnyPath()
|
|
85
|
+
4. 全部空闲 → animatePathOffBoard → removedPaths.add → 连击处理
|
|
86
|
+
5. 有阻挡 → animateBlockedPath → loseLife() → 连击重置
|
|
87
|
+
```
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "path_input_handler.aicomponent",
|
|
4
|
+
"bundleType": "aicomponent",
|
|
5
|
+
"category": "component",
|
|
6
|
+
"mode": "fixed",
|
|
7
|
+
"label": { "zh": "棋盘输入处理器", "en": "Board input handler" },
|
|
8
|
+
"tags": ["input", "touch", "drag", "zoom", "pinch", "hit-detection", "phaser", "board", "threejs", "raycaster", "3d"],
|
|
9
|
+
"bindingRoles": ["boardInputHandler"],
|
|
10
|
+
"hitDetection": ["2d-bounds", "3d-raycast"],
|
|
11
|
+
"engineVariants": {
|
|
12
|
+
"phaser": {
|
|
13
|
+
"imports": ["phaser.aicomponent"],
|
|
14
|
+
"scaffoldFiles": {
|
|
15
|
+
"src/game/scenes/GameUI/InputHandler.ts": { "source": "ref/InputHandler.ts", "mode": "full", "weight": 10 }
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"threejs": {
|
|
19
|
+
"imports": ["threejs.aicomponent"],
|
|
20
|
+
"scaffoldFiles": {
|
|
21
|
+
"src/game/ui/InputHandler3D.ts": { "source": "ref/InputHandler3D.ts", "mode": "full", "weight": 10 }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"scaffold": {
|
|
26
|
+
"files": {
|
|
27
|
+
"src/game/scenes/GameUI/InputHandler.ts": {
|
|
28
|
+
"source": "ref/InputHandler.ts",
|
|
29
|
+
"mode": "full",
|
|
30
|
+
"weight": 10
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"imports": [
|
|
35
|
+
{ "slot": "engine", "pinAtomId": "phaser.aicomponent", "edgeKind": "requires", "bindAs": "engine" },
|
|
36
|
+
{ "slot": "boardLayout", "pinAtomId": "grid_board_layout.aicomponent","edgeKind": "requires", "bindAs": "boardLayout" },
|
|
37
|
+
{ "slot": "renderer", "pinAtomId": "path_renderer.aicomponent", "edgeKind": "requires", "bindAs": "renderer" },
|
|
38
|
+
{
|
|
39
|
+
"slot": "sfxClick",
|
|
40
|
+
"description": "点击/选中路径头部音效",
|
|
41
|
+
"bindAs": "sfxClick",
|
|
42
|
+
"required": false,
|
|
43
|
+
"edgeKind": "compatibleWith",
|
|
44
|
+
"matchBindingRoles": ["sfxClick"],
|
|
45
|
+
"allowedBundleTypes": ["aiaudio"]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"slot": "sfxMistake",
|
|
49
|
+
"description": "操作错误/无效移动音效",
|
|
50
|
+
"bindAs": "sfxMistake",
|
|
51
|
+
"required": false,
|
|
52
|
+
"edgeKind": "compatibleWith",
|
|
53
|
+
"matchBindingRoles": ["sfxMistake"],
|
|
54
|
+
"allowedBundleTypes": ["aiaudio"]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"slot": "sfxArrowMoveError",
|
|
58
|
+
"description": "箭头移动错误音效",
|
|
59
|
+
"bindAs": "sfxArrowMoveError",
|
|
60
|
+
"required": false,
|
|
61
|
+
"edgeKind": "compatibleWith",
|
|
62
|
+
"matchBindingRoles": ["sfxArrowMoveError"],
|
|
63
|
+
"allowedBundleTypes": ["aiaudio"]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"slot": "sfxAppear",
|
|
67
|
+
"description": "新元素出现/弹出音效",
|
|
68
|
+
"bindAs": "sfxAppear",
|
|
69
|
+
"required": false,
|
|
70
|
+
"edgeKind": "compatibleWith",
|
|
71
|
+
"matchBindingRoles": ["sfxAppear"],
|
|
72
|
+
"allowedBundleTypes": ["aiaudio"]
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"exports": [
|
|
76
|
+
{ "name": "InputHandler", "kind": "class", "location": "src/game/scenes/GameUI/InputHandler.ts" },
|
|
77
|
+
{ "name": "InputGameRef", "kind": "interface", "location": "src/game/scenes/GameUI/InputHandler.ts" },
|
|
78
|
+
{ "name": "InputHandler3D", "kind": "class", "location": "src/game/ui/InputHandler3D.ts" },
|
|
79
|
+
{ "name": "HitResult", "kind": "interface", "location": "src/game/ui/InputHandler3D.ts" }
|
|
80
|
+
],
|
|
81
|
+
"neutralDescriptor": {
|
|
82
|
+
"geometry": "pointer event handler for a zoomable/pannable grid board with tap-to-select path heads and two-finger pinch zoom",
|
|
83
|
+
"layers": ["pointer-events", "hit-detection", "drag", "pinch-zoom"],
|
|
84
|
+
"replaceable": ["drag speed multiplier", "zoom range", "hit radius"]
|
|
85
|
+
},
|
|
86
|
+
"usageHints": [
|
|
87
|
+
"InputHandler.bindEvents() 在 Phaser Scene create() 中棋盘构建完成后调用",
|
|
88
|
+
"attemptMovePath() 是核心逻辑:命中路径头部 → 检查阻挡 → 触发消除或扣命",
|
|
89
|
+
"支持拖拽棋盘(单指长按 + 移动)和双指缩放",
|
|
90
|
+
"InputGameRef 接口定义了 InputHandler 所需的场景属性,避免循环依赖"
|
|
91
|
+
],
|
|
92
|
+
"files": {
|
|
93
|
+
"skill": "SKILL.md",
|
|
94
|
+
"inputHandler": "ref/InputHandler.ts",
|
|
95
|
+
"inputHandler3D": "ref/InputHandler3D.ts"
|
|
96
|
+
}
|
|
97
|
+
}
|