@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,229 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "PGS (PlayCraft Gameplay Schema) 参考骨架 - 篮球投篮玩法。Agent 以此为起点编写或 fork 玩法规则。",
|
|
3
|
+
"version": "1.0",
|
|
4
|
+
"gameplayType": "basketball_shot",
|
|
5
|
+
"entities": {
|
|
6
|
+
"hoop": {
|
|
7
|
+
"type": "target",
|
|
8
|
+
"description": "篮筐,固定位置",
|
|
9
|
+
"fields": {
|
|
10
|
+
"position": { "type": "vector2", "description": "篮筐中心坐标 {x, y}" },
|
|
11
|
+
"radius": { "type": "number", "value": 45, "description": "篮筐内径半径(像素)" },
|
|
12
|
+
"rimY": { "type": "number", "description": "篮筐顶部 y 坐标,球必须从上方穿过此线" }
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"ball": {
|
|
16
|
+
"type": "projectile",
|
|
17
|
+
"description": "篮球,抛物线运动",
|
|
18
|
+
"fields": {
|
|
19
|
+
"position": { "type": "vector2", "description": "当前位置 {x, y}" },
|
|
20
|
+
"velocity": { "type": "vector2", "description": "当前速度 {vx, vy}" },
|
|
21
|
+
"inFlight": { "type": "boolean", "default": false }
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"player_position": {
|
|
25
|
+
"type": "spawn-point",
|
|
26
|
+
"description": "玩家投篮位置(不同关卡有不同距离/角度)",
|
|
27
|
+
"fields": {
|
|
28
|
+
"position": { "type": "vector2" },
|
|
29
|
+
"distance": { "type": "number", "description": "距篮筐距离(米),影响难度" }
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"score": {
|
|
33
|
+
"type": "counter",
|
|
34
|
+
"initial": 0,
|
|
35
|
+
"description": "当前得分"
|
|
36
|
+
},
|
|
37
|
+
"shots_remaining": {
|
|
38
|
+
"type": "counter",
|
|
39
|
+
"description": "剩余投篮次数",
|
|
40
|
+
"initial": 10
|
|
41
|
+
},
|
|
42
|
+
"combo_count": {
|
|
43
|
+
"type": "counter",
|
|
44
|
+
"initial": 0,
|
|
45
|
+
"description": "当前连续命中次数"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"rules": {
|
|
49
|
+
"aim": {
|
|
50
|
+
"description": "玩家设置投篮角度和力度",
|
|
51
|
+
"fields": {
|
|
52
|
+
"angle": { "type": "number", "range": [10, 85], "description": "投篮仰角(度),相对于水平方向" },
|
|
53
|
+
"power": { "type": "number", "range": [0, 100], "description": "力度百分比,决定初速度大小" }
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"shoot": {
|
|
57
|
+
"description": "将力度和角度转换为初始速度向量,球开始飞行",
|
|
58
|
+
"formula": {
|
|
59
|
+
"vx": "cos(angle) × power × maxSpeed",
|
|
60
|
+
"vy": "-sin(angle) × power × maxSpeed"
|
|
61
|
+
},
|
|
62
|
+
"effect": "ball.inFlight = true; shots_remaining--"
|
|
63
|
+
},
|
|
64
|
+
"trajectory": {
|
|
65
|
+
"description": "抛物线物理模拟",
|
|
66
|
+
"formula": {
|
|
67
|
+
"x(t)": "x0 + vx × t",
|
|
68
|
+
"y(t)": "y0 + vy × t + 0.5 × gravity × t²",
|
|
69
|
+
"vy(t)": "vy0 + gravity × t"
|
|
70
|
+
},
|
|
71
|
+
"gravity": 980,
|
|
72
|
+
"description2": "重力单位 px/s²,每帧 dt 秒更新位置"
|
|
73
|
+
},
|
|
74
|
+
"hoop_check": {
|
|
75
|
+
"description": "入筐检测:球从 rimY 上方穿越到下方,且球心 x 在筐内",
|
|
76
|
+
"conditions": [
|
|
77
|
+
"ball.prev_y < hoop.rimY AND ball.y >= hoop.rimY",
|
|
78
|
+
"abs(ball.x - hoop.position.x) <= hoop.radius × (1 + rimTolerance)"
|
|
79
|
+
],
|
|
80
|
+
"rimTolerance": 0.15,
|
|
81
|
+
"scoreOnHit": "baseScore × comboMultiplier",
|
|
82
|
+
"baseScore": 100
|
|
83
|
+
},
|
|
84
|
+
"rim_miss": {
|
|
85
|
+
"description": "球碰到篮筐边缘但未入筐(可选:添加弹跳效果)",
|
|
86
|
+
"trigger": "ball within rim band but fails hoop_check",
|
|
87
|
+
"effect": "ball bounces off rim (optional visual)"
|
|
88
|
+
},
|
|
89
|
+
"combo": {
|
|
90
|
+
"description": "连续命中加成:每次命中 combo_count++,倍率 = 1 + combo_count × 0.5",
|
|
91
|
+
"comboMultiplierStep": 0.5,
|
|
92
|
+
"maxMultiplier": 5.0,
|
|
93
|
+
"resetOnMiss": true
|
|
94
|
+
},
|
|
95
|
+
"miss": {
|
|
96
|
+
"description": "球落地或飞出边界且未入筐",
|
|
97
|
+
"effect": "combo_count = 0"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"algorithm": {
|
|
101
|
+
"description": "主循环:aim → shoot → simulate_trajectory → hoop_check → score → repeat",
|
|
102
|
+
"steps": [
|
|
103
|
+
"1. 玩家设置投篮角度和力度",
|
|
104
|
+
"2. 确认投篮:shots_remaining--,计算初始速度向量",
|
|
105
|
+
"3. 每帧更新球的位置(抛物线物理:位移 = 速度×dt,vy += gravity×dt)",
|
|
106
|
+
"4. 每帧检测入筐:球穿过 rimY 且 x 在筐内",
|
|
107
|
+
"5. 入筐:score += baseScore × comboMultiplier;combo_count++;ball 重置",
|
|
108
|
+
"6. 落地/出界:combo_count = 0;ball 重置",
|
|
109
|
+
"7. 检测胜负:shots_remaining==0 时检查 score >= goalScore"
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"winCondition": {
|
|
113
|
+
"type": "score_goal",
|
|
114
|
+
"description": "在 shots_remaining 耗尽前达到 goalScore(由 config 中定义)"
|
|
115
|
+
},
|
|
116
|
+
"loseCondition": {
|
|
117
|
+
"type": "shots_exhausted",
|
|
118
|
+
"description": "shots_remaining == 0 且 score < goalScore"
|
|
119
|
+
},
|
|
120
|
+
"testCases": [
|
|
121
|
+
{
|
|
122
|
+
"id": "tc_perfect_shot",
|
|
123
|
+
"description": "完美入筐:正确角度和力度,球穿过篮筐中心",
|
|
124
|
+
"initialState": {
|
|
125
|
+
"ball": { "position": { "x": 200, "y": 600 }, "inFlight": false },
|
|
126
|
+
"hoop": { "position": { "x": 600, "y": 300 }, "radius": 45, "rimY": 300 },
|
|
127
|
+
"score": 0,
|
|
128
|
+
"shots_remaining": 5,
|
|
129
|
+
"combo_count": 0
|
|
130
|
+
},
|
|
131
|
+
"actions": [
|
|
132
|
+
{ "type": "aim", "angle": 45, "power": 65 },
|
|
133
|
+
{ "type": "shoot" },
|
|
134
|
+
{ "type": "simulate_until_land" }
|
|
135
|
+
],
|
|
136
|
+
"expectedState": {
|
|
137
|
+
"scored": true,
|
|
138
|
+
"score": 100,
|
|
139
|
+
"combo_count": 1,
|
|
140
|
+
"shots_remaining": 4
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"id": "tc_rim_miss",
|
|
145
|
+
"description": "打铁:球碰到篮筐边缘但未入筐",
|
|
146
|
+
"initialState": {
|
|
147
|
+
"ball": { "position": { "x": 200, "y": 600 }, "inFlight": false },
|
|
148
|
+
"hoop": { "position": { "x": 600, "y": 300 }, "radius": 45, "rimY": 300 },
|
|
149
|
+
"score": 0,
|
|
150
|
+
"shots_remaining": 5,
|
|
151
|
+
"combo_count": 2
|
|
152
|
+
},
|
|
153
|
+
"actions": [
|
|
154
|
+
{ "type": "aim", "angle": 45, "power": 50 },
|
|
155
|
+
{ "type": "shoot" },
|
|
156
|
+
{ "type": "simulate_until_land" }
|
|
157
|
+
],
|
|
158
|
+
"expectedState": {
|
|
159
|
+
"scored": false,
|
|
160
|
+
"combo_count": 0,
|
|
161
|
+
"shots_remaining": 4
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"id": "tc_combo_multiplier",
|
|
166
|
+
"description": "连击加成:连续命中3次,第3次得分翻倍",
|
|
167
|
+
"initialState": {
|
|
168
|
+
"ball": { "position": { "x": 200, "y": 600 }, "inFlight": false },
|
|
169
|
+
"hoop": { "position": { "x": 600, "y": 300 }, "radius": 45, "rimY": 300 },
|
|
170
|
+
"score": 200,
|
|
171
|
+
"shots_remaining": 5,
|
|
172
|
+
"combo_count": 2
|
|
173
|
+
},
|
|
174
|
+
"actions": [
|
|
175
|
+
{ "type": "aim", "angle": 45, "power": 65 },
|
|
176
|
+
{ "type": "shoot" },
|
|
177
|
+
{ "type": "simulate_until_land" }
|
|
178
|
+
],
|
|
179
|
+
"expectedState": {
|
|
180
|
+
"scored": true,
|
|
181
|
+
"combo_count": 3,
|
|
182
|
+
"score": 400,
|
|
183
|
+
"score_gained": 200
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"id": "tc_win",
|
|
188
|
+
"description": "胜利:最后一投命中,总分达到目标",
|
|
189
|
+
"initialState": {
|
|
190
|
+
"score": 900,
|
|
191
|
+
"goalScore": 1000,
|
|
192
|
+
"shots_remaining": 1,
|
|
193
|
+
"combo_count": 0
|
|
194
|
+
},
|
|
195
|
+
"actions": [
|
|
196
|
+
{ "type": "aim", "angle": 45, "power": 65 },
|
|
197
|
+
{ "type": "shoot" },
|
|
198
|
+
{ "type": "simulate_until_land" }
|
|
199
|
+
],
|
|
200
|
+
"expectedState": {
|
|
201
|
+
"scored": true,
|
|
202
|
+
"gameOver": true,
|
|
203
|
+
"win": true,
|
|
204
|
+
"score": { "min": 1000 }
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"id": "tc_lose",
|
|
209
|
+
"description": "失败:最后一投未中,分数不达标",
|
|
210
|
+
"initialState": {
|
|
211
|
+
"score": 500,
|
|
212
|
+
"goalScore": 1000,
|
|
213
|
+
"shots_remaining": 1,
|
|
214
|
+
"combo_count": 0
|
|
215
|
+
},
|
|
216
|
+
"actions": [
|
|
217
|
+
{ "type": "aim", "angle": 20, "power": 30 },
|
|
218
|
+
{ "type": "shoot" },
|
|
219
|
+
{ "type": "simulate_until_land" }
|
|
220
|
+
],
|
|
221
|
+
"expectedState": {
|
|
222
|
+
"scored": false,
|
|
223
|
+
"shots_remaining": 0,
|
|
224
|
+
"gameOver": true,
|
|
225
|
+
"win": false
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* basketball_shot.aigameplay — reducer 接口模板
|
|
3
|
+
*
|
|
4
|
+
* Agent 生成实际 reducer 时,必须导出以下函数。
|
|
5
|
+
* 此文件是接口约束模板,不是可执行代码。
|
|
6
|
+
*
|
|
7
|
+
* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
8
|
+
* ⚠️ 重要:渲染层(GameScene)不应直接调用 dispatch()
|
|
9
|
+
*
|
|
10
|
+
* dispatch() 一步完成整个投篮模拟,丢失中间轨迹数据。
|
|
11
|
+
* 渲染层需要播放球的飞行动画,必须使用 calculateTrajectory
|
|
12
|
+
* 获取轨迹点列表,逐帧插值渲染球的位置。
|
|
13
|
+
*
|
|
14
|
+
* dispatch() 的用途:无头测试、AI 模拟、批量计算等场景。
|
|
15
|
+
* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
// ─── 配置类型 ─────────────────────────────────────────────────────────────────
|
|
19
|
+
|
|
20
|
+
export type BasketballConfig = {
|
|
21
|
+
/** 重力加速度(像素/秒²),默认 980 */
|
|
22
|
+
gravity: number;
|
|
23
|
+
/** 最大初始速度(像素/秒) */
|
|
24
|
+
maxSpeed: number;
|
|
25
|
+
/** 连击倍率步进,默认 0.5(每次连击增加 0.5x) */
|
|
26
|
+
comboMultiplierStep: number;
|
|
27
|
+
/** 入筐容差系数,默认 0.15(增大让入筐更宽松) */
|
|
28
|
+
rimTolerance: number;
|
|
29
|
+
/** 每关投篮次数 */
|
|
30
|
+
initialShots: number;
|
|
31
|
+
/** 目标分数 */
|
|
32
|
+
goalScore: number;
|
|
33
|
+
/** 每次投中基础分 */
|
|
34
|
+
baseScore: number;
|
|
35
|
+
/** 模拟步长(秒),默认 1/120 */
|
|
36
|
+
simulationStep: number;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// ─── 核心类型 ─────────────────────────────────────────────────────────────────
|
|
40
|
+
|
|
41
|
+
export type Vector2 = { x: number; y: number };
|
|
42
|
+
|
|
43
|
+
export type Hoop = {
|
|
44
|
+
position: Vector2; // 篮筐中心
|
|
45
|
+
radius: number; // 篮筐内径半径
|
|
46
|
+
rimY: number; // 篮筐顶部 y(球必须从上方穿过)
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export type PlayerPosition = {
|
|
50
|
+
position: Vector2; // 玩家(球的起始位置)
|
|
51
|
+
label?: string; // 例如 "3-point line", "mid-range"
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// ─── 动作类型 ─────────────────────────────────────────────────────────────────
|
|
55
|
+
|
|
56
|
+
export type BasketballAction =
|
|
57
|
+
| { type: 'aim'; angle: number; power: number } // 设置投篮参数
|
|
58
|
+
| { type: 'shoot'; angle: number; power: number } // 投篮(一步完成)
|
|
59
|
+
| { type: 'reset' };
|
|
60
|
+
|
|
61
|
+
// ─── 状态类型 ─────────────────────────────────────────────────────────────────
|
|
62
|
+
|
|
63
|
+
export type BasketballState = {
|
|
64
|
+
hoop: Hoop;
|
|
65
|
+
playerPosition: PlayerPosition;
|
|
66
|
+
score: number;
|
|
67
|
+
shotsRemaining: number;
|
|
68
|
+
comboCount: number;
|
|
69
|
+
/** 当前连击倍率 = 1 + comboCount × comboMultiplierStep */
|
|
70
|
+
comboMultiplier: number;
|
|
71
|
+
gameOver: boolean;
|
|
72
|
+
win: boolean;
|
|
73
|
+
/** 上一次投篮是否命中 */
|
|
74
|
+
lastShotScored: boolean;
|
|
75
|
+
/** 上一次投篮轨迹(用于渲染层 replay 或回放) */
|
|
76
|
+
lastTrajectory: TrajectoryPoint[] | null;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// ─── 分步操作返回类型 ─────────────────────────────────────────────────────────
|
|
80
|
+
|
|
81
|
+
/** 轨迹点(位置 + 时间戳) */
|
|
82
|
+
export type TrajectoryPoint = {
|
|
83
|
+
position: Vector2;
|
|
84
|
+
t: number; // 飞行时间(秒)
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/** 投篮模拟结果 */
|
|
88
|
+
export type ShotResult = {
|
|
89
|
+
trajectoryPoints: TrajectoryPoint[]; // 完整轨迹点列表
|
|
90
|
+
scored: boolean; // 是否入筐
|
|
91
|
+
finalPosition: Vector2; // 落点
|
|
92
|
+
hoopContactPoint?: Vector2; // 入筐接触点(若 scored)
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/** 入筐检测结果 */
|
|
96
|
+
export type HoopCheckResult = {
|
|
97
|
+
scored: boolean;
|
|
98
|
+
/** 球心穿过 rimY 时的 x 偏移量(0 = 完美中心) */
|
|
99
|
+
centerOffset: number;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
103
|
+
// 必须导出的函数
|
|
104
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
105
|
+
|
|
106
|
+
// ─── 初始化 ──────────────────────────────────────────────────────────────────
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* init:根据配置初始化游戏状态
|
|
110
|
+
*/
|
|
111
|
+
export declare function init(config: BasketballConfig & { hoop: Hoop; playerPosition: PlayerPosition }): BasketballState;
|
|
112
|
+
|
|
113
|
+
// ─── 一体化接口(测试/AI 模拟用) ───────────────────────────────────────────
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* dispatch:接收动作,返回新状态(纯函数)
|
|
117
|
+
* - aim:更新当前瞄准参数(不消耗次数)
|
|
118
|
+
* - shoot:执行完整投篮模拟,更新状态
|
|
119
|
+
* - reset:重置游戏
|
|
120
|
+
*
|
|
121
|
+
* ⚠️ 仅用于无头测试和 AI 模拟。渲染层请使用下方分步函数。
|
|
122
|
+
*/
|
|
123
|
+
export declare function dispatch(state: BasketballState, action: BasketballAction): BasketballState;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* getState:返回当前状态快照
|
|
127
|
+
*/
|
|
128
|
+
export declare function getState(state: BasketballState): BasketballState;
|
|
129
|
+
|
|
130
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
131
|
+
// 分步函数(渲染层/场景层必须使用这些函数驱动动画)
|
|
132
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* calculateTrajectory:根据起始位置、角度、力度计算完整抛物线轨迹
|
|
136
|
+
* 公式:x(t)=x0+vx·t, y(t)=y0+vy·t+0.5·g·t²(g 为正值,y 轴向下为正)
|
|
137
|
+
*
|
|
138
|
+
* 渲染层用途:
|
|
139
|
+
* 1. 玩家调整参数时实时预览轨迹(虚线)
|
|
140
|
+
* 2. 实际投篮时获取逐帧插值点
|
|
141
|
+
*/
|
|
142
|
+
export declare function calculateTrajectory(
|
|
143
|
+
startPos: Vector2,
|
|
144
|
+
angle: number, // 投篮仰角(度),相对水平方向
|
|
145
|
+
power: number, // 力度百分比 0~100
|
|
146
|
+
config: Pick<BasketballConfig, 'gravity' | 'maxSpeed' | 'simulationStep'>,
|
|
147
|
+
): TrajectoryPoint[];
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* checkHoop:检测球在某一时刻是否穿过篮筐
|
|
151
|
+
* 条件:球从 rimY 上方穿越到下方,且球心 x 在 hoop.radius × (1 + rimTolerance) 内
|
|
152
|
+
*
|
|
153
|
+
* 渲染层在逐帧播放轨迹动画时调用,检测入筐瞬间以触发入筐动画
|
|
154
|
+
*/
|
|
155
|
+
export declare function checkHoop(
|
|
156
|
+
ball: Vector2,
|
|
157
|
+
prevBall: Vector2, // 上一帧位置(用于判断穿越方向)
|
|
158
|
+
hoop: Hoop,
|
|
159
|
+
rimTolerance: number,
|
|
160
|
+
): HoopCheckResult;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* updateScore:根据本次投篮结果更新分数和连击数
|
|
164
|
+
* - 命中:score += baseScore × comboMultiplier;comboCount++
|
|
165
|
+
* - 未中:comboCount = 0;comboMultiplier = 1
|
|
166
|
+
* - shotsRemaining--
|
|
167
|
+
* - 检测 gameOver 和 win
|
|
168
|
+
*/
|
|
169
|
+
export declare function updateScore(
|
|
170
|
+
state: BasketballState,
|
|
171
|
+
isHit: boolean,
|
|
172
|
+
config: Pick<BasketballConfig, 'baseScore' | 'comboMultiplierStep' | 'goalScore'>,
|
|
173
|
+
): BasketballState;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* simulateShot:执行完整投篮模拟,返回轨迹点和结果
|
|
177
|
+
* 内部调用 calculateTrajectory + checkHoop,不修改 state
|
|
178
|
+
*
|
|
179
|
+
* 渲染层调用流程:
|
|
180
|
+
* 1. const result = simulateShot(state, angle, power)
|
|
181
|
+
* 2. 逐帧渲染 result.trajectoryPoints
|
|
182
|
+
* 3. 结束后调用 updateScore(state, result.scored, config)
|
|
183
|
+
*/
|
|
184
|
+
export declare function simulateShot(
|
|
185
|
+
state: BasketballState,
|
|
186
|
+
angle: number,
|
|
187
|
+
power: number,
|
|
188
|
+
config: BasketballConfig,
|
|
189
|
+
): ShotResult;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bg_music.aiaudio
|
|
3
|
+
description: 路径消除玩法的背景循环音乐,营造轻松欢快的益智游戏氛围。
|
|
4
|
+
triggers: 需要生成路径消除玩法背景音乐时触发。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 路径消除 BGM
|
|
8
|
+
|
|
9
|
+
## Recipe
|
|
10
|
+
|
|
11
|
+
生成提示词见 manifest.json generation.prompt。
|
|
12
|
+
- model: Google Lyria 3(平台默认,见 manifest.json generation.platformSkill)
|
|
13
|
+
- format: mp3
|
|
14
|
+
- loop: true
|
|
15
|
+
|
|
16
|
+
## Result
|
|
17
|
+
|
|
18
|
+
- 产物文件:`bg.mp3`
|
|
19
|
+
- 在 Preloader.ts 中作为 `bgMusic` key 加载
|
|
20
|
+
|
|
21
|
+
## Binding
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"role": "bgMusic",
|
|
26
|
+
"target": "assets/sounds/bg.mp3",
|
|
27
|
+
"type": "audio-asset-reference"
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 生成方式
|
|
32
|
+
|
|
33
|
+
Platform Skill: `playcraft-audio-generation`
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# 1. 生成 BGM(Google Lyria 3,固定 30s)
|
|
37
|
+
playcraft tools generate-bgm \
|
|
38
|
+
--prompt "upbeat casual mobile puzzle game background music, energetic and fun, 120 BPM, loop" \
|
|
39
|
+
--style casual \
|
|
40
|
+
--bpm 120 \
|
|
41
|
+
--output ta-workspace/raw_bgm.mp3
|
|
42
|
+
|
|
43
|
+
# 2. 处理无缝循环 + 归一化
|
|
44
|
+
playcraft audio loop --input ta-workspace/raw_bgm.mp3 --output ta-workspace/bgm_loop.mp3 --crossfade 0.5
|
|
45
|
+
playcraft audio normalize --input ta-workspace/bgm_loop.mp3 --output ta-workspace/bgm_loop.mp3 --target-loudness -16
|
|
46
|
+
|
|
47
|
+
# 3. 压缩至体积预算(Facebook 可玩广告 BGM 目标 ≤60KB)
|
|
48
|
+
playcraft audio compress --input ta-workspace/bgm_loop.mp3 --output ta-workspace/bg.mp3 --target-size 60KB
|
|
49
|
+
|
|
50
|
+
# 4. 将产物写入 sandbox 对应路径(见 binding.target)
|
|
51
|
+
```
|
|
52
|
+
## Skill Definition
|
|
53
|
+
|
|
54
|
+
```yaml
|
|
55
|
+
tools:
|
|
56
|
+
- generate_audio
|
|
57
|
+
inputs:
|
|
58
|
+
- prompt: see manifest.json
|
|
59
|
+
outputs:
|
|
60
|
+
- audio: bg.mp3
|
|
61
|
+
```
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "bg_music.aiaudio",
|
|
4
|
+
"bundleType": "aiaudio",
|
|
5
|
+
"category": "audio",
|
|
6
|
+
"mode": "generative",
|
|
7
|
+
"label": {
|
|
8
|
+
"zh": "路径消除背景音乐",
|
|
9
|
+
"en": "Path elimination BGM"
|
|
10
|
+
},
|
|
11
|
+
"tags": [
|
|
12
|
+
"audio",
|
|
13
|
+
"bgm",
|
|
14
|
+
"music",
|
|
15
|
+
"loop",
|
|
16
|
+
"puzzle",
|
|
17
|
+
"casual"
|
|
18
|
+
],
|
|
19
|
+
"bindingRoles": [
|
|
20
|
+
"bgMusic"
|
|
21
|
+
],
|
|
22
|
+
"generation": {
|
|
23
|
+
"kind": "bgm",
|
|
24
|
+
"prompt": "upbeat casual mobile puzzle game background music, energetic and fun, 120 BPM, loop",
|
|
25
|
+
"duration": 30,
|
|
26
|
+
"loop": true,
|
|
27
|
+
"referenceAudio": "ref/bg.mp3",
|
|
28
|
+
"platformSkill": "playcraft-audio-generation",
|
|
29
|
+
"bgmStyle": "casual",
|
|
30
|
+
"bpm": 120
|
|
31
|
+
},
|
|
32
|
+
"result": {
|
|
33
|
+
"outputFile": "ref/bg.mp3",
|
|
34
|
+
"format": "mp3",
|
|
35
|
+
"constraints": {
|
|
36
|
+
"maxDuration": 30
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"binding": {
|
|
40
|
+
"role": "bgMusic",
|
|
41
|
+
"target": "assets/sounds/bg.mp3",
|
|
42
|
+
"type": "audio-asset-reference"
|
|
43
|
+
},
|
|
44
|
+
"files": {
|
|
45
|
+
"skill": "SKILL.md",
|
|
46
|
+
"asset": "ref/bg.mp3"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: big_watermelon.aigameplay
|
|
3
|
+
description: 合成西瓜玩法封包 - 下落水果物理碰撞、相同等级合并升级、容器溢出判定的 PGS 实现
|
|
4
|
+
triggers: 合成,merge,西瓜,watermelon,水果,fruit,下落,drop,物理,physics,合并,combine,叠加,stack,溢出,overflow
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# big_watermelon.aigameplay
|
|
8
|
+
|
|
9
|
+
合成西瓜玩法封包。实现下落物理合成玩法的 PGS (PlayCraft Gameplay Schema, 玩法定义规范) JSON 和 reducer,玩家控制水果左右位置后释放,相同等级水果碰撞时合并为更大一级,容器溢出则游戏结束。
|
|
10
|
+
|
|
11
|
+
## Recipe
|
|
12
|
+
|
|
13
|
+
- **玩法类型**:big_watermelon(合成西瓜)
|
|
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
|
+
- `fruitTiers`: 11(葡萄→樱桃→草莓→橙子→柿子→苹果→梨→桃子→菠萝→椰子→西瓜)
|
|
19
|
+
- `gravity`: 980(重力加速度,px/s²)
|
|
20
|
+
- `containerWidth`: 400 / `containerHeight`: 600(容器尺寸)
|
|
21
|
+
- `overflowLine`: 80(溢出判定线距顶部距离,任何静止水果超过此线则游戏结束)
|
|
22
|
+
- `nextFruitMaxTier`: 5(下一个水果随机范围限制在前 5 级,避免一开始就出现大水果)
|
|
23
|
+
- **PGS Agent 操作流程**:
|
|
24
|
+
1. 读取 `ref/pgs-schema.json` 作为规则骨架起点
|
|
25
|
+
2. 读取 `ref/reducer.template.ts` 了解接口约束
|
|
26
|
+
3. 实现 `reducer.ts`,导出 `init(config)`、`dispatch(state, action)`、`getState(state)` 以及**全部分步函数**
|
|
27
|
+
4. 运行 `ref/pgs-schema.json` 中的所有 `testCases`,全部通过后才算完成
|
|
28
|
+
5. 更新 manifest 的 `generation.pgsVersion` 和 `result.outputFile`
|
|
29
|
+
- **可 fork 变体**:
|
|
30
|
+
- 主题替换:将水果替换为宠物/星球/食物等,保持 11 级合成逻辑不变
|
|
31
|
+
- 特殊道具:某些等级的水果具有爆炸/磁铁特效,合并时触发特殊效果
|
|
32
|
+
- 挑战模式:设置分数目标,限制时间内达到目标分数
|
|
33
|
+
|
|
34
|
+
## Result
|
|
35
|
+
|
|
36
|
+
- **产物文件**:`reducer.ts`
|
|
37
|
+
- **格式**:TypeScript,导出 `init(config)`、`dispatch(state, action)`、`getState(state)` + 分步函数接口
|
|
38
|
+
- **验证**:所有 testCases 必须通过
|
|
39
|
+
|
|
40
|
+
## 渲染集成(⚠️ 场景层必读)
|
|
41
|
+
|
|
42
|
+
### 设计原则:逻辑与渲染分离
|
|
43
|
+
|
|
44
|
+
reducer 管理逻辑状态(位置、速度、合并),渲染层(GameScene)使用 Matter.js 或 Phaser Arcade Physics 同步精灵:
|
|
45
|
+
|
|
46
|
+
| 接口 | 适用场景 | 特点 |
|
|
47
|
+
|------|---------|------|
|
|
48
|
+
| `dispatch()` | 无头测试、AI 模拟 | 一步到位,只返回最终状态 |
|
|
49
|
+
| 分步函数 | **渲染层/GameScene** | 逐帧更新,返回物理结果驱动精灵 |
|
|
50
|
+
|
|
51
|
+
### 分步函数返回值与动画映射
|
|
52
|
+
|
|
53
|
+
| 分步函数 | 返回值 | 场景层动画 |
|
|
54
|
+
|---------|--------|-----------|
|
|
55
|
+
| `aimFruit(x)` | `{ currentFruit }` | 移动瞄准指示线和当前水果预览精灵 |
|
|
56
|
+
| `dropFruit()` | `{ droppedFruit, nextFruit }` | 创建下落水果刚体,生成下一个预览 |
|
|
57
|
+
| `applyPhysics(deltaMs)` | `Fruit[]` | 逐帧同步所有水果精灵位置到物理状态 |
|
|
58
|
+
| `checkMerges()` | `MergeEvent[]` | 播放合并特效,销毁旧精灵,创建新精灵 |
|
|
59
|
+
| `mergeFruits(fruitA, fruitB)` | `{ newFruit, score }` | 合并动画:缩小两个旧精灵 → 在中点生成新精灵 |
|
|
60
|
+
| `checkOverflow()` | `{ gameOver }` | 触发溢出警告 → 游戏结束面板 |
|
|
61
|
+
| `calculateScore(tier)` | `number` | 更新分数 HUD |
|
|
62
|
+
|
|
63
|
+
### ⚠️ 物理引擎集成建议
|
|
64
|
+
|
|
65
|
+
由于真实物理模拟(圆形碰撞体、弹性、摩擦)超出纯 reducer 的能力范围,实际项目中:
|
|
66
|
+
- reducer 管理**逻辑状态**(tier、分数、溢出检测、合并触发)
|
|
67
|
+
- 渲染层使用 **Matter.js** 或 **Phaser Arcade** 管理物理碰撞体
|
|
68
|
+
- 每帧结束后将物理引擎的位置数据同步回 reducer state
|
|
69
|
+
|
|
70
|
+
## Binding
|
|
71
|
+
|
|
72
|
+
- **Binding Role**:`gameplayRule`
|
|
73
|
+
- **挂载目标**:`game/gameplay/big_watermelon/reducer.ts`
|
|
74
|
+
- **引用类型**:`gameplay-module-reference`
|
|
75
|
+
- **接口契约**:`init(config)` / `dispatch(action)` / `getState()` / `aimFruit()` / `dropFruit()` / `applyPhysics()` / `checkMerges()` / `mergeFruits()` / `checkOverflow()` / `calculateScore()`
|
|
76
|
+
|
|
77
|
+
## Skill Definition
|
|
78
|
+
|
|
79
|
+
tools:
|
|
80
|
+
- bash
|
|
81
|
+
- write
|
|
82
|
+
- read
|
|
83
|
+
prompt_extension: |
|
|
84
|
+
You are implementing a merge-fruit (big watermelon) gameplay module following the PGS specification.
|
|
85
|
+
Write the PGS JSON with entities (container, fruits, score, next_fruit, current_fruit), rules, algorithm, and testCases.
|
|
86
|
+
Implement the reducer.ts with:
|
|
87
|
+
- init/dispatch/getState (一体化接口,用于测试)
|
|
88
|
+
- aimFruit/dropFruit/applyPhysics/checkMerges/mergeFruits/checkOverflow/calculateScore (分步函数,用于渲染层驱动)
|
|
89
|
+
Physics simulation in reducer: simplified circle collision detection (distance < r1+r2).
|
|
90
|
+
Merge trigger: two fruits with same tier AND overlapping circles → remove both, spawn tier+1 at midpoint.
|
|
91
|
+
Score per merge: tier^2 * 10 (higher tier merges give exponentially more points).
|
|
92
|
+
Overflow check: any resting fruit whose center y < overflowLine triggers gameOver.
|
|
93
|
+
Run the testCases to verify the logic before finalizing.
|
|
94
|
+
Apply the Binding to wire the reducer into the game's gameplay module path.
|