@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,17 @@
|
|
|
1
|
+
// particle-confetti — HTML5 Canvas sprite sheet approach
|
|
2
|
+
// Uses the bundled confetti.png VFX sprite sheet.
|
|
3
|
+
// Import SpritesheetEffect from particle-explosion html5-spritesheet.js
|
|
4
|
+
|
|
5
|
+
// Load:
|
|
6
|
+
// const confettiImg = new Image();
|
|
7
|
+
// confettiImg.src = 'assets/vfx/confetti.png';
|
|
8
|
+
|
|
9
|
+
// Play centered:
|
|
10
|
+
// const fx = new SpritesheetEffect(ctx, {
|
|
11
|
+
// image: confettiImg,
|
|
12
|
+
// frameW: 96, frameH: 96,
|
|
13
|
+
// frames: 12, columns: 4,
|
|
14
|
+
// fps: 12,
|
|
15
|
+
// x: canvas.width / 2,
|
|
16
|
+
// y: canvas.height / 2,
|
|
17
|
+
// });
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// particle-confetti — Phaser 3 implementation
|
|
2
|
+
|
|
3
|
+
function celebrationConfetti(scene, {
|
|
4
|
+
count = 80,
|
|
5
|
+
duration = 2000,
|
|
6
|
+
colors = [0xFF4444, 0x44AAFF, 0x44DD44, 0xFFD700, 0xCC44FF],
|
|
7
|
+
gravity = 300,
|
|
8
|
+
} = {}) {
|
|
9
|
+
const { width } = scene.cameras.main;
|
|
10
|
+
|
|
11
|
+
const emitter = scene.add.particles(0, -20, '__DEFAULT', {
|
|
12
|
+
x: { min: 0, max: width },
|
|
13
|
+
speedX: { min: -100, max: 100 },
|
|
14
|
+
speedY: { min: 50, max: 200 },
|
|
15
|
+
gravityY: gravity,
|
|
16
|
+
lifespan: duration * 1.2,
|
|
17
|
+
quantity: Math.ceil(count / (duration / 100)),
|
|
18
|
+
frequency: 100,
|
|
19
|
+
scale: { min: 0.5, max: 1.5 },
|
|
20
|
+
alpha: { start: 1, end: 0 },
|
|
21
|
+
tint: colors,
|
|
22
|
+
rotate: { min: 0, max: 360 },
|
|
23
|
+
angularVelocity: { min: -200, max: 200 },
|
|
24
|
+
blendMode: 'NORMAL',
|
|
25
|
+
}).setDepth(100);
|
|
26
|
+
|
|
27
|
+
// Stop emitting after duration, let existing particles finish
|
|
28
|
+
scene.time.delayedCall(duration, () => {
|
|
29
|
+
emitter.stop();
|
|
30
|
+
scene.time.delayedCall(duration * 1.5, () => emitter.destroy());
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
return emitter;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Usage:
|
|
37
|
+
// celebrationConfetti(this); // full screen confetti shower
|
|
38
|
+
// celebrationConfetti(this, { count: 40, duration: 1000 }); // shorter burst
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# particle-explosion — Particle Explosion VFX
|
|
2
|
+
|
|
3
|
+
Burst of particles radiating outward from a point, with gravity falloff. Used for match clears, impact feedback, coin bursts, and destruction effects.
|
|
4
|
+
|
|
5
|
+
## Two Approaches
|
|
6
|
+
|
|
7
|
+
### Approach A: Sprite Sheet (Cross-Engine, Recommended)
|
|
8
|
+
Use the bundled `explosion_small.png` VFX sprite sheet:
|
|
9
|
+
```bash
|
|
10
|
+
playcraft image use-vfx --preset explosion_small --output assets/vfx/explosion.png
|
|
11
|
+
```
|
|
12
|
+
Combine with `sprite-animation-2d.aicomponent` to play the sequence.
|
|
13
|
+
|
|
14
|
+
**Pros**: Works in any engine, no particle system needed, consistent look, small file size.
|
|
15
|
+
|
|
16
|
+
### Approach B: Runtime Particles (Engine-Native)
|
|
17
|
+
Use the engine's particle system for fully dynamic, physics-based explosions.
|
|
18
|
+
|
|
19
|
+
**Pros**: Randomized, interactive, physics-accurate. **Cons**: More complex, engine-specific.
|
|
20
|
+
|
|
21
|
+
## Parameters
|
|
22
|
+
|
|
23
|
+
| Parameter | Default | Description |
|
|
24
|
+
|-----------|---------|-------------|
|
|
25
|
+
| `count` | 12 | Number of particles |
|
|
26
|
+
| `lifetime` | 0.6s | How long each particle lives |
|
|
27
|
+
| `speed` | 150px/s | Initial outward velocity |
|
|
28
|
+
| `gravity` | 200px/s² | Downward acceleration |
|
|
29
|
+
| `size` | 6px | Particle size |
|
|
30
|
+
| `colorRange` | warm colors | Color palette |
|
|
31
|
+
|
|
32
|
+
## Engine References
|
|
33
|
+
|
|
34
|
+
- **Sprite sheet** (recommended): Use `sprite-animation-2d.aicomponent` + `explosion_small` VFX preset
|
|
35
|
+
- **Phaser 3 particles**: `ref/phaser.js`
|
|
36
|
+
- **PlayCanvas**: `ref/playcanvas.js`
|
|
37
|
+
- **HTML5 Canvas**: `ref/html5-spritesheet.js`
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "particle-explosion.aicomponent",
|
|
4
|
+
"bundleType": "aicomponent",
|
|
5
|
+
"category": "vfx",
|
|
6
|
+
"mode": "fixed",
|
|
7
|
+
"label": { "zh": "粒子爆炸特效", "en": "Particle Explosion VFX" },
|
|
8
|
+
"tags": ["vfx", "particle", "explosion", "impact", "playcanvas", "phaser", "html5"],
|
|
9
|
+
"generation": {
|
|
10
|
+
"animationType": "particle",
|
|
11
|
+
"engineSupport": ["playcanvas", "phaser", "html5-spritesheet"],
|
|
12
|
+
"parameters": {
|
|
13
|
+
"count": "number — particle count (default: 12)",
|
|
14
|
+
"lifetime": "number — particle lifetime in seconds (default: 0.6)",
|
|
15
|
+
"speed": "number — initial particle speed (default: 150)",
|
|
16
|
+
"gravity": "number — downward gravity (default: 200)",
|
|
17
|
+
"colorRange": "string[] — color palette for particles",
|
|
18
|
+
"size": "number — particle size in pixels (default: 6)",
|
|
19
|
+
"x": "number — spawn X position",
|
|
20
|
+
"y": "number — spawn Y position"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"files": { "skill": "SKILL.md", "playcanvas": "ref/playcanvas.js", "phaser": "ref/phaser.js", "html5": "ref/html5-spritesheet.js" }
|
|
24
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// particle-explosion — HTML5 Canvas sprite sheet approach
|
|
2
|
+
// Play the explosion_small.png sprite sheet at a given position.
|
|
3
|
+
|
|
4
|
+
class SpritesheetEffect {
|
|
5
|
+
constructor(ctx, { image, frameW, frameH, frames, columns, fps = 16, x, y }) {
|
|
6
|
+
this.ctx = ctx;
|
|
7
|
+
this.image = image;
|
|
8
|
+
this.frameW = frameW;
|
|
9
|
+
this.frameH = frameH;
|
|
10
|
+
this.frames = frames;
|
|
11
|
+
this.columns = columns;
|
|
12
|
+
this.fps = fps;
|
|
13
|
+
this.x = x - frameW / 2;
|
|
14
|
+
this.y = y - frameH / 2;
|
|
15
|
+
this._frame = 0;
|
|
16
|
+
this._elapsed = 0;
|
|
17
|
+
this._done = false;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
update(dt) {
|
|
21
|
+
if (this._done) return;
|
|
22
|
+
this._elapsed += dt;
|
|
23
|
+
const frameDuration = 1 / this.fps;
|
|
24
|
+
while (this._elapsed >= frameDuration) {
|
|
25
|
+
this._elapsed -= frameDuration;
|
|
26
|
+
this._frame++;
|
|
27
|
+
if (this._frame >= this.frames) { this._done = true; return; }
|
|
28
|
+
}
|
|
29
|
+
const col = this._frame % this.columns;
|
|
30
|
+
const row = Math.floor(this._frame / this.columns);
|
|
31
|
+
this.ctx.drawImage(this.image, col * this.frameW, row * this.frameH, this.frameW, this.frameH, this.x, this.y, this.frameW, this.frameH);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
get done() { return this._done; }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Usage:
|
|
38
|
+
// const img = new Image(); img.src = 'assets/vfx/explosion_small.png';
|
|
39
|
+
// const fx = new SpritesheetEffect(ctx, { image: img, frameW: 64, frameH: 64, frames: 8, columns: 4, fps: 16, x: 200, y: 300 });
|
|
40
|
+
// // In game loop: fx.update(dt); if (fx.done) removeFromScene(fx);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// particle-explosion — Phaser 3 implementation
|
|
2
|
+
// Uses Phaser 3.60+ Particle Emitter API.
|
|
3
|
+
|
|
4
|
+
function createExplosion(scene, { x, y, count = 12, speed = 150, lifetime = 600, colors = [0xFFAA00, 0xFF6600, 0xFF2200, 0xFFFF00] } = {}) {
|
|
5
|
+
// Approach A: Sprite sheet (preferred if explosion_small.png is available)
|
|
6
|
+
if (scene.textures.exists('vfx_explosion')) {
|
|
7
|
+
const sprite = scene.add.sprite(x, y, 'vfx_explosion').setDepth(50);
|
|
8
|
+
sprite.play('vfx_explosion_play');
|
|
9
|
+
sprite.on('animationcomplete', () => sprite.destroy());
|
|
10
|
+
return sprite;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Approach B: Runtime particles (fallback)
|
|
14
|
+
const particles = scene.add.particles(x, y, '__DEFAULT', {
|
|
15
|
+
speed: { min: speed * 0.3, max: speed },
|
|
16
|
+
lifespan: lifetime,
|
|
17
|
+
quantity: count,
|
|
18
|
+
gravityY: 200,
|
|
19
|
+
scale: { start: 1, end: 0 },
|
|
20
|
+
alpha: { start: 1, end: 0 },
|
|
21
|
+
tint: colors,
|
|
22
|
+
blendMode: 'ADD',
|
|
23
|
+
emitting: false,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
particles.explode(count, x, y);
|
|
27
|
+
scene.time.delayedCall(lifetime + 200, () => particles.destroy());
|
|
28
|
+
return particles;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Setup animation (call in preload + create):
|
|
32
|
+
function setupExplosionAnim(scene) {
|
|
33
|
+
if (scene.textures.exists('vfx_explosion') && !scene.anims.exists('vfx_explosion_play')) {
|
|
34
|
+
scene.anims.create({
|
|
35
|
+
key: 'vfx_explosion_play',
|
|
36
|
+
frames: scene.anims.generateFrameNumbers('vfx_explosion', { start: 0, end: 7 }),
|
|
37
|
+
frameRate: 16,
|
|
38
|
+
repeat: 0,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Usage:
|
|
44
|
+
// preload: this.load.spritesheet('vfx_explosion', 'assets/vfx/explosion_small.png', { frameWidth: 64, frameHeight: 64 });
|
|
45
|
+
// create: setupExplosionAnim(this);
|
|
46
|
+
// trigger: createExplosion(this, { x: tile.x, y: tile.y });
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// particle-explosion — PlayCanvas implementation
|
|
2
|
+
// Uses PlayCanvas ParticleSystem component.
|
|
3
|
+
|
|
4
|
+
// Entity setup (via editor or code):
|
|
5
|
+
// - Add ParticleSystem component
|
|
6
|
+
// - Set texture to explosion sprite sheet
|
|
7
|
+
// - Configure as one-shot (numParticles, loop: false)
|
|
8
|
+
|
|
9
|
+
var ExplosionVFX = pc.createScript('explosionVFX');
|
|
10
|
+
ExplosionVFX.attributes.add('particleAsset', { type: 'asset', assetType: 'texture' });
|
|
11
|
+
ExplosionVFX.attributes.add('count', { type: 'number', default: 12 });
|
|
12
|
+
ExplosionVFX.attributes.add('speed', { type: 'number', default: 150 });
|
|
13
|
+
ExplosionVFX.attributes.add('lifetime', { type: 'number', default: 0.6 });
|
|
14
|
+
|
|
15
|
+
ExplosionVFX.prototype.initialize = function () {
|
|
16
|
+
var ps = this.entity.particlesystem;
|
|
17
|
+
if (ps) {
|
|
18
|
+
ps.numParticles = this.count;
|
|
19
|
+
ps.startSpeed = new pc.CurveSet([[0, this.speed], [1, 0]]);
|
|
20
|
+
ps.lifetime = this.lifetime;
|
|
21
|
+
ps.loop = false;
|
|
22
|
+
ps.autoPlay = false;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
ExplosionVFX.prototype.burst = function (x, y, z) {
|
|
27
|
+
this.entity.setLocalPosition(x, y, z ?? 0);
|
|
28
|
+
var ps = this.entity.particlesystem;
|
|
29
|
+
if (ps) {
|
|
30
|
+
ps.reset();
|
|
31
|
+
ps.play();
|
|
32
|
+
}
|
|
33
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# particle-trail — Particle Trail VFX
|
|
2
|
+
|
|
3
|
+
A continuous stream of fading particles that follows a moving object. Creates motion blur / wake effects for projectiles, power-ups, and dashing characters.
|
|
4
|
+
|
|
5
|
+
## Use Cases
|
|
6
|
+
|
|
7
|
+
- **Projectile trail**: Arrow, bullet, fireball — follow the projectile
|
|
8
|
+
- **Dash trail**: Character dashing — brief trail on rapid movement
|
|
9
|
+
- **Collectible glow**: Coin/gem with ambient sparkle trail
|
|
10
|
+
- **Boss aura**: Constant particle aura around boss entity
|
|
11
|
+
|
|
12
|
+
## Parameters
|
|
13
|
+
|
|
14
|
+
| Parameter | Default | Description |
|
|
15
|
+
|-----------|---------|-------------|
|
|
16
|
+
| `count` | 20 | Max simultaneous particles |
|
|
17
|
+
| `lifetime` | 0.4s | How long each particle fades |
|
|
18
|
+
| `size` | 8px | Starting particle size |
|
|
19
|
+
| `color` | gold | Particle tint color |
|
|
20
|
+
| `emitRate` | 30/s | Particles emitted per second |
|
|
21
|
+
| `fadeOut` | true | Particles fade as they age |
|
|
22
|
+
|
|
23
|
+
## Engine References
|
|
24
|
+
|
|
25
|
+
- **Phaser 3**: `ref/phaser.js` — uses `scene.add.particles` with `follow()` mode
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "particle-trail.aicomponent",
|
|
4
|
+
"bundleType": "aicomponent",
|
|
5
|
+
"category": "vfx",
|
|
6
|
+
"mode": "fixed",
|
|
7
|
+
"label": { "zh": "粒子拖尾特效", "en": "Particle Trail VFX" },
|
|
8
|
+
"tags": ["vfx", "particle", "trail", "follow", "movement", "playcanvas", "phaser"],
|
|
9
|
+
"generation": {
|
|
10
|
+
"animationType": "particle",
|
|
11
|
+
"engineSupport": ["playcanvas", "phaser"],
|
|
12
|
+
"parameters": {
|
|
13
|
+
"target": "entity — object to follow",
|
|
14
|
+
"count": "number — max particles (default: 20)",
|
|
15
|
+
"lifetime": "number — particle lifetime in seconds (default: 0.4)",
|
|
16
|
+
"size": "number — particle start size (default: 8)",
|
|
17
|
+
"color": "string — particle color (default: '#FFD700')",
|
|
18
|
+
"offset": "number[] — [x, y] spawn offset from target center"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": { "skill": "SKILL.md", "phaser": "ref/phaser.js" }
|
|
22
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// particle-trail — Phaser 3 implementation
|
|
2
|
+
|
|
3
|
+
function createTrail(scene, target, {
|
|
4
|
+
count = 20,
|
|
5
|
+
lifetime = 400,
|
|
6
|
+
size = 8,
|
|
7
|
+
color = 0xFFD700,
|
|
8
|
+
emitRate = 30,
|
|
9
|
+
} = {}) {
|
|
10
|
+
const particles = scene.add.particles(0, 0, '__DEFAULT', {
|
|
11
|
+
lifespan: lifetime,
|
|
12
|
+
quantity: 1,
|
|
13
|
+
frequency: 1000 / emitRate,
|
|
14
|
+
scale: { start: size / 32, end: 0 },
|
|
15
|
+
alpha: { start: 0.8, end: 0 },
|
|
16
|
+
tint: color,
|
|
17
|
+
blendMode: 'ADD',
|
|
18
|
+
follow: target,
|
|
19
|
+
followOffset: { x: 0, y: 0 },
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
emitter: particles,
|
|
24
|
+
stop: () => { particles.stop(); scene.time.delayedCall(lifetime, () => particles.destroy()); },
|
|
25
|
+
destroy: () => particles.destroy(),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Usage:
|
|
30
|
+
// const trail = createTrail(this, projectileSprite, { color: 0xFF6600, size: 10 });
|
|
31
|
+
// // On hit: trail.stop();
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: path_animation.aicomponent
|
|
3
|
+
description: 路径消除玩法的动画导演。负责消除成功的路径滑出动画、被阻挡时的抖动/闪光动画、以及胜利时的钻石粒子动画。
|
|
4
|
+
triggers: 需要为路径消除/阻挡/胜利事件添加视觉动画反馈时触发。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 路径动画导演(Path Animation Director)
|
|
8
|
+
|
|
9
|
+
## 说明
|
|
10
|
+
|
|
11
|
+
`AnimationManager` 管理三类路径动画:
|
|
12
|
+
|
|
13
|
+
1. **消除滑出**(`animatePathOffBoard`):路径成功消除后,沿 `direction` 方向用 Tween 动画将路径整体滑出棋盘边界,最后从棋盘移除
|
|
14
|
+
2. **阻挡震动**(`animateBlockedPath`):路径被阻挡时,播放路径抖动 + 颜色闪红的反馈动画
|
|
15
|
+
3. **胜利钻石**(`playWinDiamondAnimation`):所有路径消除后,播放全屏钻石粒子爆炸效果
|
|
16
|
+
|
|
17
|
+
## Scaffold
|
|
18
|
+
|
|
19
|
+
| 目标路径 | 来源 | 说明 |
|
|
20
|
+
|---------|-----|-----|
|
|
21
|
+
| `src/game/scenes/GameUI/AnimationManager.ts` | `ref/AnimationManager.ts` | 完整动画管理类 |
|
|
22
|
+
|
|
23
|
+
## Imports
|
|
24
|
+
|
|
25
|
+
- `phaser.aicomponent`(硬依赖:Phaser Tweens + GameObjects API)
|
|
26
|
+
- `path_renderer.aicomponent`(硬依赖:PathRenderer / PathTrackCell 类型)
|
|
27
|
+
|
|
28
|
+
## Skill Definition
|
|
29
|
+
|
|
30
|
+
```yaml
|
|
31
|
+
tools:
|
|
32
|
+
- read_file
|
|
33
|
+
- write_file
|
|
34
|
+
inputs:
|
|
35
|
+
- source: src/game/scenes/GameUI/AnimationManager.ts
|
|
36
|
+
outputs:
|
|
37
|
+
- animationManager: AnimationManager class (animatePathOffBoard / animateBlockedPath / playWinDiamondAnimation)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Recipe
|
|
41
|
+
|
|
42
|
+
| 决策 | 原因 |
|
|
43
|
+
|------|------|
|
|
44
|
+
| **动画与游戏状态分离** | AnimationManager 通过回调(`onComplete`)通知游戏状态变更,不直接修改 `removedPaths` 等状态;状态变更时机由回调决定,动画完成后才生效 |
|
|
45
|
+
| **动画中锁定输入** | 路径滑出期间如允许新点击,可能导致状态不一致;`animatingPaths` Set 由 InputHandler 检查,AnimationManager 只管理动画本身 |
|
|
46
|
+
| **钻石粒子用 Graphics 实现** | 胜利粒子效果无需精灵资产,用 Graphics 随机绘制菱形;保持单一 skill 文件,零资产依赖 |
|
|
47
|
+
|
|
48
|
+
## Adapter
|
|
49
|
+
|
|
50
|
+
- **Role**: `pathAnimationDirector` — 路径消除/阻挡/胜利动画导演(Phaser Tweens 编排)
|
|
51
|
+
- **Provides**: `AnimationManager` 类(`animatePathOffBoard()`、`animateBlockedPath()`、`playWinDiamondAnimation()`、`resetBoardViewForWin()`)
|
|
52
|
+
- **Requires**: `phaser.aicomponent`(Tween + Graphics API)、`path_renderer.aicomponent`(PathRenderer / PathTrackCell 类型)
|
|
53
|
+
- **Consumed by**: `game_scene.aicomponent`(持有 AnimationManager,在消除/阻挡时调用对应方法)
|
|
54
|
+
- **Integration point**: `src/game/scenes/GameUI/AnimationManager.ts` → `Game.ts` 实例化并传给 InputHandler
|
|
55
|
+
|
|
56
|
+
## 关键接口
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
class AnimationManager {
|
|
60
|
+
// 路径成功消除的滑出动画
|
|
61
|
+
animatePathOffBoard(
|
|
62
|
+
pathIndex: number,
|
|
63
|
+
dx: number, dy: number, // 消除方向增量
|
|
64
|
+
stepsToExit: number, // 滑出步数
|
|
65
|
+
isLastPath: boolean, // 是否是最后一条路径
|
|
66
|
+
onComplete: () => void,
|
|
67
|
+
): void;
|
|
68
|
+
|
|
69
|
+
// 路径被阻挡的震动动画
|
|
70
|
+
animateBlockedPath(
|
|
71
|
+
pathIndex: number,
|
|
72
|
+
dx: number, dy: number,
|
|
73
|
+
stepsUntilBlock: number,
|
|
74
|
+
): void;
|
|
75
|
+
|
|
76
|
+
// 全部路径消除后的钻石粒子动画
|
|
77
|
+
playWinDiamondAnimation(): void;
|
|
78
|
+
|
|
79
|
+
// 胜利前重置棋盘缩放和位置
|
|
80
|
+
resetBoardViewForWin(): void;
|
|
81
|
+
}
|
|
82
|
+
```
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "path_animation.aicomponent",
|
|
4
|
+
"bundleType": "aicomponent",
|
|
5
|
+
"category": "component",
|
|
6
|
+
"mode": "fixed",
|
|
7
|
+
"label": { "zh": "路径动画导演", "en": "Path animation director" },
|
|
8
|
+
"tags": ["animation", "path", "tween", "phaser", "elimination", "blocked", "victory", "threejs", "3d", "raf"],
|
|
9
|
+
"bindingRoles": ["pathAnimationDirector"],
|
|
10
|
+
"renderBackend": ["phaser", "threejs"],
|
|
11
|
+
"engineVariants": {
|
|
12
|
+
"phaser": {
|
|
13
|
+
"imports": ["phaser.aicomponent", "path_renderer.aicomponent"],
|
|
14
|
+
"scaffoldFiles": {
|
|
15
|
+
"src/game/scenes/GameUI/AnimationManager.ts": { "source": "ref/AnimationManager.ts", "mode": "full", "weight": 10 }
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"threejs": {
|
|
19
|
+
"imports": ["threejs.aicomponent"],
|
|
20
|
+
"scaffoldFiles": {
|
|
21
|
+
"src/game/rendering/AnimationManager3D.ts": { "source": "ref/AnimationManager3D.ts", "mode": "full", "weight": 10 }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"scaffold": {
|
|
26
|
+
"files": {
|
|
27
|
+
"src/game/scenes/GameUI/AnimationManager.ts": {
|
|
28
|
+
"source": "ref/AnimationManager.ts",
|
|
29
|
+
"mode": "full",
|
|
30
|
+
"weight": 10
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"imports": [
|
|
35
|
+
{ "slot": "engine", "pinAtomId": "phaser.aicomponent", "edgeKind": "requires", "bindAs": "engine" },
|
|
36
|
+
{ "slot": "renderer", "pinAtomId": "path_renderer.aicomponent", "edgeKind": "requires", "bindAs": "renderer" },
|
|
37
|
+
{
|
|
38
|
+
"slot": "normalParticleAsset",
|
|
39
|
+
"description": "普通消除粒子特效图片资产",
|
|
40
|
+
"bindAs": "normalParticle",
|
|
41
|
+
"required": false,
|
|
42
|
+
"edgeKind": "compatibleWith",
|
|
43
|
+
"matchBindingRoles": ["particleAsset"],
|
|
44
|
+
"allowedBundleTypes": ["aiimage"]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"slot": "winParticleAsset",
|
|
48
|
+
"description": "胜利钻石粒子特效图片资产",
|
|
49
|
+
"bindAs": "winParticle",
|
|
50
|
+
"required": false,
|
|
51
|
+
"edgeKind": "compatibleWith",
|
|
52
|
+
"matchBindingRoles": ["particleAsset"],
|
|
53
|
+
"allowedBundleTypes": ["aiimage"]
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"exports": [
|
|
57
|
+
{ "name": "AnimationManager", "kind": "class", "location": "src/game/scenes/GameUI/AnimationManager.ts" },
|
|
58
|
+
{ "name": "AnimationManager3D", "kind": "class", "location": "src/game/rendering/AnimationManager3D.ts" },
|
|
59
|
+
{ "name": "Easing", "kind": "object", "location": "src/game/rendering/AnimationManager3D.ts" }
|
|
60
|
+
],
|
|
61
|
+
"neutralDescriptor": {
|
|
62
|
+
"geometry": "animation director for grid path objects: sliding exit animation, blocked flash animation, victory diamond particle animation",
|
|
63
|
+
"layers": ["tween", "particle-effect", "easing"],
|
|
64
|
+
"replaceable": ["exit animation style", "blocked animation style", "victory effect"]
|
|
65
|
+
},
|
|
66
|
+
"usageHints": [
|
|
67
|
+
"animatePathOffBoard:路径成功消除时沿方向滑出棋盘的动画",
|
|
68
|
+
"animateBlockedPath:路径被阻挡时的震动/闪红动画",
|
|
69
|
+
"playWinDiamondAnimation:全部路径消除后的胜利钻石粒子动画",
|
|
70
|
+
"resetBoardViewForWin:胜利时重置棋盘缩放/位置以适配动画"
|
|
71
|
+
],
|
|
72
|
+
"files": {
|
|
73
|
+
"skill": "SKILL.md",
|
|
74
|
+
"animationManager": "ref/AnimationManager.ts",
|
|
75
|
+
"animationManager3D": "ref/AnimationManager3D.ts"
|
|
76
|
+
}
|
|
77
|
+
}
|