@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,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: knife_hit.aigameplay
|
|
3
|
+
description: 飞刀投掷核心玩法封包 - 旋转木桩、飞刀碰撞检测、苹果收集的 PGS 实现
|
|
4
|
+
triggers: 飞刀,knife,刀,投掷,throw,旋转,rotation,碰撞,collision,木桩,target,苹果,apple,timing,计时
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# knife_hit.aigameplay
|
|
8
|
+
|
|
9
|
+
飞刀投掷核心玩法封包。实现飞刀投掷玩法的 PGS (PlayCraft Gameplay Schema, 玩法定义规范) JSON 和 reducer。旋转的圆形木桩/水果不断旋转,玩家点击投出飞刀,需避开已插入的刀,碰撞则游戏结束。收集苹果可额外得分,投完指定数量飞刀则过关。
|
|
10
|
+
|
|
11
|
+
## Recipe
|
|
12
|
+
|
|
13
|
+
- **玩法类型**:knife_hit(飞刀投掷)
|
|
14
|
+
- **参考文件**:
|
|
15
|
+
- `ref/pgs-schema.json`:PGS 规则骨架(entities、rules、algorithm、testCases)
|
|
16
|
+
- `ref/reducer.template.ts`:reducer 接口约束模板
|
|
17
|
+
- **核心规则**:
|
|
18
|
+
- `minSeparationAngle`: 15(已插入飞刀之间最小角度差,度数)
|
|
19
|
+
- `baseRotationSpeed`: 90(基础旋转速度,度/秒)
|
|
20
|
+
- `appleBonusScore`: 50(苹果额外分数)
|
|
21
|
+
- `knifeScorePerHit`: 10(每刀成功插入得分)
|
|
22
|
+
- **PGS Agent 操作流程**:
|
|
23
|
+
1. 读取 `ref/pgs-schema.json` 作为规则骨架起点
|
|
24
|
+
2. 读取 `ref/reducer.template.ts` 了解接口约束
|
|
25
|
+
3. 实现 `reducer.ts`,导出 `init(config)`、`dispatch(state, action)`、`getState(state)` 以及**全部分步函数**
|
|
26
|
+
4. 碰撞检测:新飞刀插入角度与所有已插入飞刀角度的最小差 < `minSeparationAngle` → 碰撞
|
|
27
|
+
5. 苹果检测:新飞刀插入角度与苹果位置角度差 < 苹果半径角度 → 收集苹果
|
|
28
|
+
6. 运行 `ref/pgs-schema.json` 中的所有 `testCases`,全部通过后才算完成
|
|
29
|
+
- **旋转方向**:`clockwise`(顺时针)或 `counter_clockwise`(逆时针),部分关卡会反向旋转
|
|
30
|
+
- **角度归一化**:所有角度统一用 `[0, 360)` 度表示,差值取最小角(`min(|a-b|, 360-|a-b|)`)
|
|
31
|
+
- **可 fork 变体**:
|
|
32
|
+
- 多层木桩:同时有多个不同旋转速度的圆形目标
|
|
33
|
+
- 爆炸刀:特殊飞刀命中后爆炸,清除周围已插入的刀
|
|
34
|
+
- Boss 阶段:部分关卡木桩不规则运动
|
|
35
|
+
|
|
36
|
+
## Result
|
|
37
|
+
|
|
38
|
+
- **产物文件**:`reducer.ts`
|
|
39
|
+
- **格式**:TypeScript,导出 `init(config)`、`dispatch(action)`、`getState()` + 分步函数接口
|
|
40
|
+
- **验证**:所有 testCases 必须通过
|
|
41
|
+
|
|
42
|
+
## 渲染集成(⚠️ 场景层必读)
|
|
43
|
+
|
|
44
|
+
### 设计原则:每帧更新旋转 + 点击时投刀
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
// ✅ 正确做法:每帧更新旋转
|
|
48
|
+
function update(deltaMs: number) {
|
|
49
|
+
// Step 1: 更新木桩旋转角度(每帧调用)
|
|
50
|
+
state = updateRotation(state, deltaMs);
|
|
51
|
+
rotateSpriteGroup(state.target.currentAngle); // 旋转木桩精灵组
|
|
52
|
+
|
|
53
|
+
// 玩家点击时:
|
|
54
|
+
if (playerTapped) {
|
|
55
|
+
// Step 2: 检测碰撞
|
|
56
|
+
const collision = checkCollision(state, state.target.currentAngle);
|
|
57
|
+
if (collision) {
|
|
58
|
+
await playCollisionAnimation();
|
|
59
|
+
dispatch(state, { type: 'game_over' });
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Step 3: 飞刀飞行动画
|
|
64
|
+
await playKnifeThrowAnimation(state.target.currentAngle);
|
|
65
|
+
|
|
66
|
+
// Step 4: 投刀(可能收集苹果)
|
|
67
|
+
state = throwKnife(state);
|
|
68
|
+
if (state.lastAppleCollected) {
|
|
69
|
+
await playAppleCollectAnimation();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Step 5: 检测过关
|
|
73
|
+
const levelResult = checkLevelComplete(state);
|
|
74
|
+
if (levelResult.complete) {
|
|
75
|
+
await playLevelCompleteAnimation();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Binding
|
|
82
|
+
|
|
83
|
+
- **Binding Role**:`gameplayRule`
|
|
84
|
+
- **挂载目标**:`game/gameplay/knife_hit/reducer.ts`
|
|
85
|
+
- **引用类型**:`gameplay-module-reference`
|
|
86
|
+
- **接口契约**:`init(config)` / `dispatch(action)` / `getState()` / `throwKnife()` / `checkCollision()` / `collectApple()` / `updateRotation()` / `checkLevelComplete()`
|
|
87
|
+
|
|
88
|
+
## Skill Definition
|
|
89
|
+
|
|
90
|
+
tools:
|
|
91
|
+
- bash
|
|
92
|
+
- write
|
|
93
|
+
- read
|
|
94
|
+
prompt_extension: |
|
|
95
|
+
You are implementing a knife hit gameplay module following the PGS specification.
|
|
96
|
+
Write the PGS JSON with entities, rules, algorithm, and testCases.
|
|
97
|
+
Implement the reducer.ts with:
|
|
98
|
+
- init/dispatch/getState (一体化接口,用于测试)
|
|
99
|
+
- throwKnife/checkCollision/collectApple/updateRotation/checkLevelComplete (分步函数,用于渲染层)
|
|
100
|
+
Collision detection: angular distance between new knife and all existing knives < minSeparationAngle → collision.
|
|
101
|
+
Apple collection: knife hits within apple's angular radius → collect, remove apple, add bonus score.
|
|
102
|
+
Rotation: currentAngle += rotationSpeed * direction * (deltaMs/1000), normalized to [0, 360).
|
|
103
|
+
Run the testCases to verify the logic before finalizing.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "knife_hit.aigameplay",
|
|
4
|
+
"bundleType": "aigameplay",
|
|
5
|
+
"category": "gameplay",
|
|
6
|
+
"mode": "fixed",
|
|
7
|
+
"label": {
|
|
8
|
+
"zh": "飞刀投掷玩法",
|
|
9
|
+
"en": "Knife hit gameplay"
|
|
10
|
+
},
|
|
11
|
+
"tags": [
|
|
12
|
+
"gameplay",
|
|
13
|
+
"knife",
|
|
14
|
+
"throw",
|
|
15
|
+
"rotation",
|
|
16
|
+
"timing",
|
|
17
|
+
"casual"
|
|
18
|
+
],
|
|
19
|
+
"bindingRoles": [
|
|
20
|
+
"gameplayRule"
|
|
21
|
+
],
|
|
22
|
+
"imports": [
|
|
23
|
+
{
|
|
24
|
+
"slot": "engine",
|
|
25
|
+
"pinAtomId": "phaser.aicomponent",
|
|
26
|
+
"edgeKind": "requires",
|
|
27
|
+
"bindAs": "engine"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"slot": "bgMusic",
|
|
31
|
+
"description": "背景循环音乐",
|
|
32
|
+
"bindAs": "bgm",
|
|
33
|
+
"required": false,
|
|
34
|
+
"edgeKind": "compatibleWith",
|
|
35
|
+
"matchBindingRoles": [
|
|
36
|
+
"bgMusic"
|
|
37
|
+
],
|
|
38
|
+
"allowedBundleTypes": [
|
|
39
|
+
"aiaudio"
|
|
40
|
+
],
|
|
41
|
+
"constraints": {
|
|
42
|
+
"loop": true
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"slot": "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": "knife_hit",
|
|
115
|
+
"rules": {
|
|
116
|
+
"minSeparationAngle": 15,
|
|
117
|
+
"baseRotationSpeed": 90,
|
|
118
|
+
"appleBonusScore": 50,
|
|
119
|
+
"knifeScorePerHit": 10
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"result": {
|
|
123
|
+
"outputFile": "reducer.ts",
|
|
124
|
+
"format": "typescript",
|
|
125
|
+
"constraints": {
|
|
126
|
+
"testCasesMustPass": true
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"binding": {
|
|
130
|
+
"role": "gameplayRule",
|
|
131
|
+
"target": "game/gameplay/knife_hit/reducer.ts",
|
|
132
|
+
"type": "gameplay-module-reference",
|
|
133
|
+
"constraints": {
|
|
134
|
+
"interface": [
|
|
135
|
+
"init(config)",
|
|
136
|
+
"dispatch(action)",
|
|
137
|
+
"getState()",
|
|
138
|
+
"throwKnife(state)",
|
|
139
|
+
"checkCollision(state, newAngle)",
|
|
140
|
+
"collectApple(state, angle)",
|
|
141
|
+
"updateRotation(state, deltaMs)",
|
|
142
|
+
"checkLevelComplete(state)"
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"files": {
|
|
147
|
+
"skill": "SKILL.md",
|
|
148
|
+
"pgsSchema": "ref/pgs-schema.json",
|
|
149
|
+
"reducerTemplate": "ref/reducer.template.ts"
|
|
150
|
+
}
|
|
151
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "PGS (PlayCraft Gameplay Schema) 参考骨架 - 飞刀投掷玩法。Agent 以此为起点编写或 fork 玩法规则。",
|
|
3
|
+
"version": "1.0",
|
|
4
|
+
"gameplayType": "knife_hit",
|
|
5
|
+
"entities": {
|
|
6
|
+
"target": {
|
|
7
|
+
"type": "rotating-object",
|
|
8
|
+
"description": "旋转的圆形木桩/水果,飞刀插入其中",
|
|
9
|
+
"fields": {
|
|
10
|
+
"radius": { "type": "number", "value": 120, "description": "木桩半径(像素)" },
|
|
11
|
+
"rotation_speed": { "type": "number", "description": "当前旋转速度(度/秒),正=顺时针,负=逆时针" },
|
|
12
|
+
"rotation_direction": { "type": "number", "values": [1, -1], "description": "1=顺时针,-1=逆时针" },
|
|
13
|
+
"current_angle": { "type": "number", "range": [0, 360], "description": "当前旋转角度(度)" },
|
|
14
|
+
"inserted_knives": { "type": "array", "description": "已插入飞刀的角度列表 number[]" }
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"knives_queue": {
|
|
18
|
+
"type": "counter",
|
|
19
|
+
"description": "当前关卡剩余可投飞刀数量",
|
|
20
|
+
"fields": {
|
|
21
|
+
"remaining_count": { "type": "integer", "description": "剩余飞刀数" },
|
|
22
|
+
"total_count": { "type": "integer", "description": "本关总飞刀数" }
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"score": {
|
|
26
|
+
"type": "counter",
|
|
27
|
+
"initial": 0,
|
|
28
|
+
"description": "当前得分"
|
|
29
|
+
},
|
|
30
|
+
"apples": {
|
|
31
|
+
"type": "collectibles",
|
|
32
|
+
"description": "木桩上的苹果/水果,可被飞刀收集",
|
|
33
|
+
"fields": {
|
|
34
|
+
"id": { "type": "integer" },
|
|
35
|
+
"angle": { "type": "number", "description": "苹果在木桩上的固定角度(相对于木桩,度)" },
|
|
36
|
+
"angular_radius": { "type": "number", "value": 8, "description": "收集判定角度半径(度)" },
|
|
37
|
+
"collected": { "type": "boolean", "default": false }
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"level": {
|
|
41
|
+
"type": "level-config",
|
|
42
|
+
"description": "关卡配置",
|
|
43
|
+
"fields": {
|
|
44
|
+
"level_number": { "type": "integer" },
|
|
45
|
+
"knives_required": { "type": "integer", "description": "本关需要成功投出的飞刀数" },
|
|
46
|
+
"rotation_speed": { "type": "number", "description": "本关旋转速度(度/秒)" },
|
|
47
|
+
"phase_changes": { "type": "array", "description": "旋转方向变化阶段 [{at_knife: number, new_direction: 1|-1}]" }
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"rules": {
|
|
52
|
+
"throw_knife": {
|
|
53
|
+
"description": "玩家点击投出飞刀:飞刀以当前木桩旋转角度插入",
|
|
54
|
+
"trigger": "player_tap",
|
|
55
|
+
"effect": [
|
|
56
|
+
"新飞刀插入角度 = target.current_angle",
|
|
57
|
+
"检测碰撞:若与任何已插飞刀角度差 < minSeparationAngle → 游戏结束",
|
|
58
|
+
"检测苹果:若命中苹果角度范围内 → 收集苹果,加苹果分",
|
|
59
|
+
"成功:target.inserted_knives.push(current_angle);knives_queue.remaining_count--;score += knifeScore"
|
|
60
|
+
],
|
|
61
|
+
"minSeparationAngle": 15,
|
|
62
|
+
"knifeScore": 10
|
|
63
|
+
},
|
|
64
|
+
"collision_check": {
|
|
65
|
+
"description": "碰撞检测:新飞刀角度与所有已插飞刀的最小角距 < minSeparationAngle",
|
|
66
|
+
"formula": "angularDistance(a, b) = min(|a-b|, 360-|a-b|)",
|
|
67
|
+
"collision_condition": "min(angularDistance(newAngle, knife) for knife in inserted_knives) < minSeparationAngle",
|
|
68
|
+
"result_on_collision": "gameOver = true"
|
|
69
|
+
},
|
|
70
|
+
"apple_collect": {
|
|
71
|
+
"description": "苹果收集:飞刀插入角度与苹果角度的角距 < apple.angular_radius",
|
|
72
|
+
"effect": "apple.collected = true; score += appleBonusScore",
|
|
73
|
+
"appleBonusScore": 50
|
|
74
|
+
},
|
|
75
|
+
"rotation_update": {
|
|
76
|
+
"description": "每帧更新木桩旋转角度",
|
|
77
|
+
"formula": "current_angle = (current_angle + rotation_speed × rotation_direction × dt) mod 360"
|
|
78
|
+
},
|
|
79
|
+
"level_advance": {
|
|
80
|
+
"description": "所有飞刀成功投出(remaining_count == 0)且无碰撞,过关",
|
|
81
|
+
"trigger": "knives_queue.remaining_count == 0"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"algorithm": {
|
|
85
|
+
"description": "主循环:rotate → player_tap → collision_check → insert → apple_check → level_check",
|
|
86
|
+
"steps": [
|
|
87
|
+
"1. 每帧更新木桩旋转角度:current_angle += rotation_speed × direction × dt",
|
|
88
|
+
"2. 玩家点击:捕获当前木桩角度作为插入角度",
|
|
89
|
+
"3. 碰撞检测:检查新角度与所有已插飞刀的角距,任意 < minSeparationAngle → 游戏结束",
|
|
90
|
+
"4. 苹果检测:检查新角度是否命中任意未收集苹果",
|
|
91
|
+
"5. 插入飞刀:插入成功,remaining_count--,score += knifeScore",
|
|
92
|
+
"6. 检查旋转方向变化:根据 phase_changes 配置切换方向",
|
|
93
|
+
"7. 检查过关:remaining_count == 0 → 显示过关",
|
|
94
|
+
"8. 进入下一关或显示最终结果"
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
"winCondition": {
|
|
98
|
+
"type": "all_knives_thrown",
|
|
99
|
+
"description": "成功投出关卡要求的所有飞刀(remaining_count == 0)且无碰撞"
|
|
100
|
+
},
|
|
101
|
+
"loseCondition": {
|
|
102
|
+
"type": "knife_collision",
|
|
103
|
+
"description": "新投出的飞刀与已插入的飞刀发生碰撞(角距 < minSeparationAngle)"
|
|
104
|
+
},
|
|
105
|
+
"testCases": [
|
|
106
|
+
{
|
|
107
|
+
"id": "tc_successful_throw",
|
|
108
|
+
"description": "成功投刀:新飞刀插入角度与已有飞刀角距 > minSeparationAngle",
|
|
109
|
+
"initialState": {
|
|
110
|
+
"target": {
|
|
111
|
+
"current_angle": 90,
|
|
112
|
+
"rotation_speed": 90,
|
|
113
|
+
"rotation_direction": 1,
|
|
114
|
+
"inserted_knives": [0, 180]
|
|
115
|
+
},
|
|
116
|
+
"knives_queue": { "remaining_count": 5, "total_count": 5 },
|
|
117
|
+
"score": 10,
|
|
118
|
+
"apples": []
|
|
119
|
+
},
|
|
120
|
+
"actions": [
|
|
121
|
+
{ "type": "throw_knife" }
|
|
122
|
+
],
|
|
123
|
+
"expectedState": {
|
|
124
|
+
"target.inserted_knives": [0, 90, 180],
|
|
125
|
+
"knives_queue.remaining_count": 4,
|
|
126
|
+
"score": 20,
|
|
127
|
+
"gameOver": false
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"id": "tc_collision_game_over",
|
|
132
|
+
"description": "碰撞失败:新飞刀角度与已有飞刀角距 < 15度",
|
|
133
|
+
"initialState": {
|
|
134
|
+
"target": {
|
|
135
|
+
"current_angle": 5,
|
|
136
|
+
"rotation_speed": 90,
|
|
137
|
+
"rotation_direction": 1,
|
|
138
|
+
"inserted_knives": [0, 90, 180, 270]
|
|
139
|
+
},
|
|
140
|
+
"knives_queue": { "remaining_count": 3, "total_count": 5 },
|
|
141
|
+
"score": 20,
|
|
142
|
+
"apples": []
|
|
143
|
+
},
|
|
144
|
+
"actions": [
|
|
145
|
+
{ "type": "throw_knife" }
|
|
146
|
+
],
|
|
147
|
+
"expectedState": {
|
|
148
|
+
"gameOver": true,
|
|
149
|
+
"win": false,
|
|
150
|
+
"loseReason": "knife_collision"
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"id": "tc_apple_bonus",
|
|
155
|
+
"description": "收集苹果:飞刀命中苹果位置,获得额外分数",
|
|
156
|
+
"initialState": {
|
|
157
|
+
"target": {
|
|
158
|
+
"current_angle": 135,
|
|
159
|
+
"rotation_speed": 45,
|
|
160
|
+
"rotation_direction": 1,
|
|
161
|
+
"inserted_knives": [0, 180]
|
|
162
|
+
},
|
|
163
|
+
"knives_queue": { "remaining_count": 3, "total_count": 5 },
|
|
164
|
+
"score": 20,
|
|
165
|
+
"apples": [
|
|
166
|
+
{ "id": 1, "angle": 135, "angular_radius": 8, "collected": false }
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
"actions": [
|
|
170
|
+
{ "type": "throw_knife" }
|
|
171
|
+
],
|
|
172
|
+
"expectedState": {
|
|
173
|
+
"score": 80,
|
|
174
|
+
"apples[0].collected": true,
|
|
175
|
+
"score_gained": 60
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"id": "tc_level_complete",
|
|
180
|
+
"description": "关卡通过:成功投出最后一刀",
|
|
181
|
+
"initialState": {
|
|
182
|
+
"target": {
|
|
183
|
+
"current_angle": 45,
|
|
184
|
+
"rotation_speed": 90,
|
|
185
|
+
"rotation_direction": 1,
|
|
186
|
+
"inserted_knives": [90, 180, 270]
|
|
187
|
+
},
|
|
188
|
+
"knives_queue": { "remaining_count": 1, "total_count": 4 },
|
|
189
|
+
"score": 30,
|
|
190
|
+
"apples": []
|
|
191
|
+
},
|
|
192
|
+
"actions": [
|
|
193
|
+
{ "type": "throw_knife" }
|
|
194
|
+
],
|
|
195
|
+
"expectedState": {
|
|
196
|
+
"knives_queue.remaining_count": 0,
|
|
197
|
+
"gameOver": true,
|
|
198
|
+
"win": true
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
]
|
|
202
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* knife_hit.aigameplay — reducer 接口模板
|
|
3
|
+
*
|
|
4
|
+
* Agent 生成实际 reducer 时,必须导出以下函数。
|
|
5
|
+
* 此文件是接口约束模板,不是可执行代码。
|
|
6
|
+
*
|
|
7
|
+
* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
8
|
+
* ⚠️ 重要:渲染层(GameScene)不应直接调用 dispatch()
|
|
9
|
+
*
|
|
10
|
+
* 游戏的核心循环是「每帧旋转 + 玩家点击投刀」,
|
|
11
|
+
* 渲染层必须每帧调用 updateRotation 更新木桩旋转角度,
|
|
12
|
+
* 并根据 state.target.current_angle 旋转木桩精灵组。
|
|
13
|
+
*
|
|
14
|
+
* 玩家点击时,先调用 checkCollision,再调用 throwKnife,
|
|
15
|
+
* 在飞刀飞行动画播放期间保持逻辑状态不变,动画结束后再更新。
|
|
16
|
+
*
|
|
17
|
+
* dispatch() 的用途:无头测试、AI 模拟、关卡回放等场景。
|
|
18
|
+
* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
// ─── 配置类型 ─────────────────────────────────────────────────────────────────
|
|
22
|
+
|
|
23
|
+
export type KnifeHitConfig = {
|
|
24
|
+
/** 木桩半径(像素),默认 120 */
|
|
25
|
+
targetRadius: number;
|
|
26
|
+
/** 已插入飞刀之间最小角度差(度),默认 15 */
|
|
27
|
+
minSeparationAngle: number;
|
|
28
|
+
/** 基础旋转速度(度/秒),默认 90 */
|
|
29
|
+
baseRotationSpeed: number;
|
|
30
|
+
/** 旋转方向,1=顺时针,-1=逆时针 */
|
|
31
|
+
rotationDirection: 1 | -1;
|
|
32
|
+
/** 苹果收集判定角度半径(度),默认 8 */
|
|
33
|
+
appleAngularRadius: number;
|
|
34
|
+
/** 苹果额外得分,默认 50 */
|
|
35
|
+
appleBonusScore: number;
|
|
36
|
+
/** 每刀成功插入得分,默认 10 */
|
|
37
|
+
knifeScore: number;
|
|
38
|
+
/** 关卡需要投出的飞刀总数 */
|
|
39
|
+
knivesRequired: number;
|
|
40
|
+
/** 旋转方向变化阶段 */
|
|
41
|
+
phaseChanges?: Array<{ atKnifeNumber: number; newDirection: 1 | -1; newSpeed?: number }>;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// ─── 核心类型 ─────────────────────────────────────────────────────────────────
|
|
45
|
+
|
|
46
|
+
export type Apple = {
|
|
47
|
+
id: number;
|
|
48
|
+
/** 苹果在木桩上的固定角度(相对于木桩坐标系,度) */
|
|
49
|
+
angle: number;
|
|
50
|
+
collected: boolean;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export type Target = {
|
|
54
|
+
radius: number;
|
|
55
|
+
rotationSpeed: number;
|
|
56
|
+
rotationDirection: 1 | -1;
|
|
57
|
+
/** 当前旋转角度 [0, 360) */
|
|
58
|
+
currentAngle: number;
|
|
59
|
+
/** 已插入飞刀的角度列表(相对于世界坐标系,度) */
|
|
60
|
+
insertedKnives: number[];
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// ─── 动作类型 ─────────────────────────────────────────────────────────────────
|
|
64
|
+
|
|
65
|
+
export type KnifeHitAction =
|
|
66
|
+
| { type: 'throw_knife' } // 玩家点击投刀(使用当前 currentAngle)
|
|
67
|
+
| { type: 'update_rotation'; deltaMs: number } // 每帧旋转更新
|
|
68
|
+
| { type: 'reset' };
|
|
69
|
+
|
|
70
|
+
// ─── 状态类型 ─────────────────────────────────────────────────────────────────
|
|
71
|
+
|
|
72
|
+
export type KnifeHitState = {
|
|
73
|
+
target: Target;
|
|
74
|
+
apples: Apple[];
|
|
75
|
+
knivesRemaining: number; // 剩余可投飞刀数
|
|
76
|
+
knivesThrown: number; // 已成功投出的飞刀数
|
|
77
|
+
score: number;
|
|
78
|
+
gameOver: boolean;
|
|
79
|
+
win: boolean;
|
|
80
|
+
loseReason: 'knife_collision' | null;
|
|
81
|
+
/** 上一次投刀是否收集到苹果 */
|
|
82
|
+
lastAppleCollected: boolean;
|
|
83
|
+
lastAppleId: number | null;
|
|
84
|
+
/** 上一次投刀的插入角度 */
|
|
85
|
+
lastInsertedAngle: number | null;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// ─── 分步操作返回类型 ─────────────────────────────────────────────────────────
|
|
89
|
+
|
|
90
|
+
/** 碰撞检测结果 */
|
|
91
|
+
export type CollisionCheckResult = {
|
|
92
|
+
collision: boolean;
|
|
93
|
+
/** 最近的已插入飞刀角度(若有) */
|
|
94
|
+
nearestKnifeAngle?: number;
|
|
95
|
+
/** 最近飞刀的角距(度) */
|
|
96
|
+
nearestAngleDistance?: number;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/** 投刀结果 */
|
|
100
|
+
export type ThrowResult = {
|
|
101
|
+
success: boolean;
|
|
102
|
+
insertedAngle: number;
|
|
103
|
+
appleCollected: boolean;
|
|
104
|
+
appleId?: number;
|
|
105
|
+
bonusScore: number;
|
|
106
|
+
levelComplete: boolean;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
110
|
+
// 必须导出的函数
|
|
111
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
112
|
+
|
|
113
|
+
// ─── 初始化 ──────────────────────────────────────────────────────────────────
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* init:根据关卡配置初始化游戏状态
|
|
117
|
+
*/
|
|
118
|
+
export declare function init(
|
|
119
|
+
config: KnifeHitConfig,
|
|
120
|
+
apples?: Apple[],
|
|
121
|
+
): KnifeHitState;
|
|
122
|
+
|
|
123
|
+
// ─── 一体化接口(测试/AI 模拟用) ───────────────────────────────────────────
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* dispatch:接收动作,返回新状态(纯函数)
|
|
127
|
+
* - throw_knife:投出飞刀(使用当前 currentAngle)
|
|
128
|
+
* - update_rotation:更新旋转(通常由渲染层每帧调用)
|
|
129
|
+
* - reset:重置
|
|
130
|
+
*
|
|
131
|
+
* ⚠️ 仅用于无头测试和 AI 模拟。渲染层请使用下方分步函数。
|
|
132
|
+
*/
|
|
133
|
+
export declare function dispatch(state: KnifeHitState, action: KnifeHitAction): KnifeHitState;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* getState:返回当前状态快照
|
|
137
|
+
*/
|
|
138
|
+
export declare function getState(state: KnifeHitState): KnifeHitState;
|
|
139
|
+
|
|
140
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
141
|
+
// 分步函数(渲染层/场景层必须使用这些函数)
|
|
142
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* updateRotation:每帧更新木桩旋转角度
|
|
146
|
+
* 公式:currentAngle = (currentAngle + rotationSpeed × direction × deltaMs/1000) % 360
|
|
147
|
+
*
|
|
148
|
+
* 渲染层每帧调用,根据返回的 currentAngle 旋转木桩精灵组
|
|
149
|
+
*/
|
|
150
|
+
export declare function updateRotation(
|
|
151
|
+
state: KnifeHitState,
|
|
152
|
+
deltaMs: number,
|
|
153
|
+
): KnifeHitState;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* checkCollision:检测在给定角度插入是否会与已有飞刀碰撞
|
|
157
|
+
* 角距公式:angularDistance(a, b) = min(|a-b|, 360-|a-b|)
|
|
158
|
+
* 碰撞条件:任意已有飞刀的角距 < minSeparationAngle
|
|
159
|
+
*
|
|
160
|
+
* 渲染层在玩家点击时立即调用,若碰撞则播放碰撞动画,否则继续飞行动画
|
|
161
|
+
*/
|
|
162
|
+
export declare function checkCollision(
|
|
163
|
+
state: KnifeHitState,
|
|
164
|
+
newAngle: number,
|
|
165
|
+
): CollisionCheckResult;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* collectApple:检测并收集指定角度处的苹果
|
|
169
|
+
* 收集条件:angularDistance(angle, apple.angle) < apple.angular_radius
|
|
170
|
+
*
|
|
171
|
+
* 内部被 throwKnife 调用,也可由渲染层单独调用以查询是否会命中苹果
|
|
172
|
+
*/
|
|
173
|
+
export declare function collectApple(
|
|
174
|
+
state: KnifeHitState,
|
|
175
|
+
angle: number,
|
|
176
|
+
): { collected: boolean; appleId?: number; bonusScore: number; newState: KnifeHitState };
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* throwKnife:执行投刀操作(使用 target.currentAngle 作为插入角度)
|
|
180
|
+
* 1. 检测碰撞,若碰撞则 gameOver = true
|
|
181
|
+
* 2. 检测苹果收集
|
|
182
|
+
* 3. 将当前角度加入 insertedKnives
|
|
183
|
+
* 4. knivesRemaining--;score += knifeScore
|
|
184
|
+
* 5. 处理旋转方向/速度变化(根据 phaseChanges)
|
|
185
|
+
*
|
|
186
|
+
* 渲染层在飞刀飞行动画结束后调用
|
|
187
|
+
*/
|
|
188
|
+
export declare function throwKnife(state: KnifeHitState): KnifeHitState;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* checkLevelComplete:检测当前关卡是否通关
|
|
192
|
+
* 通关条件:knivesRemaining == 0 且 gameOver == false
|
|
193
|
+
*/
|
|
194
|
+
export declare function checkLevelComplete(
|
|
195
|
+
state: KnifeHitState,
|
|
196
|
+
): { complete: boolean; totalScore: number; applesCollected: number };
|