@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,189 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "PGS (PlayCraft Gameplay Schema) 参考骨架 - 画线解谜玩法。Agent 以此为起点编写或 fork 玩法规则。",
|
|
3
|
+
"version": "1.0",
|
|
4
|
+
"gameplayType": "draw_line_puzzle",
|
|
5
|
+
"entities": {
|
|
6
|
+
"scene": {
|
|
7
|
+
"type": "spatial",
|
|
8
|
+
"description": "关卡场景空间",
|
|
9
|
+
"fields": {
|
|
10
|
+
"width": { "type": "number", "default": 800 },
|
|
11
|
+
"height": { "type": "number", "default": 600 },
|
|
12
|
+
"startPoint": { "type": "vec2", "description": "角色初始位置" },
|
|
13
|
+
"endPoint": { "type": "vec2", "description": "目标位置(宝箱/出口)" },
|
|
14
|
+
"obstacles": {
|
|
15
|
+
"type": "rect[]",
|
|
16
|
+
"description": "障碍物列表,每个为 {x, y, width, height},线段不能穿过障碍"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"drawnLines": {
|
|
21
|
+
"type": "entity-list",
|
|
22
|
+
"description": "玩家已绘制的所有线段集合",
|
|
23
|
+
"item": {
|
|
24
|
+
"id": { "type": "string" },
|
|
25
|
+
"points": { "type": "vec2[]", "description": "折线路径点数组,首尾相连" },
|
|
26
|
+
"length": { "type": "number", "description": "该段折线的总长度(px)" }
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"character": {
|
|
30
|
+
"type": "agent",
|
|
31
|
+
"description": "被引导的角色",
|
|
32
|
+
"fields": {
|
|
33
|
+
"position": { "type": "vec2" },
|
|
34
|
+
"state": { "type": "enum", "values": ["idle", "moving", "arrived", "blocked"], "default": "idle" },
|
|
35
|
+
"pathProgress": { "type": "number", "description": "沿当前路径的移动进度(0~1)" }
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"target": {
|
|
39
|
+
"type": "point",
|
|
40
|
+
"description": "目标位置(角色需要到达的地点)",
|
|
41
|
+
"fields": {
|
|
42
|
+
"position": { "type": "vec2" },
|
|
43
|
+
"radius": { "type": "number", "default": 30, "description": "到达判定半径" }
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"inkUsed": {
|
|
47
|
+
"type": "counter",
|
|
48
|
+
"initial": 0,
|
|
49
|
+
"description": "已使用的墨水长度(所有线段总长度之和)"
|
|
50
|
+
},
|
|
51
|
+
"timeLeft": {
|
|
52
|
+
"type": "counter",
|
|
53
|
+
"description": "剩余时间(ms,仅 timeLimitEnabled 时有效)"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"rules": {
|
|
57
|
+
"draw_line": {
|
|
58
|
+
"description": "玩家在空白区域绘制线段",
|
|
59
|
+
"steps": [
|
|
60
|
+
"1. startLine(point):记录起始点,创建新线段",
|
|
61
|
+
"2. extendLine(point):追加新折点,检测是否与障碍物相交",
|
|
62
|
+
" - 若新线段与任何 obstacle 矩形相交:拒绝追加,标记 inkExceeded=false, blocked=true",
|
|
63
|
+
" - 若 inkUsed + newSegmentLength > maxInkLength:拒绝追加,标记 inkExceeded=true",
|
|
64
|
+
" - 否则:追加折点,更新 inkUsed",
|
|
65
|
+
"3. finishLine():封存当前线段"
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
"validate_path": {
|
|
69
|
+
"description": "检查绘制的路径是否能引导角色从 startPoint 到 endPoint",
|
|
70
|
+
"conditions": [
|
|
71
|
+
"路径起点距离 scene.startPoint ≤ snapRadius(30px)",
|
|
72
|
+
"路径终点距离 scene.endPoint ≤ snapRadius(30px)",
|
|
73
|
+
"路径所有线段不与任何 obstacle 相交"
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"execute": {
|
|
77
|
+
"description": "路径验证通过后,角色沿路径移动",
|
|
78
|
+
"speed": "characterSpeed(px/s,由 config 覆盖)",
|
|
79
|
+
"interpolation": "线性插值沿折线路径逐段移动"
|
|
80
|
+
},
|
|
81
|
+
"win_check": {
|
|
82
|
+
"description": "角色到达 target 判定圆内时触发胜利"
|
|
83
|
+
},
|
|
84
|
+
"line_limit": {
|
|
85
|
+
"description": "墨水限制:inkUsed 超过 maxInkLength 时无法继续绘制"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"algorithm": {
|
|
89
|
+
"description": "主流程:draw → validate → execute → win",
|
|
90
|
+
"steps": [
|
|
91
|
+
"1. 玩家触摸开始:startLine(touchPoint)",
|
|
92
|
+
"2. 玩家拖动:extendLine(touchPoint),实时检测障碍碰撞和墨水限制",
|
|
93
|
+
"3. 玩家抬起手指:finishLine()",
|
|
94
|
+
"4. validatePath():检查路径是否有效",
|
|
95
|
+
"5. 若有效:character.state = moving,开始 executeCharacterMove(deltaMs) 循环",
|
|
96
|
+
"6. 每帧:executeCharacterMove(deltaMs) 更新 character.position 和 pathProgress",
|
|
97
|
+
"7. checkWin():若 character.position 进入 target 半径 → win=true"
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
"winCondition": {
|
|
101
|
+
"type": "character_reaches_target",
|
|
102
|
+
"description": "角色到达目标点判定圆内"
|
|
103
|
+
},
|
|
104
|
+
"loseCondition": {
|
|
105
|
+
"type": "time_limit_or_ink_exhausted",
|
|
106
|
+
"description": "(时限模式)时间耗尽前角色未到达目标;或墨水耗尽无法画出有效路径(软失败,需玩家重试)"
|
|
107
|
+
},
|
|
108
|
+
"testCases": [
|
|
109
|
+
{
|
|
110
|
+
"id": "tc_draw_path_and_win",
|
|
111
|
+
"description": "正常通关:画出有效路径,角色到达目标",
|
|
112
|
+
"initialState": {
|
|
113
|
+
"scene": {
|
|
114
|
+
"width": 800, "height": 600,
|
|
115
|
+
"startPoint": { "x": 100, "y": 300 },
|
|
116
|
+
"endPoint": { "x": 700, "y": 300 },
|
|
117
|
+
"obstacles": []
|
|
118
|
+
},
|
|
119
|
+
"drawnLines": [],
|
|
120
|
+
"character": { "position": { "x": 100, "y": 300 }, "state": "idle", "pathProgress": 0 },
|
|
121
|
+
"target": { "position": { "x": 700, "y": 300 }, "radius": 30 },
|
|
122
|
+
"inkUsed": 0
|
|
123
|
+
},
|
|
124
|
+
"actions": [
|
|
125
|
+
{ "type": "startLine", "point": { "x": 100, "y": 300 } },
|
|
126
|
+
{ "type": "extendLine", "point": { "x": 400, "y": 300 } },
|
|
127
|
+
{ "type": "extendLine", "point": { "x": 700, "y": 300 } },
|
|
128
|
+
{ "type": "finishLine" },
|
|
129
|
+
{ "type": "tick", "deltaMs": 7000 }
|
|
130
|
+
],
|
|
131
|
+
"expectedState": {
|
|
132
|
+
"character.state": "arrived",
|
|
133
|
+
"win": true
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"id": "tc_obstacle_blocks_line",
|
|
138
|
+
"description": "障碍阻挡:线段与障碍物相交时被拒绝,不能继续绘制",
|
|
139
|
+
"initialState": {
|
|
140
|
+
"scene": {
|
|
141
|
+
"width": 800, "height": 600,
|
|
142
|
+
"startPoint": { "x": 100, "y": 300 },
|
|
143
|
+
"endPoint": { "x": 700, "y": 300 },
|
|
144
|
+
"obstacles": [
|
|
145
|
+
{ "x": 300, "y": 200, "width": 100, "height": 200 }
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"drawnLines": [],
|
|
149
|
+
"character": { "position": { "x": 100, "y": 300 }, "state": "idle", "pathProgress": 0 },
|
|
150
|
+
"target": { "position": { "x": 700, "y": 300 }, "radius": 30 },
|
|
151
|
+
"inkUsed": 0
|
|
152
|
+
},
|
|
153
|
+
"actions": [
|
|
154
|
+
{ "type": "startLine", "point": { "x": 100, "y": 300 } },
|
|
155
|
+
{ "type": "extendLine", "point": { "x": 500, "y": 300 } }
|
|
156
|
+
],
|
|
157
|
+
"expectedState": {
|
|
158
|
+
"lastExtendResult.blocked": true,
|
|
159
|
+
"drawnLines[0].points.length": { "max": 2 },
|
|
160
|
+
"win": false
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"id": "tc_ink_too_long",
|
|
165
|
+
"description": "墨水耗尽:绘制超过最大墨水长度时被拒绝",
|
|
166
|
+
"initialState": {
|
|
167
|
+
"scene": {
|
|
168
|
+
"width": 800, "height": 600,
|
|
169
|
+
"startPoint": { "x": 100, "y": 300 },
|
|
170
|
+
"endPoint": { "x": 700, "y": 300 },
|
|
171
|
+
"obstacles": []
|
|
172
|
+
},
|
|
173
|
+
"drawnLines": [],
|
|
174
|
+
"character": { "position": { "x": 100, "y": 300 }, "state": "idle", "pathProgress": 0 },
|
|
175
|
+
"target": { "position": { "x": 700, "y": 300 }, "radius": 30 },
|
|
176
|
+
"inkUsed": 480,
|
|
177
|
+
"config": { "maxInkLength": 500 }
|
|
178
|
+
},
|
|
179
|
+
"actions": [
|
|
180
|
+
{ "type": "startLine", "point": { "x": 100, "y": 300 } },
|
|
181
|
+
{ "type": "extendLine", "point": { "x": 700, "y": 300 } }
|
|
182
|
+
],
|
|
183
|
+
"expectedState": {
|
|
184
|
+
"lastExtendResult.inkExceeded": true,
|
|
185
|
+
"win": false
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* draw_line_puzzle.aigameplay — reducer 接口模板
|
|
3
|
+
*
|
|
4
|
+
* Agent 生成实际 reducer 时,必须导出以下函数。
|
|
5
|
+
* 此文件是接口约束模板,不是可执行代码。
|
|
6
|
+
*
|
|
7
|
+
* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
8
|
+
* ⚠️ 重要:渲染层(GameScene)不应直接调用 dispatch()
|
|
9
|
+
*
|
|
10
|
+
* dispatch() 是一体化接口,内部完成整个画线 → 验证 → 角色移动流程,
|
|
11
|
+
* 中间过程(实时墨水消耗、线段碰撞点、角色逐帧位置)全部丢失。
|
|
12
|
+
*
|
|
13
|
+
* 渲染层需要实时绘制线段、显示墨水条、逐帧更新角色位置,
|
|
14
|
+
* 因此必须使用下方的「分步函数」逐步驱动,每步之间同步渲染状态。
|
|
15
|
+
*
|
|
16
|
+
* dispatch() 的用途:无头测试、AI 模拟、跳过动画等场景。
|
|
17
|
+
* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
// ─── 配置类型 ─────────────────────────────────────────────────────────────────
|
|
21
|
+
|
|
22
|
+
export type Vec2 = { x: number; y: number };
|
|
23
|
+
|
|
24
|
+
export type Rect = { x: number; y: number; width: number; height: number };
|
|
25
|
+
|
|
26
|
+
export type DrawLinePuzzleConfig = {
|
|
27
|
+
/** 场景宽度(px) */
|
|
28
|
+
sceneWidth: number;
|
|
29
|
+
/** 场景高度(px) */
|
|
30
|
+
sceneHeight: number;
|
|
31
|
+
/** 最大墨水总长度(px) */
|
|
32
|
+
maxInkLength: number;
|
|
33
|
+
/** 角色移动速度(px/s) */
|
|
34
|
+
characterSpeed: number;
|
|
35
|
+
/** 折点最小间距(小于此值则合并,px) */
|
|
36
|
+
lineSegmentSnap: number;
|
|
37
|
+
/** 是否启用时间限制 */
|
|
38
|
+
timeLimitEnabled: boolean;
|
|
39
|
+
/** 时间限制(ms,仅 timeLimitEnabled=true 时有效) */
|
|
40
|
+
timeLimitMs?: number;
|
|
41
|
+
/** 起点吸附半径(角色在此范围内则路径起点有效,px) */
|
|
42
|
+
snapRadius: number;
|
|
43
|
+
/** 场景障碍物列表 */
|
|
44
|
+
obstacles: Rect[];
|
|
45
|
+
/** 起始点 */
|
|
46
|
+
startPoint: Vec2;
|
|
47
|
+
/** 目标点 */
|
|
48
|
+
endPoint: Vec2;
|
|
49
|
+
/** 目标到达判定半径(px) */
|
|
50
|
+
targetRadius: number;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// ─── 动作类型 ─────────────────────────────────────────────────────────────────
|
|
54
|
+
|
|
55
|
+
export type DrawLinePuzzleAction =
|
|
56
|
+
| { type: 'startLine'; point: Vec2 }
|
|
57
|
+
| { type: 'extendLine'; point: Vec2 }
|
|
58
|
+
| { type: 'finishLine' }
|
|
59
|
+
| { type: 'tick'; deltaMs: number }
|
|
60
|
+
| { type: 'reset' };
|
|
61
|
+
|
|
62
|
+
// ─── 状态类型 ─────────────────────────────────────────────────────────────────
|
|
63
|
+
|
|
64
|
+
export type CharacterState = 'idle' | 'moving' | 'arrived' | 'blocked';
|
|
65
|
+
|
|
66
|
+
export type DrawnLine = {
|
|
67
|
+
id: string;
|
|
68
|
+
points: Vec2[];
|
|
69
|
+
length: number;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export type DrawLinePuzzleState = {
|
|
73
|
+
lines: DrawnLine[];
|
|
74
|
+
activeLine: DrawnLine | null;
|
|
75
|
+
character: {
|
|
76
|
+
position: Vec2;
|
|
77
|
+
state: CharacterState;
|
|
78
|
+
pathProgress: number;
|
|
79
|
+
currentPathPoints: Vec2[];
|
|
80
|
+
};
|
|
81
|
+
target: {
|
|
82
|
+
position: Vec2;
|
|
83
|
+
radius: number;
|
|
84
|
+
};
|
|
85
|
+
inkUsed: number;
|
|
86
|
+
timeLeft: number;
|
|
87
|
+
gameOver: boolean;
|
|
88
|
+
win: boolean;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// ─── 分步操作返回类型 ─────────────────────────────────────────────────────────
|
|
92
|
+
|
|
93
|
+
export type ExtendLineResult = {
|
|
94
|
+
newSegment: { from: Vec2; to: Vec2 } | null;
|
|
95
|
+
inkUsed: number;
|
|
96
|
+
inkExceeded: boolean;
|
|
97
|
+
blocked: boolean;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export type ValidatePathResult = {
|
|
101
|
+
valid: boolean;
|
|
102
|
+
reason: 'ok' | 'no_path' | 'obstacle_blocked' | 'no_start_connection' | 'no_end_connection';
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export type CharacterMoveResult = {
|
|
106
|
+
position: Vec2;
|
|
107
|
+
progress: number;
|
|
108
|
+
arrived: boolean;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
112
|
+
// 必须导出的函数
|
|
113
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
114
|
+
|
|
115
|
+
// ─── 初始化 ──────────────────────────────────────────────────────────────────
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* init:根据配置初始化游戏状态
|
|
119
|
+
*/
|
|
120
|
+
export declare function init(config: DrawLinePuzzleConfig): DrawLinePuzzleState;
|
|
121
|
+
|
|
122
|
+
// ─── 一体化接口(测试/AI 模拟用) ───────────────────────────────────────────
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* dispatch:接收动作,返回新状态(纯函数,不得修改原 state)
|
|
126
|
+
*
|
|
127
|
+
* ⚠️ 仅用于无头测试和 AI 模拟。渲染层请使用下方分步函数。
|
|
128
|
+
*/
|
|
129
|
+
export declare function dispatch(state: DrawLinePuzzleState, action: DrawLinePuzzleAction): DrawLinePuzzleState;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* getState:返回当前状态快照
|
|
133
|
+
*/
|
|
134
|
+
export declare function getState(state: DrawLinePuzzleState): DrawLinePuzzleState;
|
|
135
|
+
|
|
136
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
137
|
+
// 分步函数(渲染层/场景层必须使用这些函数驱动动画)
|
|
138
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* startLine:开始绘制新线段
|
|
142
|
+
* 场景层创建新的 Phaser.Graphics 对象,移动到起始点
|
|
143
|
+
*/
|
|
144
|
+
export declare function startLine(
|
|
145
|
+
state: DrawLinePuzzleState,
|
|
146
|
+
point: Vec2,
|
|
147
|
+
): { lineId: string; inkUsed: number };
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* extendLine:延伸当前线段到新点
|
|
151
|
+
* 场景层在 Graphics 上实时追加 lineTo,更新墨水进度条 HUD
|
|
152
|
+
*
|
|
153
|
+
* - blocked=true:新线段与障碍物相交,拒绝追加
|
|
154
|
+
* - inkExceeded=true:墨水不足,拒绝追加
|
|
155
|
+
* - newSegment=null:小于 lineSegmentSnap,忽略(合并到上一点)
|
|
156
|
+
*/
|
|
157
|
+
export declare function extendLine(
|
|
158
|
+
state: DrawLinePuzzleState,
|
|
159
|
+
point: Vec2,
|
|
160
|
+
): ExtendLineResult;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* finishLine:封存当前绘制的线段
|
|
164
|
+
* 场景层调用后,Graphics 对象变为静态,不再追加
|
|
165
|
+
*/
|
|
166
|
+
export declare function finishLine(
|
|
167
|
+
state: DrawLinePuzzleState,
|
|
168
|
+
): { lines: DrawnLine[]; totalInkUsed: number };
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* validatePath:检查所有已绘制线段是否能构成从 startPoint 到 endPoint 的有效路径
|
|
172
|
+
* 场景层根据 valid 高亮路径(绿色=有效,红色=无效)
|
|
173
|
+
*/
|
|
174
|
+
export declare function validatePath(
|
|
175
|
+
state: DrawLinePuzzleState,
|
|
176
|
+
): ValidatePathResult;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* executeCharacterMove:逐帧推进角色沿路径移动
|
|
180
|
+
* 场景层每帧调用,根据返回 position 更新角色精灵位置
|
|
181
|
+
*
|
|
182
|
+
* - arrived=true:角色到达目标,场景层调用 checkWin()
|
|
183
|
+
*/
|
|
184
|
+
export declare function executeCharacterMove(
|
|
185
|
+
state: DrawLinePuzzleState,
|
|
186
|
+
deltaMs: number,
|
|
187
|
+
): CharacterMoveResult;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* checkWin:检查是否胜利(角色是否已到达目标)
|
|
191
|
+
*/
|
|
192
|
+
export declare function checkWin(
|
|
193
|
+
state: DrawLinePuzzleState,
|
|
194
|
+
): { win: boolean };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: easy_to_hard.aiconfig
|
|
3
|
+
description: 先易后难难度曲线配置封包 - 关卡难度线性递增的参数配置,适合引导新玩家的休闲游戏
|
|
4
|
+
triggers: 难度曲线,difficulty,先易后难,easy_to_hard,关卡,level,配置,config,递增,progressive
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# easy_to_hard.aiconfig
|
|
8
|
+
|
|
9
|
+
先易后难难度曲线配置封包。配置关卡从简单到困难线性递增,适合给新玩家良好的上手体验。
|
|
10
|
+
|
|
11
|
+
## Recipe
|
|
12
|
+
|
|
13
|
+
- **配置方式**:参数化(parametric)
|
|
14
|
+
- **核心参数**:
|
|
15
|
+
- `difficultyMode`: `"easy_to_hard"`
|
|
16
|
+
- `initialMoves`: 30(第一关步数)
|
|
17
|
+
- `finalMoves`: 15(最后一关步数)
|
|
18
|
+
- `progressionSteps`: 10(关卡总数)
|
|
19
|
+
- **可 fork 变体**:
|
|
20
|
+
- 更快递增:`progressionSteps: 5`,更快进入高难度
|
|
21
|
+
- 超宽松入门:`initialMoves: 50`,给更多初始步数
|
|
22
|
+
- 逆序(先难后易):将 `initialMoves` 和 `finalMoves` 互换
|
|
23
|
+
|
|
24
|
+
**配置步骤:**
|
|
25
|
+
1. 读取 Prefab 容器的 `game/config.json`
|
|
26
|
+
2. 将 `difficulty.curve` 键写入 `"easy_to_hard"`
|
|
27
|
+
3. 写入对应步数参数(`difficulty.initialMoves`、`difficulty.finalMoves`)
|
|
28
|
+
4. 更新 manifest
|
|
29
|
+
|
|
30
|
+
## Result
|
|
31
|
+
|
|
32
|
+
- **产物**:修改 `game/config.json` 的参数键值
|
|
33
|
+
- **格式**:JSON patch
|
|
34
|
+
- **目标键**:`difficulty.curve`
|
|
35
|
+
|
|
36
|
+
## Binding
|
|
37
|
+
|
|
38
|
+
- **Binding Role**:`gameConfig`
|
|
39
|
+
- **挂载目标**:`game/config.json`
|
|
40
|
+
- **引用类型**:`config-key-value`
|
|
41
|
+
- **约束**:key=`difficulty.curve`
|
|
42
|
+
|
|
43
|
+
## Skill Definition
|
|
44
|
+
|
|
45
|
+
tools:
|
|
46
|
+
- read
|
|
47
|
+
- write
|
|
48
|
+
prompt_extension: |
|
|
49
|
+
You are configuring a difficulty progression curve for a casual match-3 game.
|
|
50
|
+
Follow the Recipe to write the difficulty parameters to game/config.json.
|
|
51
|
+
Use easy_to_hard mode: start with generous moves and gradually decrease over levels.
|
|
52
|
+
Apply the Binding to ensure the config key is correctly set.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "easy_to_hard.aiconfig",
|
|
4
|
+
"bundleType": "aiconfig",
|
|
5
|
+
"category": "config",
|
|
6
|
+
"mode": "parametric",
|
|
7
|
+
"label": { "zh": "先易后难难度曲线", "en": "Easy-to-hard difficulty curve" },
|
|
8
|
+
"tags": ["config", "difficulty", "curve", "level", "progression", "casual"],
|
|
9
|
+
"bindingRoles": ["gameConfig"],
|
|
10
|
+
"generation": {
|
|
11
|
+
"kind": "config-patch",
|
|
12
|
+
"params": {
|
|
13
|
+
"difficultyMode": "easy_to_hard",
|
|
14
|
+
"initialMoves": 30,
|
|
15
|
+
"finalMoves": 15,
|
|
16
|
+
"progressionSteps": 10
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"result": {
|
|
20
|
+
"configKey": "difficulty.curve",
|
|
21
|
+
"configValue": "easy_to_hard",
|
|
22
|
+
"format": "json-patch"
|
|
23
|
+
},
|
|
24
|
+
"binding": {
|
|
25
|
+
"role": "gameConfig",
|
|
26
|
+
"target": "game/config.json",
|
|
27
|
+
"type": "config-key-value",
|
|
28
|
+
"constraints": { "key": "difficulty.curve" }
|
|
29
|
+
},
|
|
30
|
+
"files": {
|
|
31
|
+
"skill": "SKILL.md"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: eight_ball_pool.aigameplay
|
|
3
|
+
description: 8球台球核心玩法封包 - 标准8球台球简化版 PGS 实现,支持瞄准、击球、进袋判定和胜负逻辑
|
|
4
|
+
triggers: 台球,billiards,pool,8ball,eight ball,撞球,球桌,球杆,瞄准,进袋,physics,物理,sports,体育
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# eight_ball_pool.aigameplay
|
|
8
|
+
|
|
9
|
+
8球台球核心玩法封包。实现标准8球台球简化版的 PGS (PlayCraft Gameplay Schema, 玩法定义规范) JSON 和 reducer。单人模式:先将自己的7个球(实心球1-7或条纹球9-15)全部打入球袋,再打黑色8号球入袋获胜。
|
|
10
|
+
|
|
11
|
+
## Recipe
|
|
12
|
+
|
|
13
|
+
- **玩法类型**:eight_ball_pool(台球)
|
|
14
|
+
- **参考文件**:
|
|
15
|
+
- `ref/pgs-schema.json`:PGS (PlayCraft Gameplay Schema, 玩法定义规范) 规则骨架(entities、rules、algorithm、testCases)
|
|
16
|
+
- `ref/reducer.template.ts`:reducer 接口约束模板(`init` / `dispatch` / `getState` + 分步函数)
|
|
17
|
+
- **核心规则**:
|
|
18
|
+
- `ballCount`: 16(1个白球 + 7个实心球 + 7个条纹球 + 1个8号黑球)
|
|
19
|
+
- `pocketCount`: 6(台球桌四角+两侧中点共6个球袋)
|
|
20
|
+
- `singlePlayer`: true(简化为单人模式)
|
|
21
|
+
- `physicsStepsPerFrame`: 10(物理模拟精度)
|
|
22
|
+
- **PGS Agent 操作流程**:
|
|
23
|
+
1. 读取 `ref/pgs-schema.json` 作为规则骨架起点
|
|
24
|
+
2. 读取 `ref/reducer.template.ts` 了解接口约束
|
|
25
|
+
3. 实现 `reducer.ts`,导出 `init(config)`、`dispatch(state, action)`、`getState(state)` 以及**全部分步函数**
|
|
26
|
+
4. 物理模拟抽象为简化模型:直线运动 + 弹性碰撞 + 球袋检测(不需要真实弹性系数)
|
|
27
|
+
5. 运行 `ref/pgs-schema.json` 中的所有 `testCases`,全部通过后才算完成
|
|
28
|
+
- **物理简化策略**:
|
|
29
|
+
- 球运动:每帧速度衰减(friction),直到速度 < 阈值停止
|
|
30
|
+
- 球碰撞:球心距 < 直径时,交换速度分量(弹性碰撞近似)
|
|
31
|
+
- 球袋检测:球心进入球袋区域半径内则进袋
|
|
32
|
+
- **可 fork 变体**:
|
|
33
|
+
- 双人对战:移除 `singlePlayer`,添加 `currentPlayer` 轮换逻辑
|
|
34
|
+
- 9球玩法:修改 `gameplayType` 为 `nine_ball`,调整胜负条件
|
|
35
|
+
- 障碍模式:在台球桌上增加固定障碍物实体
|
|
36
|
+
|
|
37
|
+
## Result
|
|
38
|
+
|
|
39
|
+
- **产物文件**:`reducer.ts`
|
|
40
|
+
- **格式**:TypeScript,导出 `init(config)`、`dispatch(action)`、`getState()` + 分步函数接口
|
|
41
|
+
- **验证**:所有 testCases 必须通过
|
|
42
|
+
|
|
43
|
+
## 渲染集成(⚠️ 场景层必读)
|
|
44
|
+
|
|
45
|
+
### 设计原则:物理循环与渲染分离
|
|
46
|
+
|
|
47
|
+
reducer 提供两套接口:
|
|
48
|
+
|
|
49
|
+
| 接口 | 适用场景 | 特点 |
|
|
50
|
+
|------|---------|------|
|
|
51
|
+
| `dispatch()` | 无头测试、AI 模拟 | 一步到位,只返回最终状态 |
|
|
52
|
+
| 分步函数 | **渲染层/GameScene** | 逐步执行,返回中间过程数据 |
|
|
53
|
+
|
|
54
|
+
### ⚠️ 渲染层必须使用分步函数驱动动画
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
// ✅ 正确做法:分步驱动
|
|
58
|
+
// Step 1: 设置瞄准
|
|
59
|
+
const aimed = aimCueBall(state, angle, power);
|
|
60
|
+
|
|
61
|
+
// Step 2: 击球 - 渲染层播放击球动画
|
|
62
|
+
const shotState = shootCueBall(aimed);
|
|
63
|
+
|
|
64
|
+
// Step 3: 物理帧循环(每帧调用直到所有球停止)
|
|
65
|
+
while (ballsMoving(shotState)) {
|
|
66
|
+
const nextState = applyPhysicsStep(shotState, dt);
|
|
67
|
+
await renderBallPositions(nextState.balls); // 更新精灵位置
|
|
68
|
+
|
|
69
|
+
// Step 4: 检测进袋
|
|
70
|
+
const pocketResult = checkPockets(nextState);
|
|
71
|
+
if (pocketResult.pocketed.length > 0) {
|
|
72
|
+
await playPocketAnimation(pocketResult.pocketed);
|
|
73
|
+
}
|
|
74
|
+
shotState = nextState;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Step 5: 判断回合
|
|
78
|
+
const turnState = determineTurn(shotState);
|
|
79
|
+
updateUIForTurn(turnState);
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Binding
|
|
83
|
+
|
|
84
|
+
- **Binding Role**:`gameplayRule`
|
|
85
|
+
- **挂载目标**:`game/gameplay/eight_ball_pool/reducer.ts`
|
|
86
|
+
- **引用类型**:`gameplay-module-reference`
|
|
87
|
+
- **接口契约**:`init(config)` / `dispatch(action)` / `getState()` / `aimCueBall()` / `shootCueBall()` / `applyPhysicsStep()` / `checkPockets()` / `determineTurn()`
|
|
88
|
+
|
|
89
|
+
## Skill Definition
|
|
90
|
+
|
|
91
|
+
tools:
|
|
92
|
+
- bash
|
|
93
|
+
- write
|
|
94
|
+
- read
|
|
95
|
+
prompt_extension: |
|
|
96
|
+
You are implementing an 8-ball pool gameplay module following the PGS specification.
|
|
97
|
+
Write the PGS JSON with entities, rules, algorithm, and testCases.
|
|
98
|
+
Implement the reducer.ts with:
|
|
99
|
+
- init/dispatch/getState (一体化接口,用于测试)
|
|
100
|
+
- aimCueBall/shootCueBall/applyPhysicsStep/checkPockets/determineTurn (分步函数,用于渲染层动画驱动)
|
|
101
|
+
Physics is abstracted: use simple linear motion with friction damping, elastic ball-ball collision (velocity exchange),
|
|
102
|
+
and pocket detection by proximity. No need for real physics engine.
|
|
103
|
+
Run the testCases to verify the logic before finalizing.
|
|
104
|
+
Apply the Binding to wire the reducer into the game's gameplay module path.
|