@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,151 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "solitaire.aigameplay",
|
|
4
|
+
"bundleType": "aigameplay",
|
|
5
|
+
"category": "gameplay",
|
|
6
|
+
"mode": "fixed",
|
|
7
|
+
"label": {
|
|
8
|
+
"zh": "纸牌接龙玩法",
|
|
9
|
+
"en": "Klondike Solitaire gameplay"
|
|
10
|
+
},
|
|
11
|
+
"tags": [
|
|
12
|
+
"gameplay",
|
|
13
|
+
"solitaire",
|
|
14
|
+
"cards",
|
|
15
|
+
"puzzle",
|
|
16
|
+
"klondike",
|
|
17
|
+
"casual"
|
|
18
|
+
],
|
|
19
|
+
"bindingRoles": [
|
|
20
|
+
"gameplayRule"
|
|
21
|
+
],
|
|
22
|
+
"imports": [
|
|
23
|
+
{
|
|
24
|
+
"slot": "engine",
|
|
25
|
+
"pinAtomId": "phaser.aicomponent",
|
|
26
|
+
"edgeKind": "requires",
|
|
27
|
+
"bindAs": "engine"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"slot": "bgMusic",
|
|
31
|
+
"description": "背景循环音乐",
|
|
32
|
+
"bindAs": "bgm",
|
|
33
|
+
"required": false,
|
|
34
|
+
"edgeKind": "compatibleWith",
|
|
35
|
+
"matchBindingRoles": [
|
|
36
|
+
"bgMusic"
|
|
37
|
+
],
|
|
38
|
+
"allowedBundleTypes": [
|
|
39
|
+
"aiaudio"
|
|
40
|
+
],
|
|
41
|
+
"constraints": {
|
|
42
|
+
"loop": true
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"slot": "cardSet",
|
|
47
|
+
"description": "扑克牌面贴图集",
|
|
48
|
+
"bindAs": "cards",
|
|
49
|
+
"required": false,
|
|
50
|
+
"edgeKind": "compatibleWith",
|
|
51
|
+
"matchBindingRoles": [
|
|
52
|
+
"tileTextureSet"
|
|
53
|
+
],
|
|
54
|
+
"allowedBundleTypes": [
|
|
55
|
+
"aiimage"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"slot": "tutorial",
|
|
60
|
+
"description": "新手引导浮层",
|
|
61
|
+
"bindAs": "tutorial",
|
|
62
|
+
"required": false,
|
|
63
|
+
"edgeKind": "compatibleWith",
|
|
64
|
+
"matchBindingRoles": [
|
|
65
|
+
"tutorialOverlay"
|
|
66
|
+
],
|
|
67
|
+
"allowedBundleTypes": [
|
|
68
|
+
"aicomponent"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"slot": "winPanel",
|
|
73
|
+
"description": "通关反馈面板视觉",
|
|
74
|
+
"bindAs": "winPanel",
|
|
75
|
+
"required": false,
|
|
76
|
+
"edgeKind": "compatibleWith",
|
|
77
|
+
"matchBindingRoles": [
|
|
78
|
+
"successFeedbackPanel"
|
|
79
|
+
],
|
|
80
|
+
"allowedBundleTypes": [
|
|
81
|
+
"aiimage"
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"slot": "losePanel",
|
|
86
|
+
"description": "失败反馈面板视觉",
|
|
87
|
+
"bindAs": "losePanel",
|
|
88
|
+
"required": false,
|
|
89
|
+
"edgeKind": "compatibleWith",
|
|
90
|
+
"matchBindingRoles": [
|
|
91
|
+
"failFeedbackPanel"
|
|
92
|
+
],
|
|
93
|
+
"allowedBundleTypes": [
|
|
94
|
+
"aiimage"
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"slot": "endScreen",
|
|
99
|
+
"description": "可玩广告结算屏(含 CTA 按钮)",
|
|
100
|
+
"bindAs": "endScreen",
|
|
101
|
+
"required": false,
|
|
102
|
+
"edgeKind": "compatibleWith",
|
|
103
|
+
"matchBindingRoles": [
|
|
104
|
+
"playableEndScreenLayout"
|
|
105
|
+
],
|
|
106
|
+
"allowedBundleTypes": [
|
|
107
|
+
"aicomponent"
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
"generation": {
|
|
112
|
+
"kind": "pgs",
|
|
113
|
+
"pgsVersion": "1.0",
|
|
114
|
+
"gameplayType": "solitaire",
|
|
115
|
+
"rules": {
|
|
116
|
+
"tableauColumns": 7,
|
|
117
|
+
"foundationPiles": 4,
|
|
118
|
+
"drawCount": 1,
|
|
119
|
+
"stockRecycleLimit": -1
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"result": {
|
|
123
|
+
"outputFile": "reducer.ts",
|
|
124
|
+
"format": "typescript",
|
|
125
|
+
"constraints": {
|
|
126
|
+
"testCasesMustPass": true
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"binding": {
|
|
130
|
+
"role": "gameplayRule",
|
|
131
|
+
"target": "game/gameplay/solitaire/reducer.ts",
|
|
132
|
+
"type": "gameplay-module-reference",
|
|
133
|
+
"constraints": {
|
|
134
|
+
"interface": [
|
|
135
|
+
"init(config)",
|
|
136
|
+
"dispatch(action)",
|
|
137
|
+
"getState()",
|
|
138
|
+
"canMoveToTableau(state, card, targetCol)",
|
|
139
|
+
"canMoveToFoundation(state, card)",
|
|
140
|
+
"moveCards(state, from, to, count)",
|
|
141
|
+
"drawFromStock(state)",
|
|
142
|
+
"getValidMoves(state)"
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"files": {
|
|
147
|
+
"skill": "SKILL.md",
|
|
148
|
+
"pgsSchema": "ref/pgs-schema.json",
|
|
149
|
+
"reducerTemplate": "ref/reducer.template.ts"
|
|
150
|
+
}
|
|
151
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "PGS (PlayCraft Gameplay Schema) 参考骨架 - Klondike 纸牌接龙。Agent 以此为起点编写或 fork 玩法规则。",
|
|
3
|
+
"version": "1.0",
|
|
4
|
+
"gameplayType": "solitaire",
|
|
5
|
+
"entities": {
|
|
6
|
+
"card": {
|
|
7
|
+
"type": "card-item",
|
|
8
|
+
"description": "扑克牌,52张标准牌",
|
|
9
|
+
"fields": {
|
|
10
|
+
"suit": { "type": "enum", "values": ["S", "H", "D", "C"], "description": "花色:S=黑桃,H=红心,D=方块,C=梅花" },
|
|
11
|
+
"value": { "type": "integer", "range": [1, 13], "description": "牌值:1=A,11=J,12=Q,13=K" },
|
|
12
|
+
"face_up": { "type": "boolean", "default": false, "description": "是否翻面(正面朝上)" },
|
|
13
|
+
"color": { "type": "enum", "values": ["red", "black"], "description": "红色=H/D,黑色=S/C" }
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"tableau": {
|
|
17
|
+
"type": "card-columns",
|
|
18
|
+
"description": "7列牌堆(主游戏区)",
|
|
19
|
+
"columns": 7,
|
|
20
|
+
"initialSetup": "第 i 列(1-indexed)有 i 张牌,最上面1张 face_up,其余 face_down"
|
|
21
|
+
},
|
|
22
|
+
"stock": {
|
|
23
|
+
"type": "card-pile",
|
|
24
|
+
"description": "备用牌堆(未翻开的剩余牌),点击翻牌到 waste",
|
|
25
|
+
"face_up": false
|
|
26
|
+
},
|
|
27
|
+
"waste": {
|
|
28
|
+
"type": "card-pile",
|
|
29
|
+
"description": "翻开的废牌堆,顶牌可用",
|
|
30
|
+
"face_up": true
|
|
31
|
+
},
|
|
32
|
+
"foundations": {
|
|
33
|
+
"type": "card-piles",
|
|
34
|
+
"description": "4个花色目标堆,目标是将所有牌按 A→K 移入",
|
|
35
|
+
"count": 4,
|
|
36
|
+
"suits": ["S", "H", "D", "C"],
|
|
37
|
+
"startValue": 1,
|
|
38
|
+
"endValue": 13
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"rules": {
|
|
42
|
+
"move_to_tableau": {
|
|
43
|
+
"description": "将牌(或牌组)移到另一列牌堆顶部",
|
|
44
|
+
"conditions": [
|
|
45
|
+
"目标列顶牌 face_up(或目标列为空)",
|
|
46
|
+
"移动牌颜色与目标列顶牌颜色不同(红↔黑)",
|
|
47
|
+
"移动牌的值 = 目标列顶牌值 - 1",
|
|
48
|
+
"空列只接受 K(value == 13)"
|
|
49
|
+
],
|
|
50
|
+
"group_move": "可以将一组连续的有效叠放牌(由顶部的某张 face_up 牌开始向下)一起移动"
|
|
51
|
+
},
|
|
52
|
+
"move_to_foundation": {
|
|
53
|
+
"description": "将牌移到对应花色的目标堆",
|
|
54
|
+
"conditions": [
|
|
55
|
+
"目标堆花色 == 移动牌花色",
|
|
56
|
+
"目标堆为空时只接受 A(value == 1)",
|
|
57
|
+
"移动牌值 = 目标堆当前顶牌值 + 1"
|
|
58
|
+
],
|
|
59
|
+
"note": "一次只能移动1张牌到目标堆"
|
|
60
|
+
},
|
|
61
|
+
"flip_tableau_top": {
|
|
62
|
+
"description": "移走某列顶牌后,若新的顶牌 face_down,则自动翻开",
|
|
63
|
+
"trigger": "after_move_from_tableau",
|
|
64
|
+
"effect": "new_top_card.face_up = true"
|
|
65
|
+
},
|
|
66
|
+
"draw_from_stock": {
|
|
67
|
+
"description": "从备用牌堆翻 1 张牌到 waste 堆(face_up)",
|
|
68
|
+
"trigger": "player_click_stock",
|
|
69
|
+
"drawCount": 1
|
|
70
|
+
},
|
|
71
|
+
"recycle_stock": {
|
|
72
|
+
"description": "备用牌堆为空时,点击将 waste 堆整个翻回作为新的备用堆",
|
|
73
|
+
"trigger": "player_click_empty_stock",
|
|
74
|
+
"recycleLimit": -1,
|
|
75
|
+
"effect": "stock = reverse(waste); waste = []"
|
|
76
|
+
},
|
|
77
|
+
"auto_complete": {
|
|
78
|
+
"description": "所有牌都 face_up 时,可以自动将可移动的牌逐一放入目标堆",
|
|
79
|
+
"trigger": "all_cards_face_up",
|
|
80
|
+
"effect": "auto_move_to_foundations_until_win"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"algorithm": {
|
|
84
|
+
"description": "主循环:player selects card → validate move → execute move → flip top → check win",
|
|
85
|
+
"steps": [
|
|
86
|
+
"1. 玩家选择一张或一组牌(从 tableau/waste)",
|
|
87
|
+
"2. 玩家选择目标位置(tableau 列 / foundation 堆)",
|
|
88
|
+
"3. 验证移动合法性(颜色交替降序 / 同花色升序)",
|
|
89
|
+
"4. 执行移牌:从源位置移除,添加到目标位置",
|
|
90
|
+
"5. 若源为 tableau 且新顶牌 face_down → 翻开",
|
|
91
|
+
"6. 若为翻牌操作:stock 顶牌移到 waste(face_up)",
|
|
92
|
+
"7. 检测胜利:4个 foundation 堆都满(各13张,A→K)",
|
|
93
|
+
"8. 若所有牌都 face_up → 触发 auto_complete 提示"
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
"winCondition": {
|
|
97
|
+
"type": "all_in_foundations",
|
|
98
|
+
"description": "4个花色目标堆各有13张牌(A到K),共52张"
|
|
99
|
+
},
|
|
100
|
+
"loseCondition": {
|
|
101
|
+
"type": "no_valid_moves",
|
|
102
|
+
"description": "(可选检测)无任何合法移动且 stock 为空且 waste 仅剩无法移动的牌"
|
|
103
|
+
},
|
|
104
|
+
"testCases": [
|
|
105
|
+
{
|
|
106
|
+
"id": "tc_move_to_tableau",
|
|
107
|
+
"description": "合法移牌:红色5放到黑色6上",
|
|
108
|
+
"initialState": {
|
|
109
|
+
"tableau": {
|
|
110
|
+
"col_0": [
|
|
111
|
+
{ "suit": "H", "value": 5, "face_up": true, "color": "red" }
|
|
112
|
+
],
|
|
113
|
+
"col_1": [
|
|
114
|
+
{ "suit": "S", "value": 7, "face_up": false },
|
|
115
|
+
{ "suit": "C", "value": 6, "face_up": true, "color": "black" }
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
"foundations": { "S": [], "H": [], "D": [], "C": [] },
|
|
119
|
+
"stock": [],
|
|
120
|
+
"waste": []
|
|
121
|
+
},
|
|
122
|
+
"actions": [
|
|
123
|
+
{ "type": "move_cards", "from": { "zone": "tableau", "col": 0 }, "to": { "zone": "tableau", "col": 1 }, "count": 1 }
|
|
124
|
+
],
|
|
125
|
+
"expectedState": {
|
|
126
|
+
"tableau.col_0": [],
|
|
127
|
+
"tableau.col_1_top": { "suit": "H", "value": 5, "face_up": true }
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"id": "tc_move_to_foundation",
|
|
132
|
+
"description": "移牌到目标堆:A先进,再放2",
|
|
133
|
+
"initialState": {
|
|
134
|
+
"tableau": {
|
|
135
|
+
"col_0": [
|
|
136
|
+
{ "suit": "S", "value": 2, "face_up": true, "color": "black" }
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
"foundations": { "S": [{ "suit": "S", "value": 1, "face_up": true }], "H": [], "D": [], "C": [] },
|
|
140
|
+
"stock": [],
|
|
141
|
+
"waste": []
|
|
142
|
+
},
|
|
143
|
+
"actions": [
|
|
144
|
+
{ "type": "move_cards", "from": { "zone": "tableau", "col": 0 }, "to": { "zone": "foundation", "suit": "S" }, "count": 1 }
|
|
145
|
+
],
|
|
146
|
+
"expectedState": {
|
|
147
|
+
"foundations.S": [
|
|
148
|
+
{ "suit": "S", "value": 1 },
|
|
149
|
+
{ "suit": "S", "value": 2 }
|
|
150
|
+
],
|
|
151
|
+
"tableau.col_0": []
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"id": "tc_draw_from_stock",
|
|
156
|
+
"description": "从备用堆翻牌到 waste",
|
|
157
|
+
"initialState": {
|
|
158
|
+
"tableau": { "col_0": [], "col_1": [], "col_2": [], "col_3": [], "col_4": [], "col_5": [], "col_6": [] },
|
|
159
|
+
"foundations": { "S": [], "H": [], "D": [], "C": [] },
|
|
160
|
+
"stock": [
|
|
161
|
+
{ "suit": "D", "value": 9, "face_up": false },
|
|
162
|
+
{ "suit": "H", "value": 3, "face_up": false }
|
|
163
|
+
],
|
|
164
|
+
"waste": []
|
|
165
|
+
},
|
|
166
|
+
"actions": [
|
|
167
|
+
{ "type": "draw_from_stock" }
|
|
168
|
+
],
|
|
169
|
+
"expectedState": {
|
|
170
|
+
"stock_count": 1,
|
|
171
|
+
"waste_top": { "suit": "H", "value": 3, "face_up": true }
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"id": "tc_flip_after_move",
|
|
176
|
+
"description": "移走顶牌后,下方 face_down 牌自动翻开",
|
|
177
|
+
"initialState": {
|
|
178
|
+
"tableau": {
|
|
179
|
+
"col_0": [
|
|
180
|
+
{ "suit": "C", "value": 8, "face_up": false },
|
|
181
|
+
{ "suit": "H", "value": 5, "face_up": true, "color": "red" }
|
|
182
|
+
],
|
|
183
|
+
"col_1": [
|
|
184
|
+
{ "suit": "S", "value": 6, "face_up": true, "color": "black" }
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
"foundations": { "S": [], "H": [], "D": [], "C": [] },
|
|
188
|
+
"stock": [],
|
|
189
|
+
"waste": []
|
|
190
|
+
},
|
|
191
|
+
"actions": [
|
|
192
|
+
{ "type": "move_cards", "from": { "zone": "tableau", "col": 0 }, "to": { "zone": "tableau", "col": 1 }, "count": 1 }
|
|
193
|
+
],
|
|
194
|
+
"expectedState": {
|
|
195
|
+
"tableau.col_0_top": { "suit": "C", "value": 8, "face_up": true },
|
|
196
|
+
"lastFlipped": true
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* solitaire.aigameplay — reducer 接口模板
|
|
3
|
+
*
|
|
4
|
+
* Agent 生成实际 reducer 时,必须导出以下函数。
|
|
5
|
+
* 此文件是接口约束模板,不是可执行代码。
|
|
6
|
+
*
|
|
7
|
+
* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
8
|
+
* ⚠️ 重要:渲染层(GameScene)不应直接调用 dispatch()
|
|
9
|
+
*
|
|
10
|
+
* dispatch() 是一体化接口,适用于无头测试。
|
|
11
|
+
* 渲染层需要在移牌前先验证合法性(canMoveToTableau/canMoveToFoundation),
|
|
12
|
+
* 再执行 moveCards,然后根据 lastFlipped 决定是否播放翻牌动画。
|
|
13
|
+
* 不要用 dispatch 然后全量重建所有牌精灵——这会破坏动画连续性。
|
|
14
|
+
* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// ─── 配置类型 ─────────────────────────────────────────────────────────────────
|
|
18
|
+
|
|
19
|
+
export type SolitaireConfig = {
|
|
20
|
+
/** 每次翻牌数量,默认 1(Klondike)或 3(Vegas) */
|
|
21
|
+
drawCount: number;
|
|
22
|
+
/** 翻牌堆循环限制,-1 = 无限,0 = 不可循环 */
|
|
23
|
+
stockRecycleLimit: number;
|
|
24
|
+
/** 是否自动将可用的牌移到目标堆(auto-complete 提示) */
|
|
25
|
+
autoComplete: boolean;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// ─── 核心类型 ─────────────────────────────────────────────────────────────────
|
|
29
|
+
|
|
30
|
+
export type Suit = 'S' | 'H' | 'D' | 'C'; // 黑桃、红心、方块、梅花
|
|
31
|
+
export type CardColor = 'red' | 'black';
|
|
32
|
+
export type CardValue = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13;
|
|
33
|
+
|
|
34
|
+
export type Card = {
|
|
35
|
+
suit: Suit;
|
|
36
|
+
value: CardValue; // 1=A, 11=J, 12=Q, 13=K
|
|
37
|
+
faceUp: boolean;
|
|
38
|
+
color: CardColor; // H/D=red, S/C=black
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/** 移牌来源/目标位置 */
|
|
42
|
+
export type ZoneRef =
|
|
43
|
+
| { zone: 'tableau'; col: number } // 7 列牌堆,col 0~6
|
|
44
|
+
| { zone: 'foundation'; suit: Suit } // 4 个花色目标堆
|
|
45
|
+
| { zone: 'waste' }; // 废牌堆顶
|
|
46
|
+
|
|
47
|
+
// ─── 动作类型 ─────────────────────────────────────────────────────────────────
|
|
48
|
+
|
|
49
|
+
export type SolitaireAction =
|
|
50
|
+
| { type: 'move_cards'; from: ZoneRef; to: ZoneRef; count: number }
|
|
51
|
+
| { type: 'draw_from_stock' }
|
|
52
|
+
| { type: 'recycle_stock' }
|
|
53
|
+
| { type: 'auto_complete' }
|
|
54
|
+
| { type: 'reset' };
|
|
55
|
+
|
|
56
|
+
// ─── 状态类型 ─────────────────────────────────────────────────────────────────
|
|
57
|
+
|
|
58
|
+
export type SolitaireState = {
|
|
59
|
+
/** 7 列牌堆,tableau[col] = Card[] 从底到顶 */
|
|
60
|
+
tableau: Card[][];
|
|
61
|
+
/** 备用牌堆(未翻开),stock[0] 是顶部 */
|
|
62
|
+
stock: Card[];
|
|
63
|
+
/** 废牌堆(已翻开),waste[waste.length-1] 是顶部 */
|
|
64
|
+
waste: Card[];
|
|
65
|
+
/** 4 个花色目标堆,foundations[suit] = Card[] 从 A 到顶 */
|
|
66
|
+
foundations: Record<Suit, Card[]>;
|
|
67
|
+
/** 翻牌堆已循环次数 */
|
|
68
|
+
stockRecycleCount: number;
|
|
69
|
+
/** 游戏是否结束 */
|
|
70
|
+
gameOver: boolean;
|
|
71
|
+
/** 是否胜利(所有牌进入 foundations) */
|
|
72
|
+
win: boolean;
|
|
73
|
+
/** 上一次操作是否触发了自动翻牌 */
|
|
74
|
+
lastFlipped: boolean;
|
|
75
|
+
/** 上一次翻开的牌所在列(用于渲染层播放翻牌动画) */
|
|
76
|
+
lastFlippedCol: number | null;
|
|
77
|
+
/** 所有牌是否都已翻面(触发 auto-complete 提示) */
|
|
78
|
+
allFaceUp: boolean;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// ─── 分步操作返回类型 ─────────────────────────────────────────────────────────
|
|
82
|
+
|
|
83
|
+
/** 合法移动描述 */
|
|
84
|
+
export type ValidMove = {
|
|
85
|
+
from: ZoneRef;
|
|
86
|
+
to: ZoneRef;
|
|
87
|
+
count: number;
|
|
88
|
+
/** 是否为移到 foundation 的操作(通常优先级更高) */
|
|
89
|
+
toFoundation: boolean;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
93
|
+
// 必须导出的函数
|
|
94
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
95
|
+
|
|
96
|
+
// ─── 初始化 ──────────────────────────────────────────────────────────────────
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* init:初始化 Klondike 纸牌接龙
|
|
100
|
+
* - 随机洗52张牌
|
|
101
|
+
* - 第 i 列(1-indexed)发 i 张牌,最顶部翻面
|
|
102
|
+
* - 剩余牌放入 stock
|
|
103
|
+
*/
|
|
104
|
+
export declare function init(config: SolitaireConfig): SolitaireState;
|
|
105
|
+
|
|
106
|
+
// ─── 一体化接口(测试/AI 模拟用) ───────────────────────────────────────────
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* dispatch:接收动作,返回新状态(纯函数,不得修改原 state)
|
|
110
|
+
* ⚠️ 仅用于无头测试和 AI 模拟。渲染层请使用下方分步函数。
|
|
111
|
+
*/
|
|
112
|
+
export declare function dispatch(state: SolitaireState, action: SolitaireAction): SolitaireState;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* getState:返回当前状态快照
|
|
116
|
+
*/
|
|
117
|
+
export declare function getState(state: SolitaireState): SolitaireState;
|
|
118
|
+
|
|
119
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
120
|
+
// 分步函数(渲染层/场景层必须使用这些函数)
|
|
121
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* canMoveToTableau:验证将指定牌移到目标列是否合法
|
|
125
|
+
* 规则:颜色交替(红↔黑),数值 = 目标列顶牌值 - 1;空列只接受 K
|
|
126
|
+
*
|
|
127
|
+
* 渲染层在玩家拖动牌到列时调用,若返回 false 则播放弹回动画
|
|
128
|
+
*/
|
|
129
|
+
export declare function canMoveToTableau(
|
|
130
|
+
state: SolitaireState,
|
|
131
|
+
card: Card,
|
|
132
|
+
targetCol: number,
|
|
133
|
+
): boolean;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* canMoveToFoundation:验证将指定牌移到目标堆是否合法
|
|
137
|
+
* 规则:同花色,值 = 目标堆顶牌值 + 1;空堆只接受 A(value == 1)
|
|
138
|
+
*
|
|
139
|
+
* 渲染层在玩家双击牌时调用,自动移到 foundation
|
|
140
|
+
*/
|
|
141
|
+
export declare function canMoveToFoundation(
|
|
142
|
+
state: SolitaireState,
|
|
143
|
+
card: Card,
|
|
144
|
+
): boolean;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* moveCards:执行移牌操作
|
|
148
|
+
* - 支持从 tableau/waste 移到 tableau/foundation
|
|
149
|
+
* - 移完后自动翻开源列新顶牌(若 faceDown)
|
|
150
|
+
* - 更新 lastFlipped 和 lastFlippedCol
|
|
151
|
+
* - 检测胜利条件
|
|
152
|
+
*
|
|
153
|
+
* 渲染层在验证合法后调用,根据 lastFlipped 决定是否播放翻牌动画
|
|
154
|
+
*/
|
|
155
|
+
export declare function moveCards(
|
|
156
|
+
state: SolitaireState,
|
|
157
|
+
from: ZoneRef,
|
|
158
|
+
to: ZoneRef,
|
|
159
|
+
count: number,
|
|
160
|
+
): SolitaireState;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* drawFromStock:从备用堆翻 drawCount 张牌到 waste(faceUp)
|
|
164
|
+
* 若 stock 为空则循环(受 stockRecycleLimit 限制)
|
|
165
|
+
*
|
|
166
|
+
* 渲染层在玩家点击备用堆时调用,播放翻牌动画
|
|
167
|
+
*/
|
|
168
|
+
export declare function drawFromStock(state: SolitaireState): SolitaireState;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* getValidMoves:获取当前状态下所有合法的移动
|
|
172
|
+
* 用于:1) AI 自动解牌;2) 检测是否无解(no valid moves);3) 提示功能
|
|
173
|
+
*
|
|
174
|
+
* 性能注意:完整扫描所有组合,不要在每帧调用
|
|
175
|
+
*/
|
|
176
|
+
export declare function getValidMoves(state: SolitaireState): ValidMove[];
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sound-effects
|
|
3
|
+
description: 通过 playcraft CLI 生成音效(SFX);--prompt 仅支持英文。含时长、循环等 CLI 参数与英文提示词写法,与 playcraft-audio-generation 配合。
|
|
4
|
+
license: MIT
|
|
5
|
+
source: https://github.com/elevenlabs/skills/tree/main/sound-effects
|
|
6
|
+
compatibility: agent,opencode
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# 音效生成(SFX)— CLI 与提示词
|
|
10
|
+
|
|
11
|
+
用**英文文字描述**生成短音效(平台后端走 ElevenLabs Sound Effects,**不是**语音 TTS)。你在沙箱里**只使用 `playcraft tools generate-sfx`**;云端认证与厂商侧配置由平台处理,**无需也不应**在技能文档或命令中涉及密钥、环境变量或自行调用厂商 HTTP/SDK。
|
|
12
|
+
|
|
13
|
+
## 语言(必须遵守)
|
|
14
|
+
|
|
15
|
+
**`--prompt` 只支持英文。** 不要用中文或其他语言写 SFX 描述:模型对非英文支持差,易出现杂音、语义跑偏或听感像念白。若用户给中文需求,先在心里翻译成简洁英文短语再写入 `--prompt`。
|
|
16
|
+
|
|
17
|
+
## CLI
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
playcraft tools generate-sfx \
|
|
21
|
+
--prompt "<English only, see Prompt Tips below>" \
|
|
22
|
+
[--duration <秒>] \
|
|
23
|
+
[--loop] \
|
|
24
|
+
--output <路径>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
| CLI 选项 | 说明 |
|
|
28
|
+
|----------|------|
|
|
29
|
+
| `--prompt` | 必填,**仅英文**音效描述 |
|
|
30
|
+
| `--duration` | 可选,约 0.5–30 秒 |
|
|
31
|
+
| `--loop` | 可选,可循环音效 |
|
|
32
|
+
| `--output` | 必填,保存路径(如 `./assets/audio/click.mp3`) |
|
|
33
|
+
|
|
34
|
+
生成 BGM 用 `playcraft tools generate-bgm`(见 `playcraft-audio-generation`)。
|
|
35
|
+
|
|
36
|
+
## Prompt Tips(英文 `--prompt`,优先遵守)
|
|
37
|
+
|
|
38
|
+
- 具体化:"Heavy rain on a tin roof" 优于 "Rain"
|
|
39
|
+
- 组合层次:"Footsteps on gravel with distant traffic"
|
|
40
|
+
- 标明风格:"Cinematic braam, horror" 或 "8-bit retro jump sound"
|
|
41
|
+
- 情绪与场景:"Eerie wind howling through an abandoned building"
|
|
42
|
+
- 使用**非对白、偏拟声/材质/场景**的短语;长句口语容易听起来像念稿(虽非 TTS API)
|
|
43
|
+
|
|
44
|
+
## 失败时
|
|
45
|
+
|
|
46
|
+
根据 CLI 报错判断:参数问题则改 `--prompt` / `--duration`;若提示权限、额度或上游不可用,向用户说明需**在平台侧**检查配置或配额——**不要**尝试自行配置密钥或直连厂商 API。
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sound_utils.aicomponent
|
|
3
|
+
description: 音频工具函数。提供 safePlaySound() 封装,自动处理音效键不存在时的静默失败,并根据用户设置的静音状态决定是否播放。
|
|
4
|
+
triggers: 需要在游戏中安全播放音效(避免缺失音效导致异常)时触发。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 音频工具函数(Sound Utilities)
|
|
8
|
+
|
|
9
|
+
## Scaffold
|
|
10
|
+
|
|
11
|
+
`src/game/utils/SoundUtils.ts`
|
|
12
|
+
|
|
13
|
+
## Imports
|
|
14
|
+
|
|
15
|
+
- `phaser.aicomponent`(硬依赖:Phaser SoundManager API)
|
|
16
|
+
|
|
17
|
+
## Skill Definition
|
|
18
|
+
|
|
19
|
+
```yaml
|
|
20
|
+
tools:
|
|
21
|
+
- read_file
|
|
22
|
+
- write_file
|
|
23
|
+
inputs:
|
|
24
|
+
- source: src/game/utils/SoundUtils.ts
|
|
25
|
+
outputs:
|
|
26
|
+
- safePlaySound: function(scene, key, config?) - safe audio playback wrapper
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Recipe
|
|
30
|
+
|
|
31
|
+
| 决策 | 原因 |
|
|
32
|
+
|------|------|
|
|
33
|
+
| **静默失败而非抛错** | 资产键缺失(如音效文件未加载)不应中断游戏进程;在试玩广告中,音效缺失是可接受的降级,崩溃不可接受 |
|
|
34
|
+
| **尊重静音设置** | SFX 播放必须检查 `settings.soundOn`,否则用户关闭音效后仍会发声,体验问题在发布时暴露 |
|
|
35
|
+
| **从 phaser.aicomponent 中抽出** | `phaser.aicomponent` 已内置基础版 `SoundUtils.ts`;本 skill 在需要更复杂音频管理(如 BGM 队列)时作为增强版单独加载 |
|
|
36
|
+
|
|
37
|
+
## Adapter
|
|
38
|
+
|
|
39
|
+
- **Role**: `soundUtils` — Phaser 安全音效播放封装
|
|
40
|
+
- **Provides**: `safePlaySound(scene, key, config?)` 函数
|
|
41
|
+
- **Requires**: `phaser.aicomponent`(硬依赖:Phaser SoundManager API)
|
|
42
|
+
- **Consumed by**: `game_scene.aicomponent`、`level_lifecycle.aicomponent`、`path_input_handler.aicomponent` 等所有需要播放 SFX 的 skill
|
|
43
|
+
- **Integration point**: `src/game/utils/SoundUtils.ts` —— 在任意 Phaser Scene 中 `import { safePlaySound }` 后使用
|
|
44
|
+
|
|
45
|
+
## 使用示例
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import { safePlaySound } from '../utils/SoundUtils';
|
|
49
|
+
|
|
50
|
+
safePlaySound(this, 'click', { volume: 1.0 });
|
|
51
|
+
safePlaySound(this, 'bg', { loop: true, volume: 0.8 });
|
|
52
|
+
```
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "sound_utils.aicomponent",
|
|
4
|
+
"bundleType": "aicomponent",
|
|
5
|
+
"category": "util",
|
|
6
|
+
"mode": "fixed",
|
|
7
|
+
"label": { "zh": "音频工具函数", "en": "Sound utility functions" },
|
|
8
|
+
"tags": ["util", "audio", "sound", "safe-play", "phaser"],
|
|
9
|
+
"bindingRoles": ["audioPlayHelper"],
|
|
10
|
+
"scaffold": {
|
|
11
|
+
"files": {
|
|
12
|
+
"src/game/utils/SoundUtils.ts": { "source": "ref/SoundUtils.ts", "mode": "full", "weight": 10 }
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"imports": [
|
|
16
|
+
{ "slot": "engine", "pinAtomId": "phaser.aicomponent", "edgeKind": "requires", "bindAs": "engine" }
|
|
17
|
+
],
|
|
18
|
+
"exports": [
|
|
19
|
+
{ "name": "safePlaySound", "kind": "function", "location": "src/game/utils/SoundUtils.ts" }
|
|
20
|
+
],
|
|
21
|
+
"neutralDescriptor": {
|
|
22
|
+
"geometry": "utility wrapper for Phaser audio playback that safely handles missing sound keys and settings-based muting"
|
|
23
|
+
},
|
|
24
|
+
"usageHints": [
|
|
25
|
+
"safePlaySound(scene, key, config?) 在音效不存在时静默失败(不抛异常)",
|
|
26
|
+
"自动检查 settings.soundOn,静音状态下跳过播放",
|
|
27
|
+
"在 InputHandler / LevelLifecycle / AnimationManager 中广泛使用"
|
|
28
|
+
],
|
|
29
|
+
"files": { "skill": "SKILL.md", "soundUtils": "ref/SoundUtils.ts" }
|
|
30
|
+
}
|