@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,317 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
|
|
3
|
+
// ─── Easing 函数库 ───
|
|
4
|
+
|
|
5
|
+
export type EasingFn = (t: number) => number;
|
|
6
|
+
|
|
7
|
+
export const Easing = {
|
|
8
|
+
linear: (t: number) => t,
|
|
9
|
+
easeOutQuad: (t: number) => 1 - (1 - t) * (1 - t),
|
|
10
|
+
easeInOutQuad: (t: number) => t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2,
|
|
11
|
+
easeOutCubic: (t: number) => 1 - Math.pow(1 - t, 3),
|
|
12
|
+
easeInOutCubic: (t: number) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2,
|
|
13
|
+
easeOutBack: (t: number) => {
|
|
14
|
+
const c1 = 1.70158;
|
|
15
|
+
const c3 = c1 + 1;
|
|
16
|
+
return 1 + c3 * Math.pow(t - 1, 3) + c1 * Math.pow(t - 1, 2);
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// ─── 动画参数接口 ───
|
|
21
|
+
|
|
22
|
+
export interface SlideOutParams {
|
|
23
|
+
/** 要滑出的物体列表 */
|
|
24
|
+
objects: THREE.Object3D[];
|
|
25
|
+
/** 滑出方向 (dx 控制 X 轴, dz 控制 Z 轴) */
|
|
26
|
+
direction: { dx: number; dz: number };
|
|
27
|
+
/** 滑出总距离(世界单位) */
|
|
28
|
+
distance: number;
|
|
29
|
+
/** 动画时长 ms(默认 350) */
|
|
30
|
+
duration?: number;
|
|
31
|
+
/** 缓动函数(默认 easeOutQuad) */
|
|
32
|
+
easing?: EasingFn;
|
|
33
|
+
/** 动画完成回调 */
|
|
34
|
+
onComplete?: () => void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface FlyUpParams {
|
|
38
|
+
/** 要飞起的物体 */
|
|
39
|
+
object: THREE.Object3D;
|
|
40
|
+
/** 飞起高度(世界单位,默认 3) */
|
|
41
|
+
height?: number;
|
|
42
|
+
/** 前移距离(Z 方向,默认 1.5) */
|
|
43
|
+
forwardDistance?: number;
|
|
44
|
+
/** 动画时长 ms(默认 400) */
|
|
45
|
+
duration?: number;
|
|
46
|
+
/** 是否渐隐(默认 true) */
|
|
47
|
+
fadeOut?: boolean;
|
|
48
|
+
/** 缓动函数(默认 easeInOutQuad) */
|
|
49
|
+
easing?: EasingFn;
|
|
50
|
+
/** 动画完成回调 */
|
|
51
|
+
onComplete?: () => void;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Three.js 3D 路径动画管理器
|
|
56
|
+
*
|
|
57
|
+
* 基于 requestAnimationFrame 的轻量动画系统(零第三方依赖)。
|
|
58
|
+
* 提供棋盘游戏常用的动画操作:
|
|
59
|
+
* - slideOut:物体沿方向滑出(路径推出)
|
|
60
|
+
* - flyUp:物体升起并渐隐消失(飞入篮子视觉)
|
|
61
|
+
* - shake:物体抖动反馈(被阻挡)
|
|
62
|
+
* - scaleOut:物体缩放消失(三消消除)
|
|
63
|
+
*
|
|
64
|
+
* 支持物体从 parent group 中 detach 后独立动画(不受 group shake 影响)。
|
|
65
|
+
*/
|
|
66
|
+
export class AnimationManager3D {
|
|
67
|
+
private scene: THREE.Scene;
|
|
68
|
+
private activeRAFs: Set<number> = new Set();
|
|
69
|
+
private detachedObjects: THREE.Object3D[] = [];
|
|
70
|
+
|
|
71
|
+
constructor(scene: THREE.Scene) {
|
|
72
|
+
this.scene = scene;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 沿方向滑出一组物体(保持相对位置)。
|
|
77
|
+
* 动画期间物体会被从当前 parent detach 到 scene 根节点。
|
|
78
|
+
*/
|
|
79
|
+
slideOut(params: SlideOutParams): void {
|
|
80
|
+
const {
|
|
81
|
+
objects,
|
|
82
|
+
direction,
|
|
83
|
+
distance,
|
|
84
|
+
duration = 350,
|
|
85
|
+
easing = Easing.easeOutQuad,
|
|
86
|
+
onComplete,
|
|
87
|
+
} = params;
|
|
88
|
+
|
|
89
|
+
if (objects.length === 0) {
|
|
90
|
+
onComplete?.();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Detach objects from their parent, preserve world position
|
|
95
|
+
const worldPositions = objects.map((obj) => {
|
|
96
|
+
const wp = new THREE.Vector3();
|
|
97
|
+
obj.getWorldPosition(wp);
|
|
98
|
+
return wp;
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
for (let i = 0; i < objects.length; i++) {
|
|
102
|
+
const obj = objects[i];
|
|
103
|
+
obj.parent?.remove(obj);
|
|
104
|
+
obj.position.copy(worldPositions[i]);
|
|
105
|
+
this.scene.add(obj);
|
|
106
|
+
this.detachedObjects.push(obj);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Animate
|
|
110
|
+
const startTime = performance.now();
|
|
111
|
+
|
|
112
|
+
const animate = () => {
|
|
113
|
+
const elapsed = performance.now() - startTime;
|
|
114
|
+
const progress = Math.min(elapsed / duration, 1);
|
|
115
|
+
const eased = easing(progress);
|
|
116
|
+
|
|
117
|
+
const offsetX = direction.dx * distance * eased;
|
|
118
|
+
const offsetZ = direction.dz * distance * eased;
|
|
119
|
+
|
|
120
|
+
for (let i = 0; i < objects.length; i++) {
|
|
121
|
+
objects[i].position.x = worldPositions[i].x + offsetX;
|
|
122
|
+
objects[i].position.z = worldPositions[i].z + offsetZ;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (progress < 1) {
|
|
126
|
+
const id = requestAnimationFrame(animate);
|
|
127
|
+
this.activeRAFs.add(id);
|
|
128
|
+
} else {
|
|
129
|
+
// 动画完成,移除物体
|
|
130
|
+
for (const obj of objects) {
|
|
131
|
+
this.scene.remove(obj);
|
|
132
|
+
this.removeFromDetached(obj);
|
|
133
|
+
}
|
|
134
|
+
onComplete?.();
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const id = requestAnimationFrame(animate);
|
|
139
|
+
this.activeRAFs.add(id);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* 物体升起并渐隐消失(飞入篮子 / 收集效果)
|
|
144
|
+
*/
|
|
145
|
+
flyUp(params: FlyUpParams): void {
|
|
146
|
+
const {
|
|
147
|
+
object,
|
|
148
|
+
height = 3,
|
|
149
|
+
forwardDistance = 1.5,
|
|
150
|
+
duration = 400,
|
|
151
|
+
fadeOut = true,
|
|
152
|
+
easing = Easing.easeInOutQuad,
|
|
153
|
+
onComplete,
|
|
154
|
+
} = params;
|
|
155
|
+
|
|
156
|
+
if (!object.parent) {
|
|
157
|
+
onComplete?.();
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const startPos = object.position.clone();
|
|
162
|
+
const startScale = object.scale.x;
|
|
163
|
+
const startTime = performance.now();
|
|
164
|
+
|
|
165
|
+
const animate = () => {
|
|
166
|
+
const elapsed = performance.now() - startTime;
|
|
167
|
+
const progress = Math.min(elapsed / duration, 1);
|
|
168
|
+
const eased = easing(progress);
|
|
169
|
+
|
|
170
|
+
// Move up + forward
|
|
171
|
+
object.position.y = startPos.y + eased * height;
|
|
172
|
+
object.position.z = startPos.z + eased * forwardDistance;
|
|
173
|
+
|
|
174
|
+
// Scale down
|
|
175
|
+
const scale = startScale * (1 - eased * 0.8);
|
|
176
|
+
object.scale.set(scale, scale, scale);
|
|
177
|
+
|
|
178
|
+
// Fade out
|
|
179
|
+
if (fadeOut) {
|
|
180
|
+
object.traverse((child) => {
|
|
181
|
+
if (child instanceof THREE.Mesh) {
|
|
182
|
+
const mat = child.material as THREE.MeshStandardMaterial;
|
|
183
|
+
if (!mat.transparent) mat.transparent = true;
|
|
184
|
+
mat.opacity = 1 - eased;
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (progress < 1) {
|
|
190
|
+
const id = requestAnimationFrame(animate);
|
|
191
|
+
this.activeRAFs.add(id);
|
|
192
|
+
} else {
|
|
193
|
+
object.parent?.remove(object);
|
|
194
|
+
this.removeFromDetached(object);
|
|
195
|
+
onComplete?.();
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
const id = requestAnimationFrame(animate);
|
|
200
|
+
this.activeRAFs.add(id);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* 物体抖动反馈(被阻挡效果)
|
|
205
|
+
*/
|
|
206
|
+
shake(
|
|
207
|
+
object: THREE.Object3D,
|
|
208
|
+
intensity: number = 0.08,
|
|
209
|
+
duration: number = 300,
|
|
210
|
+
): void {
|
|
211
|
+
const originalX = object.position.x;
|
|
212
|
+
const originalZ = object.position.z;
|
|
213
|
+
const startTime = performance.now();
|
|
214
|
+
|
|
215
|
+
const animate = () => {
|
|
216
|
+
const elapsed = performance.now() - startTime;
|
|
217
|
+
const progress = Math.min(elapsed / duration, 1);
|
|
218
|
+
|
|
219
|
+
if (progress < 1) {
|
|
220
|
+
const decay = 1 - progress;
|
|
221
|
+
object.position.x = originalX + Math.sin(progress * Math.PI * 6) * intensity * decay;
|
|
222
|
+
object.position.z = originalZ + Math.cos(progress * Math.PI * 4) * intensity * decay * 0.5;
|
|
223
|
+
const id = requestAnimationFrame(animate);
|
|
224
|
+
this.activeRAFs.add(id);
|
|
225
|
+
} else {
|
|
226
|
+
object.position.x = originalX;
|
|
227
|
+
object.position.z = originalZ;
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
const id = requestAnimationFrame(animate);
|
|
232
|
+
this.activeRAFs.add(id);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* 物体缩放消失(三消消除效果)
|
|
237
|
+
*/
|
|
238
|
+
scaleOut(
|
|
239
|
+
object: THREE.Object3D,
|
|
240
|
+
duration: number = 300,
|
|
241
|
+
onComplete?: () => void,
|
|
242
|
+
): void {
|
|
243
|
+
const startScale = object.scale.x;
|
|
244
|
+
const startTime = performance.now();
|
|
245
|
+
|
|
246
|
+
const animate = () => {
|
|
247
|
+
const elapsed = performance.now() - startTime;
|
|
248
|
+
const progress = Math.min(elapsed / duration, 1);
|
|
249
|
+
|
|
250
|
+
// Scale up briefly then shrink to 0
|
|
251
|
+
let scale: number;
|
|
252
|
+
if (progress < 0.3) {
|
|
253
|
+
scale = startScale * (1 + (progress / 0.3) * 0.3); // expand to 1.3x
|
|
254
|
+
} else {
|
|
255
|
+
const t = (progress - 0.3) / 0.7;
|
|
256
|
+
scale = startScale * 1.3 * (1 - t); // shrink to 0
|
|
257
|
+
}
|
|
258
|
+
object.scale.set(scale, scale, scale);
|
|
259
|
+
|
|
260
|
+
// Fade
|
|
261
|
+
object.traverse((child) => {
|
|
262
|
+
if (child instanceof THREE.Mesh) {
|
|
263
|
+
const mat = child.material as THREE.MeshStandardMaterial;
|
|
264
|
+
if (!mat.transparent) mat.transparent = true;
|
|
265
|
+
mat.opacity = 1 - progress;
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
if (progress < 1) {
|
|
270
|
+
const id = requestAnimationFrame(animate);
|
|
271
|
+
this.activeRAFs.add(id);
|
|
272
|
+
} else {
|
|
273
|
+
object.parent?.remove(object);
|
|
274
|
+
this.removeFromDetached(object);
|
|
275
|
+
onComplete?.();
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
const id = requestAnimationFrame(animate);
|
|
280
|
+
this.activeRAFs.add(id);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* 取消所有进行中的动画
|
|
285
|
+
*/
|
|
286
|
+
cancelAll(): void {
|
|
287
|
+
for (const id of this.activeRAFs) {
|
|
288
|
+
cancelAnimationFrame(id);
|
|
289
|
+
}
|
|
290
|
+
this.activeRAFs.clear();
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* 清理所有被 detach 的物体(用于关卡重置)
|
|
295
|
+
*/
|
|
296
|
+
cleanupDetached(): void {
|
|
297
|
+
for (const obj of this.detachedObjects) {
|
|
298
|
+
this.scene.remove(obj);
|
|
299
|
+
}
|
|
300
|
+
this.detachedObjects = [];
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* 销毁
|
|
305
|
+
*/
|
|
306
|
+
dispose(): void {
|
|
307
|
+
this.cancelAll();
|
|
308
|
+
this.cleanupDetached();
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// ── 内部方法 ──
|
|
312
|
+
|
|
313
|
+
private removeFromDetached(obj: THREE.Object3D): void {
|
|
314
|
+
const idx = this.detachedObjects.indexOf(obj);
|
|
315
|
+
if (idx >= 0) this.detachedObjects.splice(idx, 1);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: path_elimination_rules.aigameplay
|
|
3
|
+
description: 路径消除玩法核心规则(PGS)。棋盘上有多条彩色折线路径,末端有方向箭头。玩家点击箭头头部:出口方向空闲则消除路径;被阻挡则扣命。全部路径消除后胜利,生命耗尽或倒计时归零则失败。
|
|
4
|
+
triggers: 需要生成路径消除类玩法的 reducer、PGS schema、关卡规则时触发。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 路径消除玩法(Path Elimination)
|
|
8
|
+
|
|
9
|
+
## 玩法说明
|
|
10
|
+
|
|
11
|
+
棋盘上有若干彩色折线路径(polyline),每条路径末端有一个方向箭头。玩家点击箭头头部尝试消除该路径:
|
|
12
|
+
|
|
13
|
+
- **成功消除**:箭头方向上到棋盘边界的所有格子均空闲 → 路径滑出动画 → 加入已消除集合 → 连击计数
|
|
14
|
+
- **阻挡失败**:出口方向被其他路径占据 → 阻挡动画 → 扣除 1 条命 → 连击重置
|
|
15
|
+
- **胜利**:所有路径消除(`removedPaths.size >= level.paths.length`)
|
|
16
|
+
- **失败**:生命值归零(`currentLives <= 0`)或倒计时归零(仅当 `levelTime > 0`)
|
|
17
|
+
|
|
18
|
+
## Recipe
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"kind": "pgs",
|
|
23
|
+
"pgsVersion": "1.0",
|
|
24
|
+
"gameplayType": "path_elimination",
|
|
25
|
+
"rules": {
|
|
26
|
+
"gridSizeDynamic": true,
|
|
27
|
+
"livesInitial": 3,
|
|
28
|
+
"timerOptional": true,
|
|
29
|
+
"comboEnabled": true
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
完整 PGS Schema 见 `ref/pgs-schema.json`。
|
|
35
|
+
|
|
36
|
+
## Result
|
|
37
|
+
|
|
38
|
+
产物为 `ref/pgs-schema.json`,描述完整的路径消除玩法规则,包含:
|
|
39
|
+
|
|
40
|
+
- 实体定义(grid / path / lives / timer / combo)
|
|
41
|
+
- 规则(命中检测 / 消除逻辑 / 阻挡逻辑 / 连击 / 输入锁)
|
|
42
|
+
- 关卡数据 schema(RawLevelJson 格式)
|
|
43
|
+
- 算法步骤(8 步主循环)
|
|
44
|
+
- 胜负条件
|
|
45
|
+
- 5 个测试用例
|
|
46
|
+
|
|
47
|
+
## Binding
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"role": "gameplayRule",
|
|
52
|
+
"target": "src/game/",
|
|
53
|
+
"type": "gameplay-module-reference",
|
|
54
|
+
"constraints": {
|
|
55
|
+
"requiredComponents": [
|
|
56
|
+
"arrow_path_data_format.aicomponent",
|
|
57
|
+
"path_renderer.aicomponent",
|
|
58
|
+
"path_animation.aicomponent",
|
|
59
|
+
"path_input_handler.aicomponent",
|
|
60
|
+
"level_lifecycle.aicomponent"
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Skill Definition
|
|
67
|
+
|
|
68
|
+
```yaml
|
|
69
|
+
tools:
|
|
70
|
+
- read_file
|
|
71
|
+
- write_file
|
|
72
|
+
inputs:
|
|
73
|
+
- pgsSchema: ref/pgs-schema.json
|
|
74
|
+
outputs:
|
|
75
|
+
- reducerTemplate: game logic reducer based on PGS schema
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## 与旧 arrow_escape_core.aigameplay 的区别
|
|
79
|
+
|
|
80
|
+
| 维度 | 旧版(已废弃) | 新版 |
|
|
81
|
+
|-----|------------|-----|
|
|
82
|
+
| 玩法描述 | 玩家放置箭头引导角色到出口(roguelike 移动) | 玩家点击路径箭头头部消除(拼图消除) |
|
|
83
|
+
| 网格模型 | 固定 6×6,cell 有 arrow/wall/trap/exit 类型 | 动态尺寸,path 为折线实体,grid 仅作坐标系 |
|
|
84
|
+
| 输入 | 放置/旋转箭头(消耗步数) | 点击路径头部(不消耗步数,有生命值) |
|
|
85
|
+
| 胜负 | 角色到达 exit / 到达 trap 或出界 | 路径全消除 / 生命归零或超时 |
|
|
86
|
+
| 消除机制 | 不存在 | 路径沿方向滑出棋盘(需出口方向空闲) |
|
|
87
|
+
|
|
88
|
+
旧版 `arrow_escape_core.aigameplay` 已被本 skill 替代,可安全删除。
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "path_elimination_rules.aigameplay",
|
|
4
|
+
"bundleType": "aigameplay",
|
|
5
|
+
"category": "gameplay",
|
|
6
|
+
"mode": "fixed",
|
|
7
|
+
"label": { "zh": "路径消除核心玩法", "en": "Path elimination core gameplay" },
|
|
8
|
+
"tags": ["gameplay", "path", "elimination", "arrow", "puzzle", "grid", "core", "swipe"],
|
|
9
|
+
"bindingRoles": ["gameplayRule"],
|
|
10
|
+
"generation": {
|
|
11
|
+
"kind": "pgs",
|
|
12
|
+
"pgsVersion": "1.0",
|
|
13
|
+
"gameplayType": "path_elimination",
|
|
14
|
+
"rules": {
|
|
15
|
+
"gridSizeDynamic": true,
|
|
16
|
+
"livesInitial": 3,
|
|
17
|
+
"timerOptional": true,
|
|
18
|
+
"comboEnabled": true
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"result": {
|
|
22
|
+
"outputFile": "ref/pgs-schema.json",
|
|
23
|
+
"format": "json",
|
|
24
|
+
"constraints": { "testCasesMustPass": true }
|
|
25
|
+
},
|
|
26
|
+
"binding": {
|
|
27
|
+
"role": "gameplayRule",
|
|
28
|
+
"target": "src/game/",
|
|
29
|
+
"type": "gameplay-module-reference",
|
|
30
|
+
"constraints": {
|
|
31
|
+
"requiredComponents": [
|
|
32
|
+
"arrow_path_data_format.aicomponent",
|
|
33
|
+
"path_renderer.aicomponent",
|
|
34
|
+
"path_animation.aicomponent",
|
|
35
|
+
"path_input_handler.aicomponent",
|
|
36
|
+
"level_lifecycle.aicomponent"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"imports": [
|
|
41
|
+
{ "slot": "engine", "pinAtomId": "phaser.aicomponent", "edgeKind": "requires", "bindAs": "engine" },
|
|
42
|
+
{ "slot": "levelData", "pinAtomId": "arrow_path_data_format.aicomponent","edgeKind": "requires", "bindAs": "levelData" },
|
|
43
|
+
{ "slot": "renderer", "pinAtomId": "path_renderer.aicomponent", "edgeKind": "requires", "bindAs": "renderer" },
|
|
44
|
+
{ "slot": "animator", "pinAtomId": "path_animation.aicomponent", "edgeKind": "requires", "bindAs": "animator" },
|
|
45
|
+
{ "slot": "input", "pinAtomId": "path_input_handler.aicomponent", "edgeKind": "requires", "bindAs": "input" },
|
|
46
|
+
{ "slot": "lifecycle", "pinAtomId": "level_lifecycle.aicomponent", "edgeKind": "requires", "bindAs": "lifecycle" },
|
|
47
|
+
{ "slot": "boardLayout","pinAtomId": "grid_board_layout.aicomponent", "edgeKind": "requires", "bindAs": "boardLayout" },
|
|
48
|
+
{
|
|
49
|
+
"slot": "directionalIndicator",
|
|
50
|
+
"description": "棋盘上每条路径末端的方向指示视觉资源(4 方向箭头),可替换为其他视觉风格",
|
|
51
|
+
"bindAs": "directionSprite",
|
|
52
|
+
"required": false,
|
|
53
|
+
"edgeKind": "compatibleWith",
|
|
54
|
+
"matchBindingRoles": ["directionalIndicator"],
|
|
55
|
+
"allowedBundleTypes": ["aiimage"],
|
|
56
|
+
"constraints": { "directions": 4 },
|
|
57
|
+
"cardinality": 1
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"slot": "bgMusic",
|
|
61
|
+
"description": "背景循环音乐",
|
|
62
|
+
"bindAs": "bgm",
|
|
63
|
+
"required": false,
|
|
64
|
+
"edgeKind": "compatibleWith",
|
|
65
|
+
"matchBindingRoles": ["bgMusic"],
|
|
66
|
+
"allowedBundleTypes": ["aiaudio"],
|
|
67
|
+
"constraints": { "loop": true }
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"slot": "levelDataPack",
|
|
71
|
+
"description": "关卡数据包(RawLevelJson 数组)",
|
|
72
|
+
"bindAs": "levels",
|
|
73
|
+
"required": true,
|
|
74
|
+
"edgeKind": "compatibleWith",
|
|
75
|
+
"matchBindingRoles": ["levelDataPack"],
|
|
76
|
+
"allowedBundleTypes": ["aiconfig"]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"slot": "themeVariant",
|
|
80
|
+
"description": "主题变体配置(颜色/关卡模式等)",
|
|
81
|
+
"bindAs": "theme",
|
|
82
|
+
"required": false,
|
|
83
|
+
"edgeKind": "compatibleWith",
|
|
84
|
+
"matchBindingRoles": ["themeVariantConfig"],
|
|
85
|
+
"allowedBundleTypes": ["aiconfig"]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"slot": "winPanel",
|
|
89
|
+
"description": "通关反馈面板视觉",
|
|
90
|
+
"bindAs": "winPanel",
|
|
91
|
+
"required": false,
|
|
92
|
+
"edgeKind": "compatibleWith",
|
|
93
|
+
"matchBindingRoles": ["successFeedbackPanel"],
|
|
94
|
+
"allowedBundleTypes": ["aiimage"]
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"slot": "losePanel",
|
|
98
|
+
"description": "失败反馈面板视觉",
|
|
99
|
+
"bindAs": "losePanel",
|
|
100
|
+
"required": false,
|
|
101
|
+
"edgeKind": "compatibleWith",
|
|
102
|
+
"matchBindingRoles": ["failFeedbackPanel"],
|
|
103
|
+
"allowedBundleTypes": ["aiimage"]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"slot": "background",
|
|
107
|
+
"description": "游戏背景图",
|
|
108
|
+
"bindAs": "bg",
|
|
109
|
+
"required": false,
|
|
110
|
+
"edgeKind": "compatibleWith",
|
|
111
|
+
"matchBindingRoles": ["backgroundTexture"],
|
|
112
|
+
"allowedBundleTypes": ["aiimage"]
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
"files": {
|
|
116
|
+
"skill": "SKILL.md",
|
|
117
|
+
"pgsSchema": "ref/pgs-schema.json"
|
|
118
|
+
}
|
|
119
|
+
}
|