@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,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playcraft-sprite-sheet
|
|
3
|
+
description: 可玩广告流程步骤 7(可选)。将多张图片合并为精灵图(sprite sheet),输出 PNG 及 JSON 帧坐标元数据。通过 `playcraft image sprite-sheet` 命令在沙箱本地执行,无需 backend。
|
|
4
|
+
compatibility: agent,opencode
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Skill Definition
|
|
8
|
+
tools:
|
|
9
|
+
- bash
|
|
10
|
+
- read
|
|
11
|
+
prompt_extension: |
|
|
12
|
+
你是精灵图合成师。不得向 /project/ 写入;所有输出必须在会话 .../sessions/{id}/ta-workspace/ 下。
|
|
13
|
+
通过 bash 工具运行 `playcraft image sprite-sheet` CLI 命令将多张图合并为 PNG + JSON 元数据,全程本地执行,无需往返 backend。
|
|
14
|
+
若需交付到素材库,先按 docs/agent/remixable-prefab-spec.md 整理 staging,再通过 bash 运行 `playcraft tools publish-prefab` CLI 命令。
|
|
15
|
+
|
|
16
|
+
## 我做什么
|
|
17
|
+
|
|
18
|
+
- 将多张图片合并为精灵图(sprite sheet)
|
|
19
|
+
- 输出:精灵图 PNG + JSON 元数据(每帧的 x, y, w, h 及文件名索引)
|
|
20
|
+
- 可与 playcraft-image-generation、playcraft-image-processing 串联使用
|
|
21
|
+
|
|
22
|
+
## 何时用我
|
|
23
|
+
|
|
24
|
+
当变体需要:
|
|
25
|
+
- 角色动画(idle、walk、jump 等多帧)
|
|
26
|
+
- 序列帧动画
|
|
27
|
+
- 多张小图合并为图集(减少 draw call)
|
|
28
|
+
|
|
29
|
+
## 命令用法
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
playcraft image sprite-sheet \
|
|
33
|
+
--inputs <图1>,<图2>,<图3>,... \
|
|
34
|
+
--output <ta-workspace内的基路径> # 自动生成 .png 和 .json
|
|
35
|
+
[--columns <列数>] # 默认按平方根自动计算
|
|
36
|
+
[--padding <帧间距像素>] # 默认 0
|
|
37
|
+
[--cell-width <宽>] # 默认用第一张图的宽
|
|
38
|
+
[--cell-height <高>] # 默认用第一张图的高
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 输出文件
|
|
42
|
+
|
|
43
|
+
- `<output>.png` — 精灵图 PNG
|
|
44
|
+
- `<output>.json` — 帧坐标数据,格式如下:
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"frames": {
|
|
48
|
+
"hero_idle_0.png": { "x": 0, "y": 0, "w": 64, "h": 64 },
|
|
49
|
+
"hero_idle_1.png": { "x": 64, "y": 0, "w": 64, "h": 64 }
|
|
50
|
+
},
|
|
51
|
+
"meta": { "image": "hero.png", "size": { "w": 256, "h": 64 }, "scale": 1 }
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## 工作流
|
|
56
|
+
|
|
57
|
+
1. **准备帧图片**:从 /project 只读读取参考图,或引用 ta-workspace 内已生成/处理的帧图
|
|
58
|
+
2. **(可选)统一尺寸**:用 `playcraft image resize` 确保所有帧尺寸一致
|
|
59
|
+
3. **合并精灵图**:
|
|
60
|
+
```bash
|
|
61
|
+
playcraft image sprite-sheet \
|
|
62
|
+
--inputs ta-workspace/frame_0.png,ta-workspace/frame_1.png,ta-workspace/frame_2.png \
|
|
63
|
+
--output ta-workspace/hero-sheet \
|
|
64
|
+
--columns 4 \
|
|
65
|
+
--cell-width 64 --cell-height 64
|
|
66
|
+
# 生成:ta-workspace/hero-sheet.png 和 ta-workspace/hero-sheet.json
|
|
67
|
+
```
|
|
68
|
+
4. **(可选)交付到素材库**:
|
|
69
|
+
```bash
|
|
70
|
+
playcraft tools publish-prefab \
|
|
71
|
+
--remix-project-id <ID> --template <名> --variant <名> --prefab <名> \
|
|
72
|
+
--staging-root <staging路径>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## 与步骤 5、6 融合
|
|
76
|
+
|
|
77
|
+
完整流程示例:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# 步骤 5:AI 生成帧
|
|
81
|
+
playcraft tools generate-image --prompt "hero idle frame 1, pixel art, transparent background" --output ta-workspace/f0.png
|
|
82
|
+
playcraft tools generate-image --prompt "hero idle frame 2, pixel art, transparent background" --output ta-workspace/f1.png
|
|
83
|
+
|
|
84
|
+
# 步骤 6:统一尺寸
|
|
85
|
+
playcraft image resize --input ta-workspace/f0.png --output ta-workspace/f0_64.png --width 64 --height 64 --fit contain
|
|
86
|
+
playcraft image resize --input ta-workspace/f1.png --output ta-workspace/f1_64.png --width 64 --height 64 --fit contain
|
|
87
|
+
|
|
88
|
+
# 步骤 7:合并精灵图
|
|
89
|
+
playcraft image sprite-sheet \
|
|
90
|
+
--inputs ta-workspace/f0_64.png,ta-workspace/f1_64.png \
|
|
91
|
+
--output ta-workspace/hero-idle \
|
|
92
|
+
--cell-width 64 --cell-height 64
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## 游戏引擎兼容
|
|
96
|
+
|
|
97
|
+
JSON 格式设计兼容常见引擎(Phaser、PlayCanvas 的 sprite 格式),key 为文件名,value 含 x/y/w/h 坐标。
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playtest_report.aivalidator
|
|
3
|
+
description: 试玩报告生成器 - 构建完成后模拟完整试玩流程,从玩家视角评估体验,输出结构化报告
|
|
4
|
+
triggers: 试玩报告,playtest report,体验报告,experience report,试玩评估,playtest review,质量报告,quality report
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 试玩报告生成器(Playtest Report Generator)
|
|
8
|
+
|
|
9
|
+
## 说明
|
|
10
|
+
|
|
11
|
+
在构建完成后模拟一次完整的试玩流程,从玩家视角评估体验质量。按照 UX 流程(Loading → Tutorial → Gameplay → CTA)逐阶段评分,输出结构化的 Markdown 报告。
|
|
12
|
+
|
|
13
|
+
### 评估维度
|
|
14
|
+
|
|
15
|
+
| 维度 | 检查内容 | 评分范围 |
|
|
16
|
+
|------|---------|---------|
|
|
17
|
+
| 首次交互时间 | 从加载完成到第一次可交互的时间 | 1-5 |
|
|
18
|
+
| 教程清晰度 | 教程是否直观、可跳过、不冗长 | 1-5 |
|
|
19
|
+
| 核心玩法体验 | 玩法是否有趣、反馈是否及时 | 1-5 |
|
|
20
|
+
| 难度感受 | 难度曲线是否合理、是否有挫败感 | 1-5 |
|
|
21
|
+
| CTA 可达性 | CTA 按钮是否醒目、触发时机是否自然 | 1-5 |
|
|
22
|
+
| 总时长 | 完整体验的总时长是否在 30-60 秒 | 1-5 |
|
|
23
|
+
| 视觉质量 | 画面是否精美、动画是否流畅 | 1-5 |
|
|
24
|
+
| 音频体验 | 音效是否合理、背景音乐是否加分 | 1-5 |
|
|
25
|
+
|
|
26
|
+
## Imports
|
|
27
|
+
|
|
28
|
+
(无外部依赖,独立运行)
|
|
29
|
+
|
|
30
|
+
## 报告模板
|
|
31
|
+
|
|
32
|
+
```markdown
|
|
33
|
+
# 试玩报告
|
|
34
|
+
|
|
35
|
+
## 基本信息
|
|
36
|
+
- **项目名称**: [project name]
|
|
37
|
+
- **测试日期**: [date]
|
|
38
|
+
- **目标平台**: [platform]
|
|
39
|
+
- **总时长**: [duration]s
|
|
40
|
+
|
|
41
|
+
## 阶段评分
|
|
42
|
+
|
|
43
|
+
### Loading 阶段
|
|
44
|
+
- **时长**: [x]s
|
|
45
|
+
- **评分**: [1-5]/5
|
|
46
|
+
- **备注**: ...
|
|
47
|
+
|
|
48
|
+
### Tutorial 阶段
|
|
49
|
+
- **时长**: [x]s
|
|
50
|
+
- **评分**: [1-5]/5
|
|
51
|
+
- **备注**: ...
|
|
52
|
+
|
|
53
|
+
### Gameplay 阶段
|
|
54
|
+
- **时长**: [x]s
|
|
55
|
+
- **关卡数**: [n]
|
|
56
|
+
- **评分**: [1-5]/5
|
|
57
|
+
- **备注**: ...
|
|
58
|
+
|
|
59
|
+
### CTA 阶段
|
|
60
|
+
- **触发方式**: [trigger]
|
|
61
|
+
- **评分**: [1-5]/5
|
|
62
|
+
- **备注**: ...
|
|
63
|
+
|
|
64
|
+
## 综合评分: [average]/5
|
|
65
|
+
|
|
66
|
+
## 关键指标
|
|
67
|
+
| 指标 | 实际值 | 目标值 | 状态 |
|
|
68
|
+
|------|--------|--------|------|
|
|
69
|
+
| 首次交互时间 | [x]s | ≤3s | ✅/❌ |
|
|
70
|
+
| 总时长 | [x]s | 30-60s | ✅/❌ |
|
|
71
|
+
| CTA 可达性 | [desc] | 明确可见 | ✅/❌ |
|
|
72
|
+
|
|
73
|
+
## 改进建议
|
|
74
|
+
1. ...
|
|
75
|
+
2. ...
|
|
76
|
+
3. ...
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Skill Definition
|
|
80
|
+
|
|
81
|
+
tools:
|
|
82
|
+
- read
|
|
83
|
+
- write
|
|
84
|
+
- bash
|
|
85
|
+
prompt_extension: |
|
|
86
|
+
You are a playtest evaluator for a playable ad (试玩广告).
|
|
87
|
+
After the build is complete, simulate a full playthrough and generate a report:
|
|
88
|
+
1. Open game/index.html (or the build output) and analyze the code structure
|
|
89
|
+
2. Walk through the full UX flow: Loading → Tutorial → Gameplay → CTA
|
|
90
|
+
3. Rate each phase on a 1-5 scale based on:
|
|
91
|
+
- Loading: Speed, visual appeal, brand presence
|
|
92
|
+
- Tutorial: Clarity, brevity, skip-ability
|
|
93
|
+
- Gameplay: Fun factor, feedback quality, difficulty feel
|
|
94
|
+
- CTA: Visibility, timing, persuasiveness
|
|
95
|
+
4. Check key metrics:
|
|
96
|
+
- First interaction time (target: ≤3s)
|
|
97
|
+
- Total duration (target: 30-60s)
|
|
98
|
+
- CTA reachability (must be clearly visible and tappable)
|
|
99
|
+
- Difficulty perception (should feel "almost winnable")
|
|
100
|
+
5. Output a structured markdown report to logs/playtest-report.md
|
|
101
|
+
Read game/config.json, the UX flow config, difficulty curve config,
|
|
102
|
+
and the game source code to make informed assessments.
|
|
103
|
+
Be specific in improvement suggestions — cite exact code or config values.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "playtest_report.aivalidator",
|
|
4
|
+
"bundleType": "aivalidator",
|
|
5
|
+
"category": "validator",
|
|
6
|
+
"mode": "fixed",
|
|
7
|
+
"label": {
|
|
8
|
+
"zh": "试玩报告生成器",
|
|
9
|
+
"en": "Playtest report generator"
|
|
10
|
+
},
|
|
11
|
+
"tags": ["validator", "playtest", "report", "experience", "quality", "review", "playable-ads"],
|
|
12
|
+
"bindingRoles": ["testFramework"],
|
|
13
|
+
"imports": [],
|
|
14
|
+
"validation": {
|
|
15
|
+
"target": "gameplay",
|
|
16
|
+
"outputFormat": "report"
|
|
17
|
+
},
|
|
18
|
+
"files": {
|
|
19
|
+
"skill": "SKILL.md"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: preloader_scene.aicomponent
|
|
3
|
+
description: Phaser 预加载场景。负责加载所有游戏资产(图片/音频)并显示 Loading UI,加载完成后调用 sdk.start() 通知投放平台,再切换到 Game 主场景。
|
|
4
|
+
triggers: 需要实现游戏资产预加载场景时触发。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 预加载场景(Preloader Scene)
|
|
8
|
+
|
|
9
|
+
## 说明
|
|
10
|
+
|
|
11
|
+
`Preloader` 场景负责:
|
|
12
|
+
|
|
13
|
+
1. 加载所有图片(logo/win/lose/nomove_hint/figer/time/win_dot/normal_dot 等)
|
|
14
|
+
2. 加载所有音频(bg/click/appear/success/fail/lose 等)
|
|
15
|
+
3. 显示 Loading UI(logo + 进度 dots 动画)
|
|
16
|
+
4. 加载完成后调用 `sdk.start()` 通知投放平台
|
|
17
|
+
5. 切换到 `Game` 主场景
|
|
18
|
+
|
|
19
|
+
## Scaffold
|
|
20
|
+
|
|
21
|
+
| 目标路径 | 来源 | 说明 |
|
|
22
|
+
|---------|-----|-----|
|
|
23
|
+
| `src/game/scenes/Preloader.ts` | `ref/Preloader.ts` | 完整预加载场景 |
|
|
24
|
+
|
|
25
|
+
## Recipe
|
|
26
|
+
|
|
27
|
+
| 决策 | 原因 |
|
|
28
|
+
|------|------|
|
|
29
|
+
| **加载完成才调用 sdk.start()** | 投放平台(腾讯游戏 SDK)需要 `sdk.start()` 作为"可玩广告就绪"信号;在 Preloader 完成后统一调用,避免 Game 场景未加载就触发交互 |
|
|
30
|
+
| **从 Game 场景分离** | 资产加载(IO 密集)与游戏逻辑(CPU 密集)职责完全不同;分离后 Game.ts 不需要处理加载状态,更纯粹 |
|
|
31
|
+
| **软槽位 loading_screen** | Loading UI 的品牌视觉(logo、星评)需要跨 Remix 替换;软槽位允许 Preloader 逻辑不变,只换显示组件 |
|
|
32
|
+
|
|
33
|
+
## Adapter
|
|
34
|
+
|
|
35
|
+
- **Role**: `preloaderScene` — Phaser 预加载场景(加载资产 → sdk.start() → 切换到 Game)
|
|
36
|
+
- **Provides**: `Preloader` class(Phaser 场景)
|
|
37
|
+
- **Requires**: `phaser.aicomponent`、`phaser_scene_lifecycle.aicomponent`、`tencent_playable_sdk.aicomponent`、`loading_screen.aicomponent`(软槽位 Loading UI)
|
|
38
|
+
- **Consumed by**: `phaser.aicomponent` 的 `scene: [Preloader, Game]` 注册(排在 Game 之前启动)
|
|
39
|
+
- **Integration point**: `src/game/scenes/Preloader.ts` → `src/game/index.ts` `scene: [Preloader, Game]` 第一个场景
|
|
40
|
+
|
|
41
|
+
## Imports
|
|
42
|
+
|
|
43
|
+
- `phaser.aicomponent`(硬依赖)
|
|
44
|
+
- `phaser_scene_lifecycle.aicomponent`(硬依赖:双场景架构)
|
|
45
|
+
- `tencent_playable_sdk.aicomponent`(硬依赖:sdk.start())
|
|
46
|
+
- `loading_screen.aicomponent`(软槽位:Loading UI 组件)
|
|
47
|
+
|
|
48
|
+
## Skill Definition
|
|
49
|
+
|
|
50
|
+
```yaml
|
|
51
|
+
tools:
|
|
52
|
+
- read_file
|
|
53
|
+
- write_file
|
|
54
|
+
inputs:
|
|
55
|
+
- source: src/game/scenes/Preloader.ts
|
|
56
|
+
outputs:
|
|
57
|
+
- preloader: Phaser Preloader scene class
|
|
58
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "preloader_scene.aicomponent",
|
|
4
|
+
"bundleType": "aicomponent",
|
|
5
|
+
"category": "scene",
|
|
6
|
+
"mode": "fixed",
|
|
7
|
+
"label": { "zh": "预加载场景", "en": "Preloader scene" },
|
|
8
|
+
"tags": ["scene", "preloader", "asset-loading", "loading-ui", "phaser"],
|
|
9
|
+
"bindingRoles": ["preloaderScene"],
|
|
10
|
+
"scaffold": {
|
|
11
|
+
"files": {
|
|
12
|
+
"src/game/scenes/Preloader.ts": {
|
|
13
|
+
"source": "ref/Preloader.ts",
|
|
14
|
+
"mode": "full",
|
|
15
|
+
"weight": 10
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"imports": [
|
|
20
|
+
{ "slot": "engine", "pinAtomId": "phaser.aicomponent", "edgeKind": "requires", "bindAs": "engine" },
|
|
21
|
+
{ "slot": "lifecycle", "pinAtomId": "phaser_scene_lifecycle.aicomponent", "edgeKind": "requires", "bindAs": "lifecycle" },
|
|
22
|
+
{
|
|
23
|
+
"slot": "loadingScreen",
|
|
24
|
+
"description": "Loading 页面 UI 组件(logo/title/stars/desc/dots 动画)",
|
|
25
|
+
"bindAs": "loadingUI",
|
|
26
|
+
"required": true,
|
|
27
|
+
"edgeKind": "compatibleWith",
|
|
28
|
+
"matchBindingRoles": ["loadingScreen"],
|
|
29
|
+
"allowedBundleTypes": ["aicomponent"]
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"exports": [
|
|
33
|
+
{ "name": "Preloader", "kind": "class", "location": "src/game/scenes/Preloader.ts" }
|
|
34
|
+
],
|
|
35
|
+
"neutralDescriptor": {
|
|
36
|
+
"geometry": "Phaser scene that preloads all game assets with a visual loading indicator, then signals the ad platform and transitions to the main game scene",
|
|
37
|
+
"layers": ["asset-loading", "loading-progress-ui", "scene-transition"]
|
|
38
|
+
},
|
|
39
|
+
"files": {
|
|
40
|
+
"skill": "SKILL.md",
|
|
41
|
+
"preloader": "ref/Preloader.ts"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import { Scene } from "phaser";
|
|
2
|
+
import * as Phaser from "phaser";
|
|
3
|
+
import { LevelManager } from "../levels/LevelManager";
|
|
4
|
+
import { SettingsManager } from "./GameUI/SettingsManager";
|
|
5
|
+
import { ThemeManager } from "./GameUI/ThemeManager";
|
|
6
|
+
import { clearActiveRunContext } from "../run/RunContextRuntime";
|
|
7
|
+
import { GameConfig } from "../GameConfig";
|
|
8
|
+
|
|
9
|
+
// 导入音频资源
|
|
10
|
+
import click from "assets/sounds/click.mp3";
|
|
11
|
+
import arrowMoveError from "assets/sounds/arrow_move_error.mp3";
|
|
12
|
+
import winAnim from "assets/sounds/win_anim.mp3";
|
|
13
|
+
import mistake from "assets/sounds/mistake.mp3";
|
|
14
|
+
import successSound from "assets/sounds/success.mp3";
|
|
15
|
+
import loseSound from "assets/sounds/lose.mp3";
|
|
16
|
+
import failSound from "assets/sounds/fail.mp3";
|
|
17
|
+
import appearSound from "assets/sounds/appear.mp3";
|
|
18
|
+
import buttonClick from "assets/sounds/button_click.mp3";
|
|
19
|
+
import bgm from "assets/sounds/bg.mp3";
|
|
20
|
+
|
|
21
|
+
// 导入图片资源
|
|
22
|
+
import nomoveHint from "assets/nomove_hint.webp";
|
|
23
|
+
import winDot from "assets/win_dot.webp";
|
|
24
|
+
import normalDot from "assets/normal_dot.webp";
|
|
25
|
+
import losePanel from "assets/lose.webp";
|
|
26
|
+
import winPanel from "assets/win.webp";
|
|
27
|
+
import figer from "assets/figer.webp";
|
|
28
|
+
import time from "assets/time.webp";
|
|
29
|
+
import logoImage from "assets/logo.webp";
|
|
30
|
+
|
|
31
|
+
const LoadingConfig = {
|
|
32
|
+
// 文案配置
|
|
33
|
+
LOGO_IMAGE: logoImage, // Logo 图片
|
|
34
|
+
APP_TITLE: "Arrows - Puzzle Escape", // 应用标题
|
|
35
|
+
APP_STARS: "★★★★★", // 评分星星
|
|
36
|
+
APP_DESC: "Solve puzzles and escape!\nSwipe arrows to complete levels!", // 应用描述
|
|
37
|
+
LOADING_TEXT: "Loading Playable Ads", // 加载文字
|
|
38
|
+
GAMEPAD_ICON: "🎮", // 游戏手柄图标
|
|
39
|
+
|
|
40
|
+
// 颜色配置(暗色主题)
|
|
41
|
+
BG_COLOR: "#1a1a1a", // 背景色(深灰黑)
|
|
42
|
+
TITLE_COLOR: "#ffffff", // 标题颜色(白色)
|
|
43
|
+
STARS_COLOR: "#ffc107", // 星星颜色(金色)
|
|
44
|
+
DESC_COLOR: "#aaaaaa", // 描述文字颜色(浅灰)
|
|
45
|
+
LOADING_COLOR: "#888888", // Loading 文字颜色(中灰)
|
|
46
|
+
|
|
47
|
+
// 时间配置
|
|
48
|
+
SCENE_DURATION: 300, // Loading 页面最小显示时长(毫秒)
|
|
49
|
+
DOT_ANIM_DELAY: 200, // 点号动画间隔(毫秒)
|
|
50
|
+
|
|
51
|
+
// 跳跃动画配置
|
|
52
|
+
BOUNCE_HEIGHT_LANDSCAPE: 8, // 横屏跳跃高度
|
|
53
|
+
BOUNCE_HEIGHT_PORTRAIT: 10, // 竖屏跳跃高度
|
|
54
|
+
BOUNCE_DURATION: 300, // 跳跃动画时长(毫秒)
|
|
55
|
+
BOUNCE_REPEAT_DELAY: 100, // 跳跃重复延迟(毫秒)
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export class Preloader extends Scene {
|
|
59
|
+
// UI 元素
|
|
60
|
+
private logoElement!: HTMLImageElement;
|
|
61
|
+
private loadingText!: Phaser.GameObjects.Text;
|
|
62
|
+
private gamepadIcon!: Phaser.GameObjects.Text;
|
|
63
|
+
|
|
64
|
+
// 动画相关
|
|
65
|
+
private dotCount: number = 0;
|
|
66
|
+
private dotTimer!: Phaser.Time.TimerEvent;
|
|
67
|
+
|
|
68
|
+
// 加载状态
|
|
69
|
+
private loadStartTime: number = 0;
|
|
70
|
+
|
|
71
|
+
constructor() {
|
|
72
|
+
super("Preloader");
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
init() {
|
|
76
|
+
const width = this.scale.width;
|
|
77
|
+
const height = this.scale.height;
|
|
78
|
+
const isLandscape = width > height;
|
|
79
|
+
|
|
80
|
+
// 记录加载开始时间
|
|
81
|
+
this.loadStartTime = Date.now();
|
|
82
|
+
const centerX = width / 2;
|
|
83
|
+
|
|
84
|
+
// 设置背景色为暗色(使用 LoadingConfig)
|
|
85
|
+
this.cameras.main.setBackgroundColor(LoadingConfig.BG_COLOR);
|
|
86
|
+
|
|
87
|
+
// 根据画布尺寸计算缩放比例(基于设计尺寸)
|
|
88
|
+
const baseWidth = isLandscape ? 667 : 375;
|
|
89
|
+
const baseHeight = isLandscape ? 375 : 667;
|
|
90
|
+
const scaleX = width / baseWidth;
|
|
91
|
+
const scaleY = height / baseHeight;
|
|
92
|
+
const scale = Math.min(scaleX, scaleY, 2); // 限制最大缩放
|
|
93
|
+
|
|
94
|
+
// 根据横竖屏获取基础布局配置,再乘以缩放比例
|
|
95
|
+
const logoSize = Math.round((isLandscape ? 80 : 120) * scale);
|
|
96
|
+
const titleFontSize = Math.round((isLandscape ? 24 : 32) * scale);
|
|
97
|
+
const starsFontSize = Math.round((isLandscape ? 18 : 24) * scale);
|
|
98
|
+
const descFontSize = Math.round((isLandscape ? 12 : 14) * scale);
|
|
99
|
+
const descMaxWidth = Math.round((isLandscape ? 300 : 280) * scale);
|
|
100
|
+
const iconFontSize = Math.round((isLandscape ? 18 : 24) * scale);
|
|
101
|
+
const loadingFontSize = Math.round((isLandscape ? 14 : 18) * scale);
|
|
102
|
+
const gap = Math.round((isLandscape ? 8 : 12) * scale);
|
|
103
|
+
|
|
104
|
+
// 位置计算
|
|
105
|
+
const logoY = height * (isLandscape ? 0.35 : 0.28);
|
|
106
|
+
const titleY =
|
|
107
|
+
logoY + logoSize / 2 + Math.round((isLandscape ? 15 : 25) * scale);
|
|
108
|
+
const starsY = titleY + Math.round((isLandscape ? 25 : 35) * scale);
|
|
109
|
+
const descY = starsY + Math.round((isLandscape ? 20 : 30) * scale);
|
|
110
|
+
// const progressBarY = height * (isLandscape ? 0.70 : 0.65); // 进度条位置
|
|
111
|
+
const loadingY = height * (isLandscape ? 0.85 : 0.88);
|
|
112
|
+
|
|
113
|
+
// Logo - 使用 DOM 元素显示,避免 canvas 缩放锯齿
|
|
114
|
+
this.createDomLogo(centerX, logoY, logoSize);
|
|
115
|
+
|
|
116
|
+
// 标题
|
|
117
|
+
this.add
|
|
118
|
+
.text(centerX, titleY, LoadingConfig.APP_TITLE, {
|
|
119
|
+
fontFamily: "Arial, sans-serif",
|
|
120
|
+
fontSize: `${titleFontSize}px`,
|
|
121
|
+
color: LoadingConfig.TITLE_COLOR,
|
|
122
|
+
fontStyle: "bold",
|
|
123
|
+
})
|
|
124
|
+
.setOrigin(0.5);
|
|
125
|
+
|
|
126
|
+
// 五星评分
|
|
127
|
+
this.add
|
|
128
|
+
.text(centerX, starsY, LoadingConfig.APP_STARS, {
|
|
129
|
+
fontFamily: "Arial, sans-serif",
|
|
130
|
+
fontSize: `${starsFontSize}px`,
|
|
131
|
+
color: LoadingConfig.STARS_COLOR,
|
|
132
|
+
})
|
|
133
|
+
.setOrigin(0.5);
|
|
134
|
+
|
|
135
|
+
// 描述文字
|
|
136
|
+
this.add
|
|
137
|
+
.text(centerX, descY, LoadingConfig.APP_DESC, {
|
|
138
|
+
fontFamily: "Arial, sans-serif",
|
|
139
|
+
fontSize: `${descFontSize}px`,
|
|
140
|
+
color: LoadingConfig.DESC_COLOR,
|
|
141
|
+
align: "center",
|
|
142
|
+
wordWrap: { width: descMaxWidth },
|
|
143
|
+
})
|
|
144
|
+
.setOrigin(0.5, 0);
|
|
145
|
+
|
|
146
|
+
// 游戏手柄图标 + Loading 文字(组合居中)
|
|
147
|
+
this.loadingText = this.add.text(0, 0, `${LoadingConfig.LOADING_TEXT}...`, {
|
|
148
|
+
fontFamily: "Arial, sans-serif",
|
|
149
|
+
fontSize: `${loadingFontSize}px`,
|
|
150
|
+
color: LoadingConfig.LOADING_COLOR,
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
// 计算组合总宽度并居中
|
|
154
|
+
const textWidth = this.loadingText.width;
|
|
155
|
+
const iconWidth = iconFontSize;
|
|
156
|
+
const totalWidth = iconWidth + gap + textWidth;
|
|
157
|
+
const startX = centerX - totalWidth / 2;
|
|
158
|
+
|
|
159
|
+
// 放置图标
|
|
160
|
+
this.gamepadIcon = this.add
|
|
161
|
+
.text(startX + iconWidth / 2, loadingY, LoadingConfig.GAMEPAD_ICON, {
|
|
162
|
+
fontFamily: "Arial, sans-serif",
|
|
163
|
+
fontSize: `${iconFontSize}px`,
|
|
164
|
+
})
|
|
165
|
+
.setOrigin(0.5);
|
|
166
|
+
|
|
167
|
+
// 添加跳跃动画
|
|
168
|
+
this.startBounceAnimation(loadingY, isLandscape, scale);
|
|
169
|
+
|
|
170
|
+
// 放置文字(紧跟图标后面)
|
|
171
|
+
this.loadingText.setPosition(startX + iconWidth + gap, loadingY);
|
|
172
|
+
this.loadingText.setOrigin(0, 0.5);
|
|
173
|
+
|
|
174
|
+
// 启动点号动画
|
|
175
|
+
this.startDotAnimation();
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
preload() {
|
|
179
|
+
// 使用 import 导入的资源路径加载
|
|
180
|
+
// 音频资源
|
|
181
|
+
this.load.audio("click", click);
|
|
182
|
+
this.load.audio("arrow_move_error", arrowMoveError);
|
|
183
|
+
this.load.audio("win_anim", winAnim);
|
|
184
|
+
this.load.audio("success", successSound);
|
|
185
|
+
this.load.audio("lose", loseSound);
|
|
186
|
+
this.load.audio("fail", failSound);
|
|
187
|
+
this.load.audio("appear", appearSound);
|
|
188
|
+
this.load.audio("button_click", buttonClick);
|
|
189
|
+
this.load.audio("mistake", mistake);
|
|
190
|
+
this.load.audio("bg", bgm);
|
|
191
|
+
|
|
192
|
+
// 图片资源
|
|
193
|
+
this.load.image("nomove_hint", nomoveHint);
|
|
194
|
+
this.load.image("win_dot", winDot);
|
|
195
|
+
this.load.image("normal_dot", normalDot);
|
|
196
|
+
this.load.image("lose_panel", losePanel);
|
|
197
|
+
this.load.image("win_panel", winPanel);
|
|
198
|
+
this.load.image("figer", figer);
|
|
199
|
+
this.load.image("time", time);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
create() {
|
|
203
|
+
this.tryShowGame();
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// 资源加载完成后,根据实际加载时间决定是否立即切换
|
|
207
|
+
private tryShowGame(): void {
|
|
208
|
+
const loadDuration = Date.now() - this.loadStartTime;
|
|
209
|
+
const minDuration = LoadingConfig.SCENE_DURATION;
|
|
210
|
+
|
|
211
|
+
if (loadDuration >= minDuration) {
|
|
212
|
+
// 已经超过最小显示时间,立即切换
|
|
213
|
+
this.showGame();
|
|
214
|
+
} else {
|
|
215
|
+
// 加载太快,等待剩余时间后切换(避免一闪而过)
|
|
216
|
+
const remainingTime = minDuration - loadDuration;
|
|
217
|
+
this.time.delayedCall(remainingTime, () => {
|
|
218
|
+
this.showGame();
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// 真正切换到游戏场景
|
|
224
|
+
private showGame(): void {
|
|
225
|
+
console.log("All conditions met, showing game");
|
|
226
|
+
// 移除 DOM logo 元素
|
|
227
|
+
this.removeDomLogo();
|
|
228
|
+
|
|
229
|
+
// 停留在Loading场景(调试用)
|
|
230
|
+
if (GameConfig.debugScene === "loading") {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// 基础数据
|
|
235
|
+
const profile = GameConfig;
|
|
236
|
+
const settings = SettingsManager.instance;
|
|
237
|
+
settings.musicOn = profile.settings.musicOn;
|
|
238
|
+
settings.soundOn = profile.settings.soundOn;
|
|
239
|
+
if (typeof profile.settings.dragSpeed === "number") {
|
|
240
|
+
settings.dragSpeed = Phaser.Math.Clamp(profile.settings.dragSpeed, 0, 1);
|
|
241
|
+
}
|
|
242
|
+
// 同步主题
|
|
243
|
+
const themeManager = ThemeManager.instance;
|
|
244
|
+
themeManager.syncFromProfile(profile.themes);
|
|
245
|
+
|
|
246
|
+
// 进入编辑器场景
|
|
247
|
+
if (GameConfig.debugScene === "editor") {
|
|
248
|
+
// 清理并启动 Editor 场景,Editor 场景会自动打开编辑器
|
|
249
|
+
clearActiveRunContext();
|
|
250
|
+
this.scene.start("Editor");
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
// 进入游戏模式
|
|
254
|
+
const levelManager = LevelManager.instance;
|
|
255
|
+
levelManager.setCurrentIndex(1);
|
|
256
|
+
clearActiveRunContext(); // 清理
|
|
257
|
+
this.scene.start("Game");
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
private startDotAnimation(): void {
|
|
261
|
+
this.dotTimer = this.time.addEvent({
|
|
262
|
+
delay: LoadingConfig.DOT_ANIM_DELAY,
|
|
263
|
+
callback: () => {
|
|
264
|
+
this.dotCount = (this.dotCount + 1) % 4;
|
|
265
|
+
const dots = ".".repeat(this.dotCount);
|
|
266
|
+
this.loadingText.setText(LoadingConfig.LOADING_TEXT + dots);
|
|
267
|
+
},
|
|
268
|
+
loop: true,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// 图标跳跃动画
|
|
273
|
+
private startBounceAnimation(
|
|
274
|
+
baseY: number,
|
|
275
|
+
isLandscape: boolean,
|
|
276
|
+
scale: number,
|
|
277
|
+
): void {
|
|
278
|
+
const bounceHeight = Math.round(
|
|
279
|
+
(isLandscape
|
|
280
|
+
? LoadingConfig.BOUNCE_HEIGHT_LANDSCAPE
|
|
281
|
+
: LoadingConfig.BOUNCE_HEIGHT_PORTRAIT) * scale,
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
this.tweens.add({
|
|
285
|
+
targets: this.gamepadIcon,
|
|
286
|
+
y: baseY - bounceHeight,
|
|
287
|
+
duration: LoadingConfig.BOUNCE_DURATION,
|
|
288
|
+
ease: "Quad.easeOut",
|
|
289
|
+
yoyo: true,
|
|
290
|
+
repeat: -1,
|
|
291
|
+
repeatDelay: LoadingConfig.BOUNCE_REPEAT_DELAY,
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
shutdown(): void {
|
|
296
|
+
if (this.dotTimer) {
|
|
297
|
+
this.dotTimer.destroy();
|
|
298
|
+
}
|
|
299
|
+
this.removeDomLogo();
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// 移除 DOM logo 元素
|
|
303
|
+
private removeDomLogo(): void {
|
|
304
|
+
if (this.logoElement && this.logoElement.parentNode) {
|
|
305
|
+
this.logoElement.parentNode.removeChild(this.logoElement);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// 创建 DOM logo 元素
|
|
310
|
+
private createDomLogo(centerX: number, centerY: number, size: number): void {
|
|
311
|
+
// 获取 canvas 元素和其在页面中的位置
|
|
312
|
+
const canvas = this.game.canvas;
|
|
313
|
+
const canvasRect = canvas.getBoundingClientRect();
|
|
314
|
+
|
|
315
|
+
// 计算缩放比例(canvas 实际显示大小 vs 游戏内部尺寸)
|
|
316
|
+
const scaleX = canvasRect.width / this.scale.width;
|
|
317
|
+
const scaleY = canvasRect.height / this.scale.height;
|
|
318
|
+
|
|
319
|
+
// 计算 logo 在页面中的实际位置和大小
|
|
320
|
+
const actualSize = size * scaleX;
|
|
321
|
+
const actualX = canvasRect.left + centerX * scaleX - actualSize / 2;
|
|
322
|
+
const actualY = canvasRect.top + centerY * scaleY - actualSize / 2;
|
|
323
|
+
|
|
324
|
+
// 创建 img 元素
|
|
325
|
+
this.logoElement = document.createElement("img");
|
|
326
|
+
this.logoElement.src = LoadingConfig.LOGO_IMAGE;
|
|
327
|
+
this.logoElement.style.cssText = `
|
|
328
|
+
position: absolute;
|
|
329
|
+
left: ${actualX}px;
|
|
330
|
+
top: ${actualY}px;
|
|
331
|
+
width: ${actualSize}px;
|
|
332
|
+
height: ${actualSize}px;
|
|
333
|
+
pointer-events: none;
|
|
334
|
+
z-index: 1000;
|
|
335
|
+
`;
|
|
336
|
+
|
|
337
|
+
document.body.appendChild(this.logoElement);
|
|
338
|
+
}
|
|
339
|
+
}
|