@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,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: theme_state.aicomponent
|
|
3
|
+
description: 主题状态管理器。管理路径颜色、箭头风格、UI 文本标签、画布背景色等视觉主题配置,供渲染器和 UI 组件读取当前主题值。
|
|
4
|
+
triggers: 需要管理游戏视觉主题、路径颜色方案或主题切换逻辑时触发。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 主题状态管理器(Theme State Manager)
|
|
8
|
+
|
|
9
|
+
## 说明
|
|
10
|
+
|
|
11
|
+
`ThemeManager` 从当前激活的 `ThemeVariantConfig`(`src/theme/index.ts`)中读取主题配置:
|
|
12
|
+
|
|
13
|
+
- `getPathColor(pathIndex)`:返回指定路径的颜色(十六进制数字)
|
|
14
|
+
- `getArrowStyle()`:返回箭头头部风格
|
|
15
|
+
- `canvasBgColor`:画布背景色
|
|
16
|
+
|
|
17
|
+
## Scaffold
|
|
18
|
+
|
|
19
|
+
| 目标路径 | 来源 |
|
|
20
|
+
|---------|-----|
|
|
21
|
+
| `src/game/scenes/GameUI/ThemeManager.ts` | `ref/ThemeManager.ts` |
|
|
22
|
+
|
|
23
|
+
## Skill Definition
|
|
24
|
+
|
|
25
|
+
```yaml
|
|
26
|
+
tools:
|
|
27
|
+
- read_file
|
|
28
|
+
- write_file
|
|
29
|
+
inputs:
|
|
30
|
+
- source: src/game/scenes/GameUI/ThemeManager.ts
|
|
31
|
+
outputs:
|
|
32
|
+
- themeManager: ThemeManager class
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Recipe
|
|
36
|
+
|
|
37
|
+
| 决策 | 原因 |
|
|
38
|
+
|------|------|
|
|
39
|
+
| **集中主题查询** | 路径颜色、箭头风格等视觉值分散在多个渲染组件中会导致主题切换时遗漏;ThemeManager 作为单一查询入口,确保视觉一致性 |
|
|
40
|
+
| **无状态适配器设计** | ThemeManager 每次调用时从激活的 ThemeVariantConfig 读取,不缓存;切换主题只需替换配置对象,无需通知所有订阅者 |
|
|
41
|
+
| **颜色 API 返回数字而非字符串** | Phaser Graphics API 接受十六进制数字(`0xff0000`),转换在 ThemeManager 内完成,渲染层不感知颜色格式 |
|
|
42
|
+
|
|
43
|
+
## Adapter
|
|
44
|
+
|
|
45
|
+
- **Role**: `themeState` — 视觉主题状态适配器(路径颜色、箭头风格、背景色)
|
|
46
|
+
- **Provides**: `ThemeManager` 类(`getPathColor(pathIndex)`、`getArrowStyle()`、`canvasBgColor` 属性)
|
|
47
|
+
- **Requires**: `phaser.aicomponent`、`theme_variant.aiconfig`(ThemeVariantConfig 数据源)
|
|
48
|
+
- **Consumed by**: `path_renderer.aicomponent`(路径颜色)、`game_scene.aicomponent`(画布背景色)、`top_ui_bar.aicomponent` 等 UI 组件(主题配色)
|
|
49
|
+
- **Integration point**: `src/game/scenes/GameUI/ThemeManager.ts` —— `game_scene` 在初始化时实例化,并传入渲染子系统
|
|
50
|
+
|
|
51
|
+
## Imports
|
|
52
|
+
|
|
53
|
+
- `phaser.aicomponent`(硬依赖)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "theme_state.aicomponent",
|
|
4
|
+
"bundleType": "aicomponent",
|
|
5
|
+
"category": "state",
|
|
6
|
+
"mode": "fixed",
|
|
7
|
+
"label": { "zh": "主题状态管理器", "en": "Theme state manager" },
|
|
8
|
+
"tags": ["state", "theme", "color", "style", "arrow-style", "ui-text"],
|
|
9
|
+
"bindingRoles": ["themeManager"],
|
|
10
|
+
"scaffold": {
|
|
11
|
+
"files": {
|
|
12
|
+
"src/game/scenes/GameUI/ThemeManager.ts": {
|
|
13
|
+
"source": "ref/ThemeManager.ts",
|
|
14
|
+
"mode": "full",
|
|
15
|
+
"weight": 10
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"imports": [
|
|
20
|
+
{ "slot": "engine", "pinAtomId": "phaser.aicomponent", "edgeKind": "requires", "bindAs": "engine" }
|
|
21
|
+
],
|
|
22
|
+
"exports": [
|
|
23
|
+
{ "name": "ThemeManager", "kind": "class", "location": "src/game/scenes/GameUI/ThemeManager.ts" }
|
|
24
|
+
],
|
|
25
|
+
"neutralDescriptor": {
|
|
26
|
+
"geometry": "theme configuration provider: path colors, arrow style, UI text labels, canvas background color",
|
|
27
|
+
"layers": ["theme", "color-scheme", "style"]
|
|
28
|
+
},
|
|
29
|
+
"files": {
|
|
30
|
+
"skill": "SKILL.md",
|
|
31
|
+
"themeManager": "ref/ThemeManager.ts"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import * as Phaser from "phaser";
|
|
2
|
+
import {
|
|
3
|
+
getCanvasBgColorOverride,
|
|
4
|
+
getUiBarBgColorOverride,
|
|
5
|
+
} from "../../LevelDataManager";
|
|
6
|
+
|
|
7
|
+
/** 主题配置接口 */
|
|
8
|
+
export interface ThemeConfig {
|
|
9
|
+
id: string;
|
|
10
|
+
textureKey: string;
|
|
11
|
+
price: number;
|
|
12
|
+
bgColor: string; // 例如 "#FFFFFF"
|
|
13
|
+
arrowType: string; // 'draw' | 'snake' | 'snake2' | 'heart' | 'diamond' | 'wave' | 'striped' | 'caterpillar' | 'emoji'
|
|
14
|
+
arrowColor: string; // 例如 "#000000" 或 "Random"
|
|
15
|
+
arrowTextureKey: string;
|
|
16
|
+
previewScale?: number;
|
|
17
|
+
uiTextColor?: string; // UI 文本主颜色(时钟、进度等),默认 "#50526B"
|
|
18
|
+
uiLevelTextColor?: string; // 关卡标题颜色,默认 "#6471FA"
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** 默认主题列表 */
|
|
22
|
+
const DEFAULT_THEMES: ThemeConfig[] = [
|
|
23
|
+
{
|
|
24
|
+
id: "black",
|
|
25
|
+
textureKey: "theme_black",
|
|
26
|
+
price: 0,
|
|
27
|
+
bgColor: "#FFFFFF",
|
|
28
|
+
arrowType: "draw",
|
|
29
|
+
arrowColor: "#000000",
|
|
30
|
+
arrowTextureKey: "none",
|
|
31
|
+
previewScale: 1,
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 主题管理器(单例)。
|
|
37
|
+
* 负责从缓存中读取主题配置、维护当前主题和拥有状态。
|
|
38
|
+
* Game / ThemePanel 都应通过该单例来获取主题信息。
|
|
39
|
+
*/
|
|
40
|
+
export class ThemeManager {
|
|
41
|
+
private static _instance: ThemeManager | null = null;
|
|
42
|
+
|
|
43
|
+
static get instance(): ThemeManager {
|
|
44
|
+
if (!this._instance) {
|
|
45
|
+
this._instance = new ThemeManager();
|
|
46
|
+
}
|
|
47
|
+
return this._instance;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
private themes: ThemeConfig[] = [];
|
|
51
|
+
private ownedIds = new Set<string>();
|
|
52
|
+
private currentId: string = "black";
|
|
53
|
+
|
|
54
|
+
private constructor() {}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 从指定场景的缓存中初始化主题配置(只会执行一次)。
|
|
58
|
+
* @param scene 当前场景
|
|
59
|
+
*/
|
|
60
|
+
init(scene: Phaser.Scene) {
|
|
61
|
+
const raw = scene.cache.json.get("themes") as ThemeConfig[] | undefined;
|
|
62
|
+
if (Array.isArray(raw) && raw.length > 0) {
|
|
63
|
+
this.themes = raw;
|
|
64
|
+
} else if (this.themes.length === 0) {
|
|
65
|
+
this.themes = DEFAULT_THEMES;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// 价格为 0 的主题默认视为已拥有
|
|
69
|
+
if (this.ownedIds.size === 0) {
|
|
70
|
+
for (const t of this.themes) {
|
|
71
|
+
if (t.price === 0) this.ownedIds.add(t.id);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// 当前主题必须存在于列表中
|
|
76
|
+
if (!this.themes.find((t) => t.id === this.currentId)) {
|
|
77
|
+
this.currentId = this.themes[0]?.id ?? "black";
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 从用户档案同步已解锁的主题和当前选中主题。
|
|
83
|
+
* @param themes 用户档案中的主题数据
|
|
84
|
+
*/
|
|
85
|
+
syncFromProfile(themes: { unlockedIds: string[]; currentId: string }) {
|
|
86
|
+
if (!themes) return;
|
|
87
|
+
if (Array.isArray(themes.unlockedIds)) {
|
|
88
|
+
for (const id of themes.unlockedIds) {
|
|
89
|
+
this.ownedIds.add(id);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (themes.currentId) {
|
|
94
|
+
this.currentId = themes.currentId;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** 获取当前选中的主题配置 */
|
|
99
|
+
get currentTheme(): ThemeConfig {
|
|
100
|
+
const found = this.themes.find((t) => t.id === this.currentId);
|
|
101
|
+
if (found !== undefined) {
|
|
102
|
+
return found;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (this.themes.length > 0) {
|
|
106
|
+
return this.themes[0]!;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return DEFAULT_THEMES[0]!;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* 获取画布背景颜色(数值格式)。
|
|
114
|
+
* 优先使用变体配置的 canvasBgColor 覆盖。
|
|
115
|
+
*/
|
|
116
|
+
getBackgroundColorNumber(): number {
|
|
117
|
+
const override = getCanvasBgColorOverride();
|
|
118
|
+
if (override !== undefined) {
|
|
119
|
+
return override;
|
|
120
|
+
}
|
|
121
|
+
return this.parseColorToNumber(this.currentTheme.bgColor, 0xffffff);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* 获取 UI 菜单栏背景颜色(用于顶部和底部菜单栏)。
|
|
126
|
+
* 优先使用变体配置的 uiBarBgColor 覆盖。
|
|
127
|
+
*/
|
|
128
|
+
getUiBarBackgroundColorNumber(): number {
|
|
129
|
+
const override = getUiBarBgColorOverride();
|
|
130
|
+
if (override !== undefined) {
|
|
131
|
+
return override;
|
|
132
|
+
}
|
|
133
|
+
return this.parseColorToNumber(this.currentTheme.bgColor, 0xffffff);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* 获取 UI 关卡标题颜色。
|
|
138
|
+
* 如果主题未配置则返回默认值 "#6471FA"。
|
|
139
|
+
*/
|
|
140
|
+
getUiLevelTextColor(): string {
|
|
141
|
+
return this.currentTheme.uiLevelTextColor || "#6471FA";
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* 获取固定箭头颜色(数值格式)。
|
|
146
|
+
*/
|
|
147
|
+
getFixedArrowColorNumber(): number {
|
|
148
|
+
const spec = this.currentTheme.arrowColor;
|
|
149
|
+
return this.parseColorToNumber(spec, 0x000000);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* 将颜色字符串解析为数值。
|
|
154
|
+
* 支持 "#RRGGBB" 和 "0xRRGGBB" 格式。
|
|
155
|
+
* @param spec 颜色字符串
|
|
156
|
+
* @param fallback 解析失败时的回退值
|
|
157
|
+
* @returns 颜色数值
|
|
158
|
+
*/
|
|
159
|
+
private parseColorToNumber(
|
|
160
|
+
spec: string | undefined,
|
|
161
|
+
fallback: number,
|
|
162
|
+
): number {
|
|
163
|
+
if (!spec) return fallback;
|
|
164
|
+
const s = spec.trim();
|
|
165
|
+
if (/^#?[0-9a-fA-F]{6}$/.test(s)) {
|
|
166
|
+
const hex = s.startsWith("#") ? s.slice(1) : s;
|
|
167
|
+
return parseInt(hex, 16);
|
|
168
|
+
}
|
|
169
|
+
if (/^0x[0-9a-fA-F]{6}$/.test(s)) {
|
|
170
|
+
return parseInt(s, 16);
|
|
171
|
+
}
|
|
172
|
+
return fallback;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: theme_switcher_build.aicomponent
|
|
3
|
+
description: 主题切换构建辅助 skill。提供 src/theme/index.ts 入口文件模板,构建时由 builds.config.js 自动替换为当前激活的主题变体导入。
|
|
4
|
+
triggers: 需要配置多主题构建的主题入口文件时触发。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 主题切换构建器(Theme Switcher Build Helper)
|
|
8
|
+
|
|
9
|
+
## 说明
|
|
10
|
+
|
|
11
|
+
`src/theme/index.ts` 是主题系统的统一入口:
|
|
12
|
+
|
|
13
|
+
- 运行时和其他模块通过 `import Theme from 'src/theme'` 获取当前主题配置
|
|
14
|
+
- **构建时**由 `builds.config.js` 脚本自动修改此文件,切换到对应主题的导入路径
|
|
15
|
+
- 每个主题目录放在 `src/theme/<主题名>/` 下(见 `theme_variant.aiconfig` skill)
|
|
16
|
+
|
|
17
|
+
## Scaffold
|
|
18
|
+
|
|
19
|
+
| 目标路径 | 来源 | 说明 |
|
|
20
|
+
|---------|-----|-----|
|
|
21
|
+
| `src/theme/index.ts` | `ref/theme-index.ts` | 主题入口文件(默认导入开发主题) |
|
|
22
|
+
|
|
23
|
+
## Recipe
|
|
24
|
+
|
|
25
|
+
| 决策 | 原因 |
|
|
26
|
+
|------|------|
|
|
27
|
+
| **构建时替换而非运行时切换** | 运行时 if/else 主题切换会把所有主题变体打包进产物,增大体积;构建时替换 import 路径使每个主题产物只包含自身变体 |
|
|
28
|
+
| **单入口文件作为换点** | `src/theme/index.ts` 是唯一需要修改的文件;构建脚本只改一行 import,不触碰其他业务代码 |
|
|
29
|
+
| **开发时默认 Dev 主题** | `import Theme from "./Dev"` 是开发时默认;构建脚本在 CI 中替换为对应变体,开发者本地无需操作 |
|
|
30
|
+
|
|
31
|
+
## Adapter
|
|
32
|
+
|
|
33
|
+
- **Role**: `themeSwitcherBuild` — 多主题构建入口文件(构建时脚本动态替换导入路径)
|
|
34
|
+
- **Provides**: `src/theme/index.ts` 主题入口模板(`export default Theme`)
|
|
35
|
+
- **Requires**: `playable_scripts_build.aicomponent`(builds.config.js 在构建时修改此文件)
|
|
36
|
+
- **Consumed by**: 所有运行时读取主题配置的组件(`theme_state.aicomponent`、`level_state.aicomponent` 等通过 `import Theme from 'src/theme'` 使用)
|
|
37
|
+
- **Integration point**: `src/theme/index.ts` —— 构建时被 `builds.config.js` 将 `./Dev` 替换为对应变体路径
|
|
38
|
+
|
|
39
|
+
## Imports
|
|
40
|
+
|
|
41
|
+
- `playable_scripts_build.aicomponent`(硬依赖:builds.config.js 自动修改此文件)
|
|
42
|
+
|
|
43
|
+
## Skill Definition
|
|
44
|
+
|
|
45
|
+
```yaml
|
|
46
|
+
tools:
|
|
47
|
+
- read_file
|
|
48
|
+
- write_file
|
|
49
|
+
inputs:
|
|
50
|
+
- source: src/theme/index.ts
|
|
51
|
+
outputs:
|
|
52
|
+
- themeIndex: src/theme/index.ts theme entry file
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## 文件内容
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
// src/theme/index.ts
|
|
59
|
+
// 注意: 构建时由 builds 脚本自动修改,不要手动改
|
|
60
|
+
import Theme from "./Dev";
|
|
61
|
+
export default Theme;
|
|
62
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "theme_switcher_build.aicomponent",
|
|
4
|
+
"bundleType": "aicomponent",
|
|
5
|
+
"category": "build",
|
|
6
|
+
"mode": "fixed",
|
|
7
|
+
"label": { "zh": "主题切换构建器", "en": "Theme switcher build helper" },
|
|
8
|
+
"tags": ["theme", "build", "switcher", "variant", "multi-theme"],
|
|
9
|
+
"scaffold": {
|
|
10
|
+
"files": {
|
|
11
|
+
"src/theme/index.ts": {
|
|
12
|
+
"source": "ref/theme-index.ts",
|
|
13
|
+
"mode": "full",
|
|
14
|
+
"weight": 10
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"imports": [
|
|
19
|
+
{ "slot": "buildPipeline", "pinAtomId": "playable_scripts_build.aicomponent", "edgeKind": "requires", "bindAs": "buildPipeline" }
|
|
20
|
+
],
|
|
21
|
+
"exports": [
|
|
22
|
+
{ "name": "default", "kind": "module-export", "location": "src/theme/index.ts" }
|
|
23
|
+
],
|
|
24
|
+
"neutralDescriptor": {
|
|
25
|
+
"geometry": "build-time theme selector that re-exports a single theme variant as the active theme",
|
|
26
|
+
"layers": ["build-time-config", "theme-selection"],
|
|
27
|
+
"replaceable": ["active theme variant"]
|
|
28
|
+
},
|
|
29
|
+
"usageHints": [
|
|
30
|
+
"src/theme/index.ts 是当前激活主题的入口,构建时由 builds.config.js 自动修改",
|
|
31
|
+
"每个主题目录在 src/theme/<主题名>/ 下,包含 ThemeVariantConfig 实例",
|
|
32
|
+
"不要手动修改 index.ts,除非在本地开发测试特定主题"
|
|
33
|
+
],
|
|
34
|
+
"files": {
|
|
35
|
+
"skill": "SKILL.md",
|
|
36
|
+
"themeIndex": "ref/theme-index.ts"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: theme_variant.aiconfig
|
|
3
|
+
description: 路径消除玩法的主题变体配置(ThemeVariantConfig)。定义一个完整的投放变体:包含关卡数据包引用、主题 ID、关卡模式、颜色覆盖等。每个 Remix 对应一个主题变体目录。
|
|
4
|
+
triggers: 需要创建新的投放变体配置、定义主题颜色或关卡模式时触发。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 主题变体配置(Theme Variant Config)
|
|
8
|
+
|
|
9
|
+
## 说明
|
|
10
|
+
|
|
11
|
+
每个主题变体是 `src/theme/<变体名>/` 下的一个目录,包含:
|
|
12
|
+
|
|
13
|
+
- `index.ts`:导出 `ThemeVariantConfig` 实例
|
|
14
|
+
- 关卡数据文件(`levels.json` 或多个 `levelN.json`)
|
|
15
|
+
|
|
16
|
+
`ThemeVariantConfig` 字段:
|
|
17
|
+
|
|
18
|
+
| 字段 | 说明 |
|
|
19
|
+
|-----|-----|
|
|
20
|
+
| `levels` | `RawLevelJson[]` 关卡数据数组 |
|
|
21
|
+
| `name` | 变体显示名称 |
|
|
22
|
+
| `themeId` | 使用的视觉主题 ID(`black` / `white` 等)|
|
|
23
|
+
| `levelMode` | 关卡模式(0=闯关 / 1=简单 / 2=复杂 / 3=炸弹)|
|
|
24
|
+
| `segmentsMode?` | 快速胜利模式(消除 N 条即胜利)|
|
|
25
|
+
| `autoHint?` | 自动提示(默认 true)|
|
|
26
|
+
| `canvasBgColor?` | 画布背景色覆盖(十六进制)|
|
|
27
|
+
| `uiBarBgColor?` | UI 条背景色覆盖 |
|
|
28
|
+
|
|
29
|
+
## Recipe
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"kind": "theme-config",
|
|
34
|
+
"params": {
|
|
35
|
+
"themeId": "black",
|
|
36
|
+
"levelMode": 1,
|
|
37
|
+
"canvasBgColor": "0x1a1a2e"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Result
|
|
43
|
+
|
|
44
|
+
`src/theme/<变体名>/index.ts`(TypeScript 模块,默认导出 `ThemeVariantConfig`)
|
|
45
|
+
|
|
46
|
+
## Binding
|
|
47
|
+
|
|
48
|
+
被 `theme_switcher_build.aicomponent` 的 `src/theme/index.ts` 通过构建时替换引用。
|
|
49
|
+
|
|
50
|
+
## Skill Definition
|
|
51
|
+
|
|
52
|
+
```yaml
|
|
53
|
+
tools:
|
|
54
|
+
- write_file
|
|
55
|
+
inputs:
|
|
56
|
+
- schema: ThemeVariantConfig from arrow_path_data_format.aicomponent
|
|
57
|
+
- levelData: level_data_pack.aiconfig
|
|
58
|
+
outputs:
|
|
59
|
+
- themeVariant: src/theme/<variant>/index.ts TypeScript module
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 示例
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
// src/theme/MyTheme/index.ts
|
|
66
|
+
import type { ThemeVariantConfig } from "../../game/levels/LevelTypes";
|
|
67
|
+
import levels from "./levels.json";
|
|
68
|
+
|
|
69
|
+
export default {
|
|
70
|
+
levels,
|
|
71
|
+
name: "MyTheme",
|
|
72
|
+
themeId: "black",
|
|
73
|
+
levelMode: 1,
|
|
74
|
+
autoHint: true,
|
|
75
|
+
shouldDrawEliminationTrail: true,
|
|
76
|
+
canvasBgColor: 0x1a1a2e,
|
|
77
|
+
} as ThemeVariantConfig;
|
|
78
|
+
```
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "theme_variant.aiconfig",
|
|
4
|
+
"bundleType": "aiconfig",
|
|
5
|
+
"category": "config",
|
|
6
|
+
"mode": "parametric",
|
|
7
|
+
"label": { "zh": "主题变体配置", "en": "Theme variant config" },
|
|
8
|
+
"tags": ["config", "theme", "variant", "color", "level-mode", "style"],
|
|
9
|
+
"bindingRoles": ["themeVariantConfig"],
|
|
10
|
+
"generation": {
|
|
11
|
+
"kind": "theme-config",
|
|
12
|
+
"schema": "ThemeVariantConfig",
|
|
13
|
+
"params": {
|
|
14
|
+
"themeId": "black",
|
|
15
|
+
"levelMode": 1,
|
|
16
|
+
"canvasBgColor": "0x1a1a2e",
|
|
17
|
+
"uiBarBgColor": "0x16213e"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"result": {
|
|
21
|
+
"outputFile": "index.ts",
|
|
22
|
+
"format": "typescript",
|
|
23
|
+
"constraints": { "schema": "ThemeVariantConfig" }
|
|
24
|
+
},
|
|
25
|
+
"binding": {
|
|
26
|
+
"role": "themeVariantConfig",
|
|
27
|
+
"target": "src/theme/<variant>/index.ts",
|
|
28
|
+
"type": "typescript-module-reference",
|
|
29
|
+
"constraints": { "schema": "ThemeVariantConfig", "defaultExport": true }
|
|
30
|
+
},
|
|
31
|
+
"imports": [
|
|
32
|
+
{ "slot": "dataFormat", "pinAtomId": "arrow_path_data_format.aicomponent", "edgeKind": "requires", "bindAs": "dataFormat" },
|
|
33
|
+
{ "slot": "levelDataPack","pinAtomId": "level_data_pack.aiconfig", "edgeKind": "requires", "bindAs": "levelDataPack" }
|
|
34
|
+
],
|
|
35
|
+
"files": {
|
|
36
|
+
"skill": "SKILL.md",
|
|
37
|
+
"exampleTheme": "ref/ExampleTheme/index.ts"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ThemeVariantConfig } from "../../game/levels/LevelTypes";
|
|
2
|
+
|
|
3
|
+
// 导入简单关卡(开发模式:1关通过)
|
|
4
|
+
import level from "./levelEasy.json";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
// 游戏配置
|
|
8
|
+
config: {
|
|
9
|
+
levels: [level],
|
|
10
|
+
name: "EasyMode",
|
|
11
|
+
themeId: "black",
|
|
12
|
+
levelMode: 1, // 简单关卡模式:使用 level1 (10x8)
|
|
13
|
+
autoHint: true,
|
|
14
|
+
shouldDrawEliminationTrail: true,
|
|
15
|
+
} as ThemeVariantConfig,
|
|
16
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": 1,
|
|
3
|
+
"row": 10,
|
|
4
|
+
"col": 8,
|
|
5
|
+
"arrows": [
|
|
6
|
+
[
|
|
7
|
+
[
|
|
8
|
+
7,
|
|
9
|
+
9
|
|
10
|
+
],
|
|
11
|
+
[
|
|
12
|
+
6,
|
|
13
|
+
9
|
|
14
|
+
],
|
|
15
|
+
[
|
|
16
|
+
6,
|
|
17
|
+
8
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
7,
|
|
21
|
+
8
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
7,
|
|
25
|
+
7
|
|
26
|
+
],
|
|
27
|
+
[
|
|
28
|
+
6,
|
|
29
|
+
7
|
|
30
|
+
],
|
|
31
|
+
[
|
|
32
|
+
6,
|
|
33
|
+
1
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
0,
|
|
37
|
+
1
|
|
38
|
+
],
|
|
39
|
+
[
|
|
40
|
+
0,
|
|
41
|
+
9
|
|
42
|
+
],
|
|
43
|
+
[
|
|
44
|
+
2,
|
|
45
|
+
9
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
2,
|
|
49
|
+
8
|
|
50
|
+
],
|
|
51
|
+
[
|
|
52
|
+
3,
|
|
53
|
+
8
|
|
54
|
+
],
|
|
55
|
+
[
|
|
56
|
+
3,
|
|
57
|
+
9
|
|
58
|
+
]
|
|
59
|
+
],
|
|
60
|
+
[
|
|
61
|
+
[
|
|
62
|
+
2,
|
|
63
|
+
7
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
2,
|
|
67
|
+
2
|
|
68
|
+
],
|
|
69
|
+
[
|
|
70
|
+
1,
|
|
71
|
+
2
|
|
72
|
+
],
|
|
73
|
+
[
|
|
74
|
+
1,
|
|
75
|
+
7
|
|
76
|
+
]
|
|
77
|
+
],
|
|
78
|
+
[
|
|
79
|
+
[
|
|
80
|
+
3,
|
|
81
|
+
7
|
|
82
|
+
],
|
|
83
|
+
[
|
|
84
|
+
4,
|
|
85
|
+
7
|
|
86
|
+
],
|
|
87
|
+
[
|
|
88
|
+
4,
|
|
89
|
+
9
|
|
90
|
+
],
|
|
91
|
+
[
|
|
92
|
+
5,
|
|
93
|
+
9
|
|
94
|
+
],
|
|
95
|
+
[
|
|
96
|
+
5,
|
|
97
|
+
6
|
|
98
|
+
],
|
|
99
|
+
[
|
|
100
|
+
3,
|
|
101
|
+
6
|
|
102
|
+
],
|
|
103
|
+
[
|
|
104
|
+
3,
|
|
105
|
+
2
|
|
106
|
+
],
|
|
107
|
+
[
|
|
108
|
+
4,
|
|
109
|
+
2
|
|
110
|
+
],
|
|
111
|
+
[
|
|
112
|
+
4,
|
|
113
|
+
5
|
|
114
|
+
],
|
|
115
|
+
[
|
|
116
|
+
5,
|
|
117
|
+
5
|
|
118
|
+
],
|
|
119
|
+
[
|
|
120
|
+
5,
|
|
121
|
+
2
|
|
122
|
+
]
|
|
123
|
+
],
|
|
124
|
+
[
|
|
125
|
+
[
|
|
126
|
+
0,
|
|
127
|
+
0
|
|
128
|
+
],
|
|
129
|
+
[
|
|
130
|
+
7,
|
|
131
|
+
0
|
|
132
|
+
],
|
|
133
|
+
[
|
|
134
|
+
7,
|
|
135
|
+
6
|
|
136
|
+
]
|
|
137
|
+
]
|
|
138
|
+
],
|
|
139
|
+
"levelTime": 120,
|
|
140
|
+
"id": 1
|
|
141
|
+
}
|