@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,255 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: board_entity_sprite.aiimage
|
|
3
|
+
description: 棋盘实体精灵封包(单图+旋转) - 生成俯视方向实体(汽车/飞机/动物等),通过代码旋转实现4方向,替代传统箭头或4帧精灵图集方案
|
|
4
|
+
triggers: 汽车,car,实体,entity,精灵,sprite,方向,direction,俯视,top-down,棋盘,board,替换箭头,arrow replacement,停车,parking,逃脱,escape,puzzle
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# board_entity_sprite.aiimage
|
|
8
|
+
|
|
9
|
+
棋盘实体精灵封包。生成一张俯视角度的实体图片(如小汽车),通过运行时旋转实现上/下/左/右四个方向。
|
|
10
|
+
|
|
11
|
+
**相比旧版 4 帧精灵图集方案的优势:**
|
|
12
|
+
- 体积更小(1张 webp vs 4帧 png)
|
|
13
|
+
- AI 生图成功率更高(单物体 vs 4物体对齐)
|
|
14
|
+
- 代码更灵活(任意角度旋转,不限于4方向)
|
|
15
|
+
- 支持 tint 着色(同一图片不同颜色)
|
|
16
|
+
|
|
17
|
+
## Recipe
|
|
18
|
+
|
|
19
|
+
### Prompt 模板
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
top-down bird's eye view of a cute cartoon {entity}, facing upward, simple flat design, bright vivid colors, game asset, white background, centered on canvas, no shadow, 256x256 icon style
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**变量 `{entity}` 示例:**
|
|
26
|
+
- 交通工具:`car` / `race car` / `taxi` / `bus` / `airplane` / `rocket` / `boat`
|
|
27
|
+
- 动物:`fish` / `turtle` / `bird` / `cat`
|
|
28
|
+
- 其他:`UFO` / `finger pointing` / `arrow sign`
|
|
29
|
+
|
|
30
|
+
### 生成与后处理步骤
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# 1. AI 生成图片
|
|
34
|
+
playcraft tools generate-image \
|
|
35
|
+
--prompt "top-down bird's eye view of a cute cartoon car, facing upward, simple flat design, bright vivid colors, game asset, white background, centered on canvas, no shadow, 256x256 icon style" \
|
|
36
|
+
--aspect-ratio 1:1 \
|
|
37
|
+
--image-model google/gemini-3.1-flash-image-preview \
|
|
38
|
+
--output assets/images/car_raw.jpg
|
|
39
|
+
|
|
40
|
+
# 2. 去除背景(AI 生图通常为白色/浅色背景)
|
|
41
|
+
playcraft image remove-background \
|
|
42
|
+
--input assets/images/car_raw.jpg \
|
|
43
|
+
--output assets/images/car.png
|
|
44
|
+
|
|
45
|
+
# 3. 裁切透明边界
|
|
46
|
+
playcraft image trim \
|
|
47
|
+
--input assets/images/car.png \
|
|
48
|
+
--output assets/images/car_trimmed.png
|
|
49
|
+
|
|
50
|
+
# 4. 转为 webp(压缩 90%+)
|
|
51
|
+
playcraft image convert \
|
|
52
|
+
--input assets/images/car_trimmed.png \
|
|
53
|
+
--output assets/images/car.webp \
|
|
54
|
+
--quality 90
|
|
55
|
+
|
|
56
|
+
# 5. 清理中间文件
|
|
57
|
+
rm assets/images/car_raw.jpg assets/images/car_trimmed.png
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 风格变体
|
|
61
|
+
|
|
62
|
+
| 风格 | prompt 后缀 |
|
|
63
|
+
|------|------------|
|
|
64
|
+
| 卡通可爱 | `cute cartoon, rounded shapes, playful` |
|
|
65
|
+
| 像素风 | `pixel art style, 32x32, retro game` |
|
|
66
|
+
| 写实 | `realistic 3D render, studio lighting` |
|
|
67
|
+
| 霓虹科技 | `neon glowing, cyberpunk style, dark glow` |
|
|
68
|
+
| 手绘涂鸦 | `hand-drawn sketch, crayon style, children's drawing` |
|
|
69
|
+
|
|
70
|
+
## Result
|
|
71
|
+
|
|
72
|
+
- **产物文件**:`{entity}.webp`
|
|
73
|
+
- **格式**:WebP(透明背景),通常 20-50KB
|
|
74
|
+
- **图片特征**:
|
|
75
|
+
- 俯视角度(top-down bird's eye view)
|
|
76
|
+
- 居中无阴影
|
|
77
|
+
- 透明背景
|
|
78
|
+
- 默认朝向:需确认(通常朝上或朝下,取决于 AI 输出)
|
|
79
|
+
|
|
80
|
+
## Binding
|
|
81
|
+
|
|
82
|
+
- **Binding Role**:`boardEntitySprite`(兼容旧角色 `directionalIndicator`)
|
|
83
|
+
- **挂载目标**:`assets/images/{entity}.webp`
|
|
84
|
+
- **引用类型**:`image-asset-reference`
|
|
85
|
+
- **集成模式**:`single-image-rotation`
|
|
86
|
+
|
|
87
|
+
### 代码集成模式
|
|
88
|
+
|
|
89
|
+
#### 1. 导入与加载(Preloader)
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
// 导入
|
|
93
|
+
import carImage from "assets/images/car.webp";
|
|
94
|
+
|
|
95
|
+
// Preloader.preload()
|
|
96
|
+
this.load.image("car", carImage);
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
#### 2. 创建精灵(渲染器)
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
// 在棋盘格子中心创建精灵
|
|
103
|
+
const sprite = scene.add.image(cellCenterX, cellCenterY, "car");
|
|
104
|
+
sprite.setOrigin(0.5);
|
|
105
|
+
|
|
106
|
+
// 缩放到格子大小
|
|
107
|
+
const targetSize = cellSize * 0.8;
|
|
108
|
+
const scale = Math.min(targetSize / sprite.width, targetSize / sprite.height);
|
|
109
|
+
sprite.setScale(scale);
|
|
110
|
+
|
|
111
|
+
// 旋转到目标方向
|
|
112
|
+
sprite.setRotation(directionToAngle(path.direction));
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
#### 3. 方向角度映射
|
|
116
|
+
|
|
117
|
+
图片默认朝向决定了旋转映射。**生成后必须确认默认朝向并声明。**
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
// 若图片默认朝下(车头在图片下方):
|
|
121
|
+
function directionToAngle(direction: string): number {
|
|
122
|
+
switch (direction) {
|
|
123
|
+
case "down": return 0; // 不旋转
|
|
124
|
+
case "up": return Math.PI; // 180°
|
|
125
|
+
case "left": return Math.PI / 2; // 90°
|
|
126
|
+
case "right": return -Math.PI / 2;// -90°
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// 若图片默认朝上(车头在图片上方):
|
|
131
|
+
function directionToAngle(direction: string): number {
|
|
132
|
+
switch (direction) {
|
|
133
|
+
case "up": return 0;
|
|
134
|
+
case "down": return Math.PI;
|
|
135
|
+
case "right": return Math.PI / 2;
|
|
136
|
+
case "left": return -Math.PI / 2;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
#### 4. 可选:着色/阻挡反馈
|
|
142
|
+
|
|
143
|
+
```typescript
|
|
144
|
+
// 被阻挡时变红
|
|
145
|
+
sprite.setTint(0xff4444);
|
|
146
|
+
|
|
147
|
+
// 正常状态清除 tint
|
|
148
|
+
sprite.clearTint();
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
#### 5. 动画中使用
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
// 消除滑出动画:创建临时精灵放入容器
|
|
155
|
+
const container = scene.add.container(0, 0);
|
|
156
|
+
const car = scene.add.image(hx, hy, "car").setOrigin(0.5).setRotation(angle).setScale(scale);
|
|
157
|
+
container.add(car);
|
|
158
|
+
|
|
159
|
+
scene.tweens.add({
|
|
160
|
+
targets: container,
|
|
161
|
+
x: dx * slideDistance,
|
|
162
|
+
y: dy * slideDistance,
|
|
163
|
+
alpha: 0,
|
|
164
|
+
duration: 400,
|
|
165
|
+
ease: "Power2",
|
|
166
|
+
onComplete: () => container.destroy(),
|
|
167
|
+
});
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## 与旧版 direction_arrow_sprite 的对比
|
|
171
|
+
|
|
172
|
+
| 维度 | 旧版(4帧精灵图集) | 新版(单图旋转) |
|
|
173
|
+
|------|--------------------|--------------------|
|
|
174
|
+
| 图片数量 | 1张含4帧 | 1张单图 |
|
|
175
|
+
| 文件体积 | ~100-200KB (png) | ~20-50KB (webp) |
|
|
176
|
+
| AI 生图难度 | 高(需4个方向对齐) | 低(只需1个朝向) |
|
|
177
|
+
| 方向支持 | 仅4方向 | 任意角度 |
|
|
178
|
+
| 颜色变体 | 需重新生成 | setTint() 即时变色 |
|
|
179
|
+
| 代码复杂度 | 需 spritesheet + frame index | 简单 image + setRotation |
|
|
180
|
+
|
|
181
|
+
## Skill Definition
|
|
182
|
+
|
|
183
|
+
```yaml
|
|
184
|
+
tools:
|
|
185
|
+
- bash
|
|
186
|
+
- write
|
|
187
|
+
- read
|
|
188
|
+
inputs:
|
|
189
|
+
- entity: string (实体类型,如 "car")
|
|
190
|
+
outputs:
|
|
191
|
+
- sprite: assets/images/{entity}.webp
|
|
192
|
+
- integration: Preloader 加载 + Image 精灵 + 旋转方向映射
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## 注意事项
|
|
196
|
+
|
|
197
|
+
1. **确认默认朝向**:AI 生成的图片朝向不确定,生成后必须目视确认并在 `directionToAngle` 映射中正确声明
|
|
198
|
+
2. **居中对齐**:图片内容必须居中,否则旋转时会偏移
|
|
199
|
+
3. **正方形画布**:尽量保持宽高接近(trim 后),旋转才不会出现裁切
|
|
200
|
+
4. **Phaser 坐标系**:Phaser 中 rotation 正值为顺时针
|
|
201
|
+
|
|
202
|
+
## 3D 模型模式(Three.js)
|
|
203
|
+
|
|
204
|
+
当 DAG 引擎根节点为 `threejs.aicomponent` 时,本 skill 输出 3D 模型而非 2D 图片。
|
|
205
|
+
|
|
206
|
+
### 多色变体策略
|
|
207
|
+
|
|
208
|
+
3D 模式下多色变体比 2D 简洁得多——**只需一个模型文件 + 换材质颜色**:
|
|
209
|
+
|
|
210
|
+
```typescript
|
|
211
|
+
import * as THREE from "three";
|
|
212
|
+
|
|
213
|
+
// 加载一次模型
|
|
214
|
+
const gltf = assetLoader.getModel("car");
|
|
215
|
+
const baseGeo = (gltf.scene.children[0] as THREE.Mesh).geometry;
|
|
216
|
+
|
|
217
|
+
// 为每种颜色创建变体(共享 geometry,独立 material)
|
|
218
|
+
const CAR_COLORS = [0x00796b, 0xe53935, 0xfdd835, 0x8e24aa, 0x43a047,
|
|
219
|
+
0xf4511e, 0x1e88e5, 0xd81b60, 0x00acc1, 0xff8a65];
|
|
220
|
+
|
|
221
|
+
function createCarMesh(colorIndex: number): THREE.Mesh {
|
|
222
|
+
const mat = new THREE.MeshStandardMaterial({ color: CAR_COLORS[colorIndex] });
|
|
223
|
+
const mesh = new THREE.Mesh(baseGeo, mat);
|
|
224
|
+
mesh.castShadow = true;
|
|
225
|
+
mesh.receiveShadow = true;
|
|
226
|
+
return mesh;
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### 朝向约定
|
|
231
|
+
|
|
232
|
+
- 模型默认朝向 **+Z**(即 `ArrowDirection.Down` 对应角度 0)
|
|
233
|
+
- 通过 `mesh.rotation.y = directionToAngleY(path.direction)` 旋转到目标方向
|
|
234
|
+
- 如果加载的 .glb 模型朝向不正确,在后处理阶段旋转校正
|
|
235
|
+
|
|
236
|
+
### 归一化
|
|
237
|
+
|
|
238
|
+
模型加载后应 fit 到单位立方体(1×1×1),实际渲染时通过 `mesh.scale.setScalar(cellSize * ratio)` 缩放到棋盘格子大小。
|
|
239
|
+
|
|
240
|
+
### 模型来源
|
|
241
|
+
|
|
242
|
+
| 方式 | 说明 | 适用场景 |
|
|
243
|
+
|------|------|---------|
|
|
244
|
+
| `procedural-geometry` | Three.js 内置几何体组合 | 快速原型/简单形状 |
|
|
245
|
+
| `loaded-glb` | 加载外部 .glb 文件 | 精细模型/艺术资产 |
|
|
246
|
+
| `ai-generated` | AI 生成 3D 模型 | 自动化流水线 |
|
|
247
|
+
|
|
248
|
+
### 与 2D 模式对比
|
|
249
|
+
|
|
250
|
+
| 维度 | 2D (sprite) | 3D (model) |
|
|
251
|
+
|------|------------|------------|
|
|
252
|
+
| 多色变体 | AI 生 N 张图 | 一个模型 + N 种 material.color |
|
|
253
|
+
| 朝向问题 | AI 生图方向不一致 | 加载后统一校正 |
|
|
254
|
+
| 文件大小 | N × 图片大小 | 1 个 .glb (通常 < 100KB) |
|
|
255
|
+
| 朝向验证 | 视觉模型检测 | bounding box 分析 |
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "board_entity_sprite.aiimage",
|
|
4
|
+
"bundleType": "aiimage",
|
|
5
|
+
"category": "visual",
|
|
6
|
+
"mode": "generative",
|
|
7
|
+
"label": {
|
|
8
|
+
"zh": "棋盘实体精灵(单图旋转)",
|
|
9
|
+
"en": "Board entity sprite (single image + rotation)"
|
|
10
|
+
},
|
|
11
|
+
"outputModes": ["2d-sprite", "3d-model"],
|
|
12
|
+
"tags": [
|
|
13
|
+
"visual",
|
|
14
|
+
"sprite",
|
|
15
|
+
"entity",
|
|
16
|
+
"board",
|
|
17
|
+
"direction",
|
|
18
|
+
"top-down",
|
|
19
|
+
"puzzle",
|
|
20
|
+
"car",
|
|
21
|
+
"vehicle",
|
|
22
|
+
"arrow-replacement",
|
|
23
|
+
"directional-indicator",
|
|
24
|
+
"3d-model",
|
|
25
|
+
"glb",
|
|
26
|
+
"threejs"
|
|
27
|
+
],
|
|
28
|
+
"bindingRoles": [
|
|
29
|
+
"boardEntitySprite",
|
|
30
|
+
"directionalIndicator"
|
|
31
|
+
],
|
|
32
|
+
"generation3D": {
|
|
33
|
+
"kind": "3d-model",
|
|
34
|
+
"methods": ["procedural-geometry", "loaded-glb", "ai-generated"],
|
|
35
|
+
"colorVariants": {
|
|
36
|
+
"strategy": "material-color-swap",
|
|
37
|
+
"description": "一个 geometry + N 种 MeshStandardMaterial.color = 多色变体,无需生成多个模型文件",
|
|
38
|
+
"colorSet": ["teal", "red", "yellow", "purple", "green", "orange", "blue", "pink", "cyan", "salmon"],
|
|
39
|
+
"codePattern": "const mat = new THREE.MeshStandardMaterial({ color: CAR_COLORS[i] }); const mesh = new THREE.Mesh(sharedGeo, mat);"
|
|
40
|
+
},
|
|
41
|
+
"canonicalFacing": "+Z",
|
|
42
|
+
"normalize": "fit-unit-cube",
|
|
43
|
+
"format": "glb",
|
|
44
|
+
"postProcess": [
|
|
45
|
+
{ "step": "normalize-size", "method": "fit-to-unit-cube", "description": "缩放模型使其 bounding box 适配 1×1×1" },
|
|
46
|
+
{ "step": "verify-orientation", "expected": "+Z", "fallback": "rotate-Y-180" },
|
|
47
|
+
{ "step": "center-origin", "description": "确保模型原点在几何中心底部" }
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"generation": {
|
|
51
|
+
"kind": "single-image",
|
|
52
|
+
"promptTemplate": "top-down bird's eye view of a cute cartoon {entity}, facing upward, simple flat design, bright vivid colors, game asset, white background, centered on canvas, no shadow, 256x256 icon style",
|
|
53
|
+
"variables": {
|
|
54
|
+
"entity": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "实体类型,替换 prompt 中的 {entity}",
|
|
57
|
+
"examples": ["car", "race car", "taxi", "bus", "airplane", "rocket", "boat", "ship", "fish", "turtle", "bird", "UFO", "ambulance", "fire truck"]
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"aspectRatio": "1:1",
|
|
61
|
+
"model": "google/gemini-3.1-flash-image-preview",
|
|
62
|
+
"style": "cartoon-flat",
|
|
63
|
+
"platformSkill": "playcraft-image-generation",
|
|
64
|
+
"postProcess": [
|
|
65
|
+
{ "step": "remove-background", "method": "floodfill" },
|
|
66
|
+
{ "step": "trim" },
|
|
67
|
+
{ "step": "verify-orientation", "expected": "up", "fallback": "rotate-180" },
|
|
68
|
+
{ "step": "convert", "format": "webp", "quality": 90 }
|
|
69
|
+
],
|
|
70
|
+
"variants": {
|
|
71
|
+
"description": "可选:批量生成多色变体。为同一实体生成 N 种颜色版本。",
|
|
72
|
+
"colorSet": ["teal", "red", "yellow", "purple", "green", "orange", "blue", "pink", "cyan", "salmon"],
|
|
73
|
+
"promptTemplate": "top-down bird's eye view of a cute cartoon {entity}, {color} colored body, facing upward, simple flat design, bright vivid colors, game asset, white background, centered on canvas, no shadow, 256x256 icon style",
|
|
74
|
+
"outputPattern": "{entity}_{color}.webp",
|
|
75
|
+
"referenceImage": "{entity}.webp"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"result": {
|
|
79
|
+
"outputFile": "{entity}.webp",
|
|
80
|
+
"format": "webp",
|
|
81
|
+
"usage": "single-image-with-rotation",
|
|
82
|
+
"constraints": {
|
|
83
|
+
"transparent": true,
|
|
84
|
+
"centered": true,
|
|
85
|
+
"defaultFacing": "declared-in-binding"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"binding": {
|
|
89
|
+
"role": "boardEntitySprite",
|
|
90
|
+
"target": "assets/images/{entity}.webp",
|
|
91
|
+
"type": "image-asset-reference",
|
|
92
|
+
"integration": {
|
|
93
|
+
"pattern": "single-image-rotation",
|
|
94
|
+
"defaultFacing": "down",
|
|
95
|
+
"directionToAngle": {
|
|
96
|
+
"_comment": "旋转角度取决于图片默认朝向。以 defaultFacing=down 为例:",
|
|
97
|
+
"up": "Math.PI",
|
|
98
|
+
"right": "-Math.PI / 2",
|
|
99
|
+
"down": "0",
|
|
100
|
+
"left": "Math.PI / 2"
|
|
101
|
+
},
|
|
102
|
+
"codePattern": {
|
|
103
|
+
"import": "import entityImg from 'assets/images/{entity}.webp';",
|
|
104
|
+
"preload": "this.load.image('{entity}', entityImg);",
|
|
105
|
+
"create": "const sprite = scene.add.image(x, y, '{entity}').setOrigin(0.5).setRotation(angle);",
|
|
106
|
+
"scale": "sprite.setScale(Math.min(targetSize / sprite.width, targetSize / sprite.height));",
|
|
107
|
+
"tint": "sprite.setTint(color); // 可选:着色或阻挡变红"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"integration3D": {
|
|
111
|
+
"pattern": "single-model-color-swap",
|
|
112
|
+
"canonicalFacing": "+Z",
|
|
113
|
+
"directionToAngleY": {
|
|
114
|
+
"_comment": "Y 轴旋转角度。模型默认朝 +Z(ArrowDirection.Down 对应角度 0)",
|
|
115
|
+
"up": "Math.PI",
|
|
116
|
+
"right": "Math.PI / 2",
|
|
117
|
+
"down": "0",
|
|
118
|
+
"left": "-Math.PI / 2"
|
|
119
|
+
},
|
|
120
|
+
"codePattern": {
|
|
121
|
+
"import": "import carModelUrl from 'assets/models/car.glb';",
|
|
122
|
+
"load": "loader.loadAll({ models: [{ key: 'car', url: carModelUrl }] })",
|
|
123
|
+
"create": "const gltf = loader.getModel('car'); const mesh = gltf.scene.children[0].clone(); mesh.rotation.y = directionToAngleY(direction);",
|
|
124
|
+
"colorVariant": "const mat = (mesh as THREE.Mesh).material = new THREE.MeshStandardMaterial({ color: colorHex }); ",
|
|
125
|
+
"scale": "mesh.scale.setScalar(cellSize * 0.8);"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"files": {
|
|
130
|
+
"skill": "SKILL.md",
|
|
131
|
+
"ref": [
|
|
132
|
+
"ref/car.webp",
|
|
133
|
+
"ref/car.png",
|
|
134
|
+
"ref/ProceduralCar.ts"
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
"refAssets": {
|
|
138
|
+
"car.webp": {
|
|
139
|
+
"description": "俯视卡通小汽车(默认朝下),24KB webp,已完成去背景+裁切+压缩",
|
|
140
|
+
"defaultFacing": "down",
|
|
141
|
+
"size": "380x496",
|
|
142
|
+
"generatedWith": {
|
|
143
|
+
"prompt": "top-down bird's eye view of a cute cartoon car, facing upward, simple flat design, bright vivid colors, game asset, white background, centered on canvas, no shadow, 256x256 icon style",
|
|
144
|
+
"model": "google/gemini-3.1-flash-image-preview",
|
|
145
|
+
"postProcess": ["remove-background(floodfill)", "trim", "convert(webp,q90)"]
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"car.png": {
|
|
149
|
+
"description": "同上的 PNG 高清版本(透明背景),409KB,作为备份或需要无损场景使用",
|
|
150
|
+
"defaultFacing": "down"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|