@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,155 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "big_watermelon.aigameplay",
|
|
4
|
+
"bundleType": "aigameplay",
|
|
5
|
+
"category": "gameplay",
|
|
6
|
+
"mode": "fixed",
|
|
7
|
+
"label": {
|
|
8
|
+
"zh": "合成西瓜玩法",
|
|
9
|
+
"en": "Big Watermelon (Merge Fruits) gameplay"
|
|
10
|
+
},
|
|
11
|
+
"tags": [
|
|
12
|
+
"gameplay",
|
|
13
|
+
"merge",
|
|
14
|
+
"physics",
|
|
15
|
+
"casual",
|
|
16
|
+
"drop",
|
|
17
|
+
"puzzle"
|
|
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": "background",
|
|
47
|
+
"description": "游戏背景图",
|
|
48
|
+
"bindAs": "bg",
|
|
49
|
+
"required": false,
|
|
50
|
+
"edgeKind": "compatibleWith",
|
|
51
|
+
"matchBindingRoles": [
|
|
52
|
+
"backgroundTexture"
|
|
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": "big_watermelon",
|
|
115
|
+
"rules": {
|
|
116
|
+
"fruitTiers": 11,
|
|
117
|
+
"gravity": 980,
|
|
118
|
+
"containerWidth": 400,
|
|
119
|
+
"containerHeight": 600,
|
|
120
|
+
"overflowLine": 80,
|
|
121
|
+
"nextFruitMaxTier": 5
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"result": {
|
|
125
|
+
"outputFile": "reducer.ts",
|
|
126
|
+
"format": "typescript",
|
|
127
|
+
"constraints": {
|
|
128
|
+
"testCasesMustPass": true
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"binding": {
|
|
132
|
+
"role": "gameplayRule",
|
|
133
|
+
"target": "game/gameplay/big_watermelon/reducer.ts",
|
|
134
|
+
"type": "gameplay-module-reference",
|
|
135
|
+
"constraints": {
|
|
136
|
+
"interface": [
|
|
137
|
+
"init(config)",
|
|
138
|
+
"dispatch(action)",
|
|
139
|
+
"getState()",
|
|
140
|
+
"aimFruit(state, x)",
|
|
141
|
+
"dropFruit(state)",
|
|
142
|
+
"applyPhysics(state, deltaMs)",
|
|
143
|
+
"checkMerges(state)",
|
|
144
|
+
"mergeFruits(state, fruitA, fruitB)",
|
|
145
|
+
"checkOverflow(state)",
|
|
146
|
+
"calculateScore(tier)"
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"files": {
|
|
151
|
+
"skill": "SKILL.md",
|
|
152
|
+
"pgsSchema": "ref/pgs-schema.json",
|
|
153
|
+
"reducerTemplate": "ref/reducer.template.ts"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "PGS (PlayCraft Gameplay Schema) 参考骨架 - 合成西瓜玩法。Agent 以此为起点编写或 fork 玩法规则。",
|
|
3
|
+
"version": "1.0",
|
|
4
|
+
"gameplayType": "big_watermelon",
|
|
5
|
+
"entities": {
|
|
6
|
+
"container": {
|
|
7
|
+
"type": "spatial",
|
|
8
|
+
"description": "竖向容器,水果在其中下落和堆叠",
|
|
9
|
+
"fields": {
|
|
10
|
+
"width": { "type": "number", "default": 400 },
|
|
11
|
+
"height": { "type": "number", "default": 600 },
|
|
12
|
+
"overflowLine": { "type": "number", "default": 80, "description": "溢出判定线 y 坐标(从顶部算),水果中心 y < overflowLine 且静止则游戏结束" }
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"fruits": {
|
|
16
|
+
"type": "entity-list",
|
|
17
|
+
"description": "容器内所有水果(含下落中和静止的)",
|
|
18
|
+
"item": {
|
|
19
|
+
"id": { "type": "string" },
|
|
20
|
+
"tier": {
|
|
21
|
+
"type": "number",
|
|
22
|
+
"range": [1, 11],
|
|
23
|
+
"description": "水果等级:1=葡萄, 2=樱桃, 3=草莓, 4=橙子, 5=柿子, 6=苹果, 7=梨, 8=桃子, 9=菠萝, 10=椰子, 11=西瓜"
|
|
24
|
+
},
|
|
25
|
+
"position": { "type": "vec2", "description": "圆心坐标" },
|
|
26
|
+
"velocity": { "type": "vec2", "description": "当前速度(px/s)" },
|
|
27
|
+
"radius": { "type": "number", "description": "碰撞圆半径,随 tier 增大" },
|
|
28
|
+
"state": { "type": "enum", "values": ["falling", "resting"], "default": "falling" }
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"score": {
|
|
32
|
+
"type": "counter",
|
|
33
|
+
"initial": 0,
|
|
34
|
+
"description": "当前得分"
|
|
35
|
+
},
|
|
36
|
+
"nextFruit": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"description": "下一个将要投放的水果预览",
|
|
39
|
+
"fields": {
|
|
40
|
+
"tier": { "type": "number", "range": [1, 5], "description": "随机生成,限制在前 5 级" }
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"currentFruit": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"description": "当前正在瞄准(未投放)的水果",
|
|
46
|
+
"fields": {
|
|
47
|
+
"tier": { "type": "number" },
|
|
48
|
+
"x": { "type": "number", "description": "水平瞄准位置" }
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"rules": {
|
|
53
|
+
"aim": {
|
|
54
|
+
"description": "玩家左右移动 currentFruit 的 x 位置",
|
|
55
|
+
"bounds": "clamp(x, currentFruit.radius, container.width - currentFruit.radius)"
|
|
56
|
+
},
|
|
57
|
+
"drop": {
|
|
58
|
+
"description": "玩家松手投放:currentFruit 转为下落中的 fruit 实体,velocity.y = 0,gravity 开始作用",
|
|
59
|
+
"effect": "fruits.push(新水果), 生成新的 nextFruit, currentFruit = nextFruit"
|
|
60
|
+
},
|
|
61
|
+
"collision_merge": {
|
|
62
|
+
"description": "两个相同 tier 的水果圆心距 < r1 + r2 时触发合并",
|
|
63
|
+
"steps": [
|
|
64
|
+
"1. 移除两个水果(fruits 中删除)",
|
|
65
|
+
"2. 若 tier < 11:在两圆心中点生成 tier+1 的新水果",
|
|
66
|
+
"3. 若 tier == 11(西瓜):score += 特殊大奖励,不生成更大水果",
|
|
67
|
+
"4. score += calculateScore(tier)"
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
"collision_rest": {
|
|
71
|
+
"description": "水果碰到容器底部或其他静止水果时速度归零,state 变为 resting",
|
|
72
|
+
"detection": "简化模拟:position.y + radius >= container.height(触底)或与 resting 水果圆心距 < r1 + r2"
|
|
73
|
+
},
|
|
74
|
+
"overflow_check": {
|
|
75
|
+
"description": "每帧检查:任何 resting 水果圆心 y < overflowLine → gameOver",
|
|
76
|
+
"note": "falling 状态的水果不触发溢出,只有静止后才检查"
|
|
77
|
+
},
|
|
78
|
+
"generate_next": {
|
|
79
|
+
"description": "投放后随机生成下一个水果",
|
|
80
|
+
"tierRange": [1, 5],
|
|
81
|
+
"distribution": "uniform"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"algorithm": {
|
|
85
|
+
"description": "主循环:aim → drop → physics → merge → overflow",
|
|
86
|
+
"steps": [
|
|
87
|
+
"1. 玩家左右滑动:aimFruit(x) 更新 currentFruit.x",
|
|
88
|
+
"2. 玩家点击投放:dropFruit() → 创建下落水果,生成 nextFruit",
|
|
89
|
+
"3. 每帧:applyPhysics(deltaMs)",
|
|
90
|
+
" 3a. 对所有 falling 水果:velocity.y += gravity * deltaMs / 1000",
|
|
91
|
+
" 3b. position += velocity * deltaMs / 1000",
|
|
92
|
+
" 3c. 检测底部碰撞和水果间碰撞,更新 state",
|
|
93
|
+
"4. checkMerges():检测所有相同 tier 的两两水果是否碰撞",
|
|
94
|
+
" 4a. 若碰撞:mergeFruits(fruitA, fruitB)",
|
|
95
|
+
"5. checkOverflow():检查是否有 resting 水果超过 overflowLine"
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
"winCondition": {
|
|
99
|
+
"type": "endless",
|
|
100
|
+
"description": "无胜利条件,玩法目标为尽可能提高分数"
|
|
101
|
+
},
|
|
102
|
+
"loseCondition": {
|
|
103
|
+
"type": "overflow",
|
|
104
|
+
"description": "任何静止水果的圆心 y 坐标 < container.overflowLine 时游戏结束"
|
|
105
|
+
},
|
|
106
|
+
"testCases": [
|
|
107
|
+
{
|
|
108
|
+
"id": "tc_drop_and_rest",
|
|
109
|
+
"description": "投放水果:水果下落后碰底静止",
|
|
110
|
+
"initialState": {
|
|
111
|
+
"container": { "width": 400, "height": 600, "overflowLine": 80 },
|
|
112
|
+
"fruits": [],
|
|
113
|
+
"score": 0,
|
|
114
|
+
"currentFruit": { "tier": 1, "x": 200 },
|
|
115
|
+
"nextFruit": { "tier": 2 },
|
|
116
|
+
"config": { "gravity": 980, "fruitRadii": [15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70] }
|
|
117
|
+
},
|
|
118
|
+
"actions": [
|
|
119
|
+
{ "type": "dropFruit" },
|
|
120
|
+
{ "type": "tick", "deltaMs": 1500 }
|
|
121
|
+
],
|
|
122
|
+
"expectedState": {
|
|
123
|
+
"fruits.length": 1,
|
|
124
|
+
"fruits[0].state": "resting",
|
|
125
|
+
"fruits[0].position.y": { "min": 570 },
|
|
126
|
+
"currentFruit.tier": 2,
|
|
127
|
+
"gameOver": false
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"id": "tc_merge_two_same_tier",
|
|
132
|
+
"description": "合并同级水果:两个等级1的水果接触后合并为等级2",
|
|
133
|
+
"initialState": {
|
|
134
|
+
"container": { "width": 400, "height": 600, "overflowLine": 80 },
|
|
135
|
+
"fruits": [
|
|
136
|
+
{ "id": "f1", "tier": 1, "position": { "x": 200, "y": 560 }, "velocity": { "x": 0, "y": 0 }, "radius": 15, "state": "resting" },
|
|
137
|
+
{ "id": "f2", "tier": 1, "position": { "x": 226, "y": 560 }, "velocity": { "x": 0, "y": 0 }, "radius": 15, "state": "resting" }
|
|
138
|
+
],
|
|
139
|
+
"score": 0,
|
|
140
|
+
"currentFruit": { "tier": 3, "x": 100 },
|
|
141
|
+
"nextFruit": { "tier": 1 }
|
|
142
|
+
},
|
|
143
|
+
"actions": [
|
|
144
|
+
{ "type": "checkMerges" }
|
|
145
|
+
],
|
|
146
|
+
"expectedState": {
|
|
147
|
+
"fruits.length": 1,
|
|
148
|
+
"fruits[0].tier": 2,
|
|
149
|
+
"score": { "min": 10 }
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"id": "tc_overflow_game_over",
|
|
154
|
+
"description": "溢出失败:静止水果堆积超过顶线,游戏结束",
|
|
155
|
+
"initialState": {
|
|
156
|
+
"container": { "width": 400, "height": 600, "overflowLine": 80 },
|
|
157
|
+
"fruits": [
|
|
158
|
+
{ "id": "f1", "tier": 5, "position": { "x": 200, "y": 60 }, "velocity": { "x": 0, "y": 0 }, "radius": 35, "state": "resting" }
|
|
159
|
+
],
|
|
160
|
+
"score": 500,
|
|
161
|
+
"currentFruit": { "tier": 1, "x": 200 },
|
|
162
|
+
"nextFruit": { "tier": 2 }
|
|
163
|
+
},
|
|
164
|
+
"actions": [
|
|
165
|
+
{ "type": "checkOverflow" }
|
|
166
|
+
],
|
|
167
|
+
"expectedState": {
|
|
168
|
+
"gameOver": true,
|
|
169
|
+
"win": false
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"id": "tc_aim_clamped",
|
|
174
|
+
"description": "边界钳制:瞄准位置不能超出容器边界",
|
|
175
|
+
"initialState": {
|
|
176
|
+
"container": { "width": 400, "height": 600, "overflowLine": 80 },
|
|
177
|
+
"fruits": [],
|
|
178
|
+
"score": 0,
|
|
179
|
+
"currentFruit": { "tier": 1, "x": 200 },
|
|
180
|
+
"nextFruit": { "tier": 2 },
|
|
181
|
+
"config": { "fruitRadii": [15] }
|
|
182
|
+
},
|
|
183
|
+
"actions": [
|
|
184
|
+
{ "type": "aimFruit", "x": -50 }
|
|
185
|
+
],
|
|
186
|
+
"expectedState": {
|
|
187
|
+
"currentFruit.x": 15
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* big_watermelon.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
|
+
* 此 reducer 提供简化物理模拟(圆形碰撞体、重力积分)。
|
|
21
|
+
* 实际项目推荐将物理计算交给 Matter.js 或 Phaser Arcade Physics,
|
|
22
|
+
* 每帧结束后将物理引擎的位置/速度数据写回 state.fruits。
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
// ─── 配置类型 ─────────────────────────────────────────────────────────────────
|
|
26
|
+
|
|
27
|
+
export type Vec2 = { x: number; y: number };
|
|
28
|
+
|
|
29
|
+
export type BigWatermelonConfig = {
|
|
30
|
+
/** 容器宽度(px) */
|
|
31
|
+
containerWidth: number;
|
|
32
|
+
/** 容器高度(px) */
|
|
33
|
+
containerHeight: number;
|
|
34
|
+
/** 溢出判定线(距顶部 y 坐标,px) */
|
|
35
|
+
overflowLine: number;
|
|
36
|
+
/** 重力加速度(px/s²) */
|
|
37
|
+
gravity: number;
|
|
38
|
+
/** 每个等级水果的半径(索引 0 = tier 1) */
|
|
39
|
+
fruitRadii: [number, number, number, number, number, number, number, number, number, number, number];
|
|
40
|
+
/** 下一个水果的最大等级(随机范围 1~nextFruitMaxTier) */
|
|
41
|
+
nextFruitMaxTier: number;
|
|
42
|
+
/** 弹性系数(碰撞时速度保留比例,0~1) */
|
|
43
|
+
restitution: number;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// ─── 动作类型 ─────────────────────────────────────────────────────────────────
|
|
47
|
+
|
|
48
|
+
export type BigWatermelonAction =
|
|
49
|
+
| { type: 'aimFruit'; x: number }
|
|
50
|
+
| { type: 'dropFruit' }
|
|
51
|
+
| { type: 'tick'; deltaMs: number }
|
|
52
|
+
| { type: 'checkMerges' }
|
|
53
|
+
| { type: 'checkOverflow' }
|
|
54
|
+
| { type: 'reset' };
|
|
55
|
+
|
|
56
|
+
// ─── 状态类型 ─────────────────────────────────────────────────────────────────
|
|
57
|
+
|
|
58
|
+
export type FruitPhysicsState = 'falling' | 'resting';
|
|
59
|
+
|
|
60
|
+
export type Fruit = {
|
|
61
|
+
id: string;
|
|
62
|
+
/** 水果等级 1~11 */
|
|
63
|
+
tier: number;
|
|
64
|
+
/** 圆心坐标 */
|
|
65
|
+
position: Vec2;
|
|
66
|
+
/** 速度(px/s) */
|
|
67
|
+
velocity: Vec2;
|
|
68
|
+
/** 碰撞圆半径 */
|
|
69
|
+
radius: number;
|
|
70
|
+
state: FruitPhysicsState;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export type BigWatermelonState = {
|
|
74
|
+
fruits: Fruit[];
|
|
75
|
+
score: number;
|
|
76
|
+
currentFruit: {
|
|
77
|
+
tier: number;
|
|
78
|
+
x: number;
|
|
79
|
+
radius: number;
|
|
80
|
+
};
|
|
81
|
+
nextFruit: {
|
|
82
|
+
tier: number;
|
|
83
|
+
};
|
|
84
|
+
gameOver: boolean;
|
|
85
|
+
win: false;
|
|
86
|
+
lastMergeEvents: MergeEvent[];
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// ─── 分步操作返回类型 ─────────────────────────────────────────────────────────
|
|
90
|
+
|
|
91
|
+
export type MergeEvent = {
|
|
92
|
+
fruitAId: string;
|
|
93
|
+
fruitBId: string;
|
|
94
|
+
mergedTier: number;
|
|
95
|
+
mergePos: Vec2;
|
|
96
|
+
scoreGained: number;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
100
|
+
// 必须导出的函数
|
|
101
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
102
|
+
|
|
103
|
+
// ─── 初始化 ──────────────────────────────────────────────────────────────────
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* init:根据配置初始化游戏状态
|
|
107
|
+
*/
|
|
108
|
+
export declare function init(config: BigWatermelonConfig): BigWatermelonState;
|
|
109
|
+
|
|
110
|
+
// ─── 一体化接口(测试/AI 模拟用) ───────────────────────────────────────────
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* dispatch:接收动作,返回新状态(纯函数,不得修改原 state)
|
|
114
|
+
*
|
|
115
|
+
* ⚠️ 仅用于无头测试和 AI 模拟。渲染层请使用下方分步函数。
|
|
116
|
+
*/
|
|
117
|
+
export declare function dispatch(state: BigWatermelonState, action: BigWatermelonAction): BigWatermelonState;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* getState:返回当前状态快照
|
|
121
|
+
*/
|
|
122
|
+
export declare function getState(state: BigWatermelonState): BigWatermelonState;
|
|
123
|
+
|
|
124
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
125
|
+
// 分步函数(渲染层/场景层必须使用这些函数驱动动画)
|
|
126
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* aimFruit:玩家左右移动当前水果的水平位置
|
|
130
|
+
* 场景层根据返回的 currentFruit 更新瞄准线和预览水果精灵 x 坐标
|
|
131
|
+
*
|
|
132
|
+
* x 会被钳制在 [radius, containerWidth - radius] 范围内
|
|
133
|
+
*/
|
|
134
|
+
export declare function aimFruit(
|
|
135
|
+
state: BigWatermelonState,
|
|
136
|
+
x: number,
|
|
137
|
+
): { currentFruit: BigWatermelonState['currentFruit'] };
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* dropFruit:投放当前水果,生成下一个预览水果
|
|
141
|
+
* 场景层创建物理刚体,设置初始速度 y=0,开始受重力影响
|
|
142
|
+
*/
|
|
143
|
+
export declare function dropFruit(
|
|
144
|
+
state: BigWatermelonState,
|
|
145
|
+
): {
|
|
146
|
+
droppedFruit: Fruit;
|
|
147
|
+
nextFruit: BigWatermelonState['nextFruit'];
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* applyPhysics:推进物理模拟一帧
|
|
152
|
+
* 对所有 falling 状态的水果:
|
|
153
|
+
* - velocity.y += gravity * deltaMs / 1000
|
|
154
|
+
* - position += velocity * deltaMs / 1000
|
|
155
|
+
* - 检测底部和容器壁碰撞
|
|
156
|
+
* - 检测与 resting 水果的碰撞,碰撞后 state = resting
|
|
157
|
+
*
|
|
158
|
+
* 场景层根据返回的 fruits 数组逐个更新精灵位置(x, y)
|
|
159
|
+
*/
|
|
160
|
+
export declare function applyPhysics(
|
|
161
|
+
state: BigWatermelonState,
|
|
162
|
+
deltaMs: number,
|
|
163
|
+
): Fruit[];
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* checkMerges:检测所有相同 tier 的水果是否发生碰撞触发合并
|
|
167
|
+
* 返回所有合并事件,场景层根据 mergePos 播放合并特效
|
|
168
|
+
*
|
|
169
|
+
* 合并规则:两个圆心距 < r1 + r2,且 tier 相同
|
|
170
|
+
* 合并结果:移除两个旧水果,在 mergePos 生成 tier+1 新水果
|
|
171
|
+
*/
|
|
172
|
+
export declare function checkMerges(
|
|
173
|
+
state: BigWatermelonState,
|
|
174
|
+
): MergeEvent[];
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* mergeFruits:执行一次具体的合并操作
|
|
178
|
+
* 场景层在播放合并动画(两球缩小 → 中点生成新球)后调用
|
|
179
|
+
*/
|
|
180
|
+
export declare function mergeFruits(
|
|
181
|
+
state: BigWatermelonState,
|
|
182
|
+
fruitAId: string,
|
|
183
|
+
fruitBId: string,
|
|
184
|
+
): {
|
|
185
|
+
newFruit: Fruit;
|
|
186
|
+
score: number;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* checkOverflow:检查是否有静止水果超过溢出线
|
|
191
|
+
* 场景层在每次水果静止后调用
|
|
192
|
+
* gameOver=true 时场景层触发失败面板动画
|
|
193
|
+
*/
|
|
194
|
+
export declare function checkOverflow(
|
|
195
|
+
state: BigWatermelonState,
|
|
196
|
+
): { gameOver: boolean; overflowFruitId: string | null };
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* calculateScore:计算合并该等级水果所得的分数
|
|
200
|
+
* 公式建议:tier^2 * 10(等级越高得分指数级增长)
|
|
201
|
+
*/
|
|
202
|
+
export declare function calculateScore(tier: number): number;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: block_puzzle.aigameplay
|
|
3
|
+
description: 方块放置消行玩法封包 - 经典俄罗斯方块变体的 PGS 实现,在网格上放置多米诺方块消除整行/整列
|
|
4
|
+
triggers: 方块放置,block puzzle,消行,消列,方块,polyomino,放置,placement,棋盘,grid,玩法,gameplay
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# block_puzzle.aigameplay
|
|
8
|
+
|
|
9
|
+
方块放置消行玩法封包。实现经典方块放置规则的 PGS JSON 和 reducer,玩家从 3 个候选方块中选择并放置在 10×10 网格上,当一行或一列完全填满时自动消除并得分。
|
|
10
|
+
|
|
11
|
+
## Recipe
|
|
12
|
+
|
|
13
|
+
- **玩法类型**:block_puzzle(方块放置消行)
|
|
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
|
+
- `boardSize`: 10×10(默认网格大小)
|
|
19
|
+
- `pieceSlots`: 3(每次提供 3 个候选方块)
|
|
20
|
+
- `rotation`: false(方块不可旋转)
|
|
21
|
+
- `gravity`: false(方块放下后不下落,固定在放置位置)
|
|
22
|
+
- `clearFullLines`: true(填满整行立即消除)
|
|
23
|
+
- `clearFullColumns`: true(填满整列立即消除)
|
|
24
|
+
- **PGS Agent 操作流程**:
|
|
25
|
+
1. 读取 `ref/pgs-schema.json` 作为规则骨架起点
|
|
26
|
+
2. 读取 `ref/reducer.template.ts` 了解接口约束
|
|
27
|
+
3. 实现 `reducer.ts`,导出 `init(config)`、`dispatch(state, action)`、`getState(state)` 以及**全部分步函数**
|
|
28
|
+
4. 运行 `ref/pgs-schema.json` 中的所有 `testCases`,全部通过后才算完成
|
|
29
|
+
5. 更新 manifest 的 `generation.pgsVersion` 和 `result.outputFile`
|
|
30
|
+
- **可 fork 变体**:
|
|
31
|
+
- 更大棋盘:修改 `boardCols`/`boardRows` 至 8×8 或 12×12
|
|
32
|
+
- 允许旋转:修改 `rotation` 为 true,增加旋转规则
|
|
33
|
+
- 限时模式:添加 `timeLimitSeconds` 规则
|
|
34
|
+
|
|
35
|
+
## Result
|
|
36
|
+
|
|
37
|
+
- **产物文件**:`reducer.ts`
|
|
38
|
+
- **格式**:TypeScript,导出 `init(config)`、`dispatch(state, action)`、`getState(state)` + 分步函数接口
|
|
39
|
+
- **验证**:所有 testCases 必须通过
|
|
40
|
+
|
|
41
|
+
## 渲染集成(⚠️ 场景层必读)
|
|
42
|
+
|
|
43
|
+
### 设计原则:逻辑与动画分离
|
|
44
|
+
|
|
45
|
+
reducer 提供两套接口:
|
|
46
|
+
|
|
47
|
+
| 接口 | 适用场景 | 特点 |
|
|
48
|
+
|------|---------|------|
|
|
49
|
+
| `dispatch()` | 无头测试、AI 模拟、跳过动画 | 一步到位,只返回最终状态 |
|
|
50
|
+
| 分步函数 | **渲染层/GameScene** | 逐步执行,返回中间过程数据 |
|
|
51
|
+
|
|
52
|
+
### ⚠️ 禁止在渲染层使用 dispatch() 然后全量重建棋盘
|
|
53
|
+
|
|
54
|
+
正确做法是**分步驱动动画链**:
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
// ✅ 正确做法:逐步调用分步函数,每步之间插入动画
|
|
58
|
+
// Step 1: 验证放置是否合法(拖拽过程中实时高亮)
|
|
59
|
+
const canPlace = canPlacePiece(state, selectedPiece, position);
|
|
60
|
+
highlightCells(canPlace ? 'valid' : 'invalid', selectedPiece, position);
|
|
61
|
+
|
|
62
|
+
// Step 2: 放置方块,固定到棋盘
|
|
63
|
+
const { placedCells, newState } = placePiece(state, selectedPiece, position);
|
|
64
|
+
await playPlaceAnimation(placedCells); // 只对新放置的格子播放落地动画
|
|
65
|
+
|
|
66
|
+
// Step 3: 检测并消除完整行/列
|
|
67
|
+
const { clearedRows, clearedCols, score } = clearLines(newState);
|
|
68
|
+
if (clearedRows.length > 0 || clearedCols.length > 0) {
|
|
69
|
+
await playClearAnimation(clearedRows, clearedCols); // 播放消除闪光动画
|
|
70
|
+
updateScoreUI(score);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Step 4: 补充新方块(若已用完 3 个槽位)
|
|
74
|
+
if (newState.pieceQueue.length === 0) {
|
|
75
|
+
const newPieces = generatePieces(3, config.colorCount);
|
|
76
|
+
updatePieceTray(newPieces);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Step 5: 检测游戏结束
|
|
80
|
+
const gameOver = newState.pieceQueue.every(p => !canPlaceAnywhere(newState, p));
|
|
81
|
+
if (gameOver) { playGameOverAnimation(); }
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 分步函数返回值与动画映射
|
|
85
|
+
|
|
86
|
+
| 分步函数 | 返回值 | 场景层动画 |
|
|
87
|
+
|---------|--------|-----------|
|
|
88
|
+
| `canPlacePiece()` | `boolean` | 实时高亮放置区域(绿色/红色遮罩) |
|
|
89
|
+
| `placePiece()` | `{ placedCells, newState }` | 对新放置的格子播放落地震动/缩放动画 |
|
|
90
|
+
| `clearLines()` | `{ clearedRows, clearedCols, score, clearedCells }` | 对被消除的行/列播放消除闪光 + 消失动画 |
|
|
91
|
+
| `generatePieces()` | `Piece[]` | 新方块滑入候选区动画 |
|
|
92
|
+
|
|
93
|
+
## Binding
|
|
94
|
+
|
|
95
|
+
- **Binding Role**:`gameplayRule`
|
|
96
|
+
- **挂载目标**:`game/gameplay/block_puzzle/reducer.ts`
|
|
97
|
+
- **引用类型**:`gameplay-module-reference`
|
|
98
|
+
- **接口契约**:`init(config)` / `dispatch(state, action)` / `getState(state)` / `canPlacePiece()` / `placePiece()` / `clearLines()` / `generatePieces()`
|
|
99
|
+
|
|
100
|
+
## Skill Definition
|
|
101
|
+
|
|
102
|
+
tools:
|
|
103
|
+
- bash
|
|
104
|
+
- write
|
|
105
|
+
- read
|
|
106
|
+
prompt_extension: |
|
|
107
|
+
You are implementing a block puzzle (placement) core gameplay module following the PGS specification.
|
|
108
|
+
Write the PGS JSON with entities, rules, algorithm, and testCases.
|
|
109
|
+
Implement the reducer.ts with:
|
|
110
|
+
- init/dispatch/getState (一体化接口,用于测试)
|
|
111
|
+
- canPlacePiece/placePiece/clearLines/generatePieces (分步函数,用于渲染层动画驱动)
|
|
112
|
+
Key constraints:
|
|
113
|
+
- Board is 10×10 by default; pieces are polyomino shapes (collections of cells)
|
|
114
|
+
- No rotation, no gravity — pieces are fixed at placement position
|
|
115
|
+
- Clear full rows AND full columns simultaneously
|
|
116
|
+
- Score multiplier when multiple lines cleared at once
|
|
117
|
+
- Lose when none of the 3 available pieces can be placed anywhere on the board
|
|
118
|
+
- After all 3 pieces are used, generate 3 new random pieces
|
|
119
|
+
The step-by-step functions are CRITICAL for drag-to-place and clear animations.
|
|
120
|
+
Run the testCases to verify the logic before finalizing.
|
|
121
|
+
Apply the Binding to wire the reducer into the game's gameplay module path.
|