@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,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: loading_screen.aicomponent
|
|
3
|
+
description: Loading 页面 UI 组件。在 Preloader 场景中显示 logo、标题、星评、描述文字和加载进度点动画,资产加载期间向用户展示品牌信息。
|
|
4
|
+
triggers: 需要实现试玩广告的 Loading 页面 UI 时触发。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Loading 页面 UI(Loading Screen UI)
|
|
8
|
+
|
|
9
|
+
## 说明
|
|
10
|
+
|
|
11
|
+
Loading 页面在资产加载期间展示:
|
|
12
|
+
|
|
13
|
+
- **Logo**(可替换,软槽位 `appLogo`)
|
|
14
|
+
- **标题文字**(来自 `app_metadata.aiconfig`)
|
|
15
|
+
- **星评**(如 4.8★)
|
|
16
|
+
- **描述文字**
|
|
17
|
+
- **加载进度点动画**(dots bounce 效果)
|
|
18
|
+
|
|
19
|
+
## Scaffold
|
|
20
|
+
|
|
21
|
+
| 目标路径 | 来源 |
|
|
22
|
+
|---------|-----|
|
|
23
|
+
| `src/game/scenes/LoadingUI.ts` | `ref/LoadingUI.ts`(从 Preloader.ts 中提取) |
|
|
24
|
+
|
|
25
|
+
## Recipe
|
|
26
|
+
|
|
27
|
+
| 决策 | 原因 |
|
|
28
|
+
|------|------|
|
|
29
|
+
| **从 Preloader.ts 提取** | Preloader 负责加载逻辑,LoadingUI 负责加载期间的品牌展示;单一职责分离后 Preloader.ts 不被 UI 代码膨胀 |
|
|
30
|
+
| **软槽位 appLogo** | 不同 Remix 变体有不同的 App Logo;软槽位允许 LoadingUI 框架不变,只替换 logo 图片 |
|
|
31
|
+
| **dots bounce 进度动画** | 资产加载进度不均匀;dots 动画(非真实进度条)更流畅,避免显示卡顿造成的视觉跳跃 |
|
|
32
|
+
|
|
33
|
+
## Adapter
|
|
34
|
+
|
|
35
|
+
- **Role**: `loadingScreen` — 资产加载期间的品牌 UI 组件(logo + 标题 + 进度点动画)
|
|
36
|
+
- **Provides**: `LoadingUI` 类(初始化展示 + `updateProgress()` + `hide()`)
|
|
37
|
+
- **Requires**: `phaser.aicomponent`、`responsive_2d_layout.aicomponent`(UI 定位)、`appLogo`(软槽位)
|
|
38
|
+
- **Consumed by**: `preloader_scene.aicomponent`(在 Preloader 场景中实例化,加载完成后 hide)
|
|
39
|
+
- **Integration point**: `src/game/scenes/LoadingUI.ts` → `Preloader.create()` 中创建,`onLoadComplete()` 中 `hide()`
|
|
40
|
+
|
|
41
|
+
## Imports
|
|
42
|
+
|
|
43
|
+
- `phaser.aicomponent`(硬依赖)
|
|
44
|
+
- `responsive_2d_layout.aicomponent`(硬依赖:UI 定位)
|
|
45
|
+
- `appLogo`(软槽位:logo 图片,可替换不同 Remix 的 logo)
|
|
46
|
+
|
|
47
|
+
## Skill Definition
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
tools:
|
|
51
|
+
- read_file
|
|
52
|
+
- write_file
|
|
53
|
+
inputs:
|
|
54
|
+
- source: ref/LoadingUI.ts
|
|
55
|
+
outputs:
|
|
56
|
+
- loadingUI: loading screen UI component
|
|
57
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "loading_screen.aicomponent",
|
|
4
|
+
"bundleType": "aicomponent",
|
|
5
|
+
"category": "component",
|
|
6
|
+
"mode": "fixed",
|
|
7
|
+
"label": { "zh": "Loading 页面 UI", "en": "Loading screen UI" },
|
|
8
|
+
"tags": ["ui", "loading", "preloader", "logo", "animation", "dots"],
|
|
9
|
+
"bindingRoles": ["loadingScreen"],
|
|
10
|
+
"scaffold": {
|
|
11
|
+
"files": {
|
|
12
|
+
"src/game/scenes/LoadingUI.ts": {
|
|
13
|
+
"source": "ref/LoadingUI.ts",
|
|
14
|
+
"mode": "full",
|
|
15
|
+
"weight": 10
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"imports": [
|
|
20
|
+
{ "slot": "engine", "pinAtomId": "phaser.aicomponent", "edgeKind": "requires", "bindAs": "engine" },
|
|
21
|
+
{ "slot": "layout", "pinAtomId": "responsive_2d_layout.aicomponent", "edgeKind": "requires", "bindAs": "layout" },
|
|
22
|
+
{
|
|
23
|
+
"slot": "appLogo",
|
|
24
|
+
"description": "应用 logo 图片(每次投放不同)",
|
|
25
|
+
"bindAs": "logoTexture",
|
|
26
|
+
"required": false,
|
|
27
|
+
"edgeKind": "compatibleWith",
|
|
28
|
+
"matchBindingRoles": ["appLogo"],
|
|
29
|
+
"allowedBundleTypes": ["aiimage"]
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"exports": [
|
|
33
|
+
{ "name": "LoadingUI", "kind": "class-or-module", "location": "src/game/scenes/LoadingUI.ts" }
|
|
34
|
+
],
|
|
35
|
+
"neutralDescriptor": {
|
|
36
|
+
"geometry": "game loading screen with animated logo, title text, star rating display, description text, and animated loading dots indicator",
|
|
37
|
+
"layers": ["loading-animation", "brand-display", "progress-indicator"]
|
|
38
|
+
},
|
|
39
|
+
"files": {
|
|
40
|
+
"skill": "SKILL.md",
|
|
41
|
+
"loadingUi": "ref/LoadingUI.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
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lose_result_panel.aiimage
|
|
3
|
+
description: 生命耗尽或超时后显示的失败面板图片,鼓励玩家再次尝试。
|
|
4
|
+
triggers: 需要生成或替换失败结果面板图片时触发。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 失败结果面板
|
|
8
|
+
|
|
9
|
+
## Recipe
|
|
10
|
+
|
|
11
|
+
生成提示词见 manifest.json generation.prompt。
|
|
12
|
+
- model: google/imagen-3.0-generate-002(默认,见 manifest.json generation.platformSkill)
|
|
13
|
+
- format: webp, 透明背景
|
|
14
|
+
|
|
15
|
+
## Result
|
|
16
|
+
|
|
17
|
+
- 产物文件:`lose.webp`
|
|
18
|
+
- 在 Preloader.ts 中作为 `failFeedbackPanel` key 加载
|
|
19
|
+
|
|
20
|
+
## Binding
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"role": "failFeedbackPanel",
|
|
25
|
+
"target": "assets/lose.webp",
|
|
26
|
+
"type": "image-asset-reference"
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 生成方式
|
|
31
|
+
|
|
32
|
+
Platform Skill: `playcraft-image-generation`
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# 1. 生成图片(参考 ref/ 中的参考图)
|
|
36
|
+
playcraft tools generate-image \
|
|
37
|
+
--prompt "game over loss screen for mobile game, encouraging tone, try again vibe, not too discouraging" \
|
|
38
|
+
--aspect-ratio 1:1 \
|
|
39
|
+
--reference-image ${SKILL_DIR}/ref/lose.png \
|
|
40
|
+
--image-model google/imagen-3.0-generate-002 \
|
|
41
|
+
--output ta-workspace/raw.png
|
|
42
|
+
|
|
43
|
+
# 2. 后处理(去白底 + 格式转换)
|
|
44
|
+
playcraft image remove-background --input ta-workspace/raw.png --output ta-workspace/trimmed.png
|
|
45
|
+
playcraft image convert --input ta-workspace/trimmed.png --output ta-workspace/lose.webp --quality 85
|
|
46
|
+
|
|
47
|
+
# 3. 将产物写入 sandbox 对应路径(见 binding.target)
|
|
48
|
+
```
|
|
49
|
+
## Skill Definition
|
|
50
|
+
|
|
51
|
+
```yaml
|
|
52
|
+
tools:
|
|
53
|
+
- generate_image
|
|
54
|
+
inputs:
|
|
55
|
+
- prompt: see manifest.json
|
|
56
|
+
outputs:
|
|
57
|
+
- image: lose.webp
|
|
58
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "lose_result_panel.aiimage",
|
|
4
|
+
"bundleType": "aiimage",
|
|
5
|
+
"category": "visual",
|
|
6
|
+
"mode": "generative",
|
|
7
|
+
"label": {
|
|
8
|
+
"zh": "失败结果面板",
|
|
9
|
+
"en": "Lose result panel"
|
|
10
|
+
},
|
|
11
|
+
"tags": [
|
|
12
|
+
"visual",
|
|
13
|
+
"lose",
|
|
14
|
+
"fail",
|
|
15
|
+
"result-panel",
|
|
16
|
+
"game-over"
|
|
17
|
+
],
|
|
18
|
+
"bindingRoles": [
|
|
19
|
+
"failFeedbackPanel"
|
|
20
|
+
],
|
|
21
|
+
"generation": {
|
|
22
|
+
"kind": "image",
|
|
23
|
+
"prompt": "game over loss screen for mobile game, encouraging tone, try again vibe, not too discouraging",
|
|
24
|
+
"aspectRatio": "1:1",
|
|
25
|
+
"model": "google/imagen-3.0-generate-002",
|
|
26
|
+
"referenceImage": "ref/lose.png",
|
|
27
|
+
"platformSkill": "playcraft-image-generation"
|
|
28
|
+
},
|
|
29
|
+
"result": {
|
|
30
|
+
"outputFile": "ref/lose.webp",
|
|
31
|
+
"format": "webp",
|
|
32
|
+
"constraints": {
|
|
33
|
+
"minWidth": 600,
|
|
34
|
+
"minHeight": 400
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"binding": {
|
|
38
|
+
"role": "failFeedbackPanel",
|
|
39
|
+
"target": "assets/lose.webp",
|
|
40
|
+
"type": "image-asset-reference"
|
|
41
|
+
},
|
|
42
|
+
"files": {
|
|
43
|
+
"skill": "SKILL.md",
|
|
44
|
+
"asset": "ref/lose.webp",
|
|
45
|
+
"assetPng": "ref/lose.png"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lose_sfx.aiaudio
|
|
3
|
+
description: 点击被阻挡路径失去一条命时的音效(非游戏结束)。
|
|
4
|
+
triggers: 需要生成扣命提示音效时触发。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 失去生命音效
|
|
8
|
+
|
|
9
|
+
## Recipe
|
|
10
|
+
|
|
11
|
+
生成提示词见 manifest.json generation.prompt。
|
|
12
|
+
- model: Google Lyria 3(平台默认,见 manifest.json generation.platformSkill)
|
|
13
|
+
- format: mp3
|
|
14
|
+
- loop: false
|
|
15
|
+
|
|
16
|
+
## Result
|
|
17
|
+
|
|
18
|
+
- 产物文件:`lose.mp3`
|
|
19
|
+
- 在 Preloader.ts 中作为 `sfxLose` key 加载
|
|
20
|
+
|
|
21
|
+
## Binding
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"role": "sfxLose",
|
|
26
|
+
"target": "assets/sounds/lose.mp3",
|
|
27
|
+
"type": "audio-asset-reference"
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 生成方式
|
|
32
|
+
|
|
33
|
+
Platform Skill: `playcraft-audio-generation`
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# 1. 生成 SFX(--prompt 必须英文)
|
|
37
|
+
playcraft tools generate-sfx \
|
|
38
|
+
--prompt "short sad sound effect for losing a life in a puzzle game" \
|
|
39
|
+
--duration 1 \
|
|
40
|
+
--output ta-workspace/raw_sfx.mp3
|
|
41
|
+
|
|
42
|
+
# 2. 归一化音量
|
|
43
|
+
playcraft audio normalize --input ta-workspace/raw_sfx.mp3 --output ta-workspace/raw_sfx.mp3 --target-loudness -16
|
|
44
|
+
|
|
45
|
+
# 3. 压缩(SFX 目标 ≤15KB)
|
|
46
|
+
playcraft audio compress --input ta-workspace/raw_sfx.mp3 --output ta-workspace/lose.mp3 --target-size 15KB
|
|
47
|
+
|
|
48
|
+
# 4. 将产物写入 sandbox 对应路径(见 binding.target)
|
|
49
|
+
```
|
|
50
|
+
## Skill Definition
|
|
51
|
+
|
|
52
|
+
```yaml
|
|
53
|
+
tools:
|
|
54
|
+
- generate_audio
|
|
55
|
+
inputs:
|
|
56
|
+
- prompt: see manifest.json
|
|
57
|
+
outputs:
|
|
58
|
+
- audio: lose.mp3
|
|
59
|
+
```
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "lose_sfx.aiaudio",
|
|
4
|
+
"bundleType": "aiaudio",
|
|
5
|
+
"category": "audio",
|
|
6
|
+
"mode": "generative",
|
|
7
|
+
"label": {
|
|
8
|
+
"zh": "失去生命音效",
|
|
9
|
+
"en": "Lose life SFX"
|
|
10
|
+
},
|
|
11
|
+
"tags": [
|
|
12
|
+
"audio",
|
|
13
|
+
"sfx",
|
|
14
|
+
"lose",
|
|
15
|
+
"life",
|
|
16
|
+
"hearts"
|
|
17
|
+
],
|
|
18
|
+
"bindingRoles": [
|
|
19
|
+
"sfxLose"
|
|
20
|
+
],
|
|
21
|
+
"generation": {
|
|
22
|
+
"kind": "sfx",
|
|
23
|
+
"prompt": "short sad sound effect for losing a life in a puzzle game",
|
|
24
|
+
"duration": 1,
|
|
25
|
+
"loop": false,
|
|
26
|
+
"referenceAudio": "ref/lose.mp3",
|
|
27
|
+
"platformSkill": "playcraft-audio-generation"
|
|
28
|
+
},
|
|
29
|
+
"result": {
|
|
30
|
+
"outputFile": "ref/lose.mp3",
|
|
31
|
+
"format": "mp3",
|
|
32
|
+
"constraints": {
|
|
33
|
+
"maxDuration": 1
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"binding": {
|
|
37
|
+
"role": "sfxLose",
|
|
38
|
+
"target": "assets/sounds/lose.mp3",
|
|
39
|
+
"type": "audio-asset-reference"
|
|
40
|
+
},
|
|
41
|
+
"files": {
|
|
42
|
+
"skill": "SKILL.md",
|
|
43
|
+
"asset": "ref/lose.mp3"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# match-pop — Match-3 Element Pop Animation
|
|
2
|
+
|
|
3
|
+
The satisfying pop-and-disappear animation for matched elements. Includes a brief scale punch before fading out, with optional particle burst.
|
|
4
|
+
|
|
5
|
+
## Animation Sequence (300ms total)
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
0ms → 100ms: Scale up 1.0 → 1.3 (punch, easeOut)
|
|
9
|
+
100ms → 300ms: Scale down + fade out 1.3 → 0 (easeIn)
|
|
10
|
+
300ms: Entity hidden / destroyed
|
|
11
|
+
(optional) 50ms: Particle burst at element center
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Parameters
|
|
15
|
+
|
|
16
|
+
| Parameter | Default | Description |
|
|
17
|
+
|-----------|---------|-------------|
|
|
18
|
+
| `punchScale` | 1.3 | Peak scale overshoot |
|
|
19
|
+
| `duration` | 300ms | Total pop duration |
|
|
20
|
+
| `particles` | true | Emit sparkle burst |
|
|
21
|
+
| `destroyOnComplete` | true | Remove entity when done |
|
|
22
|
+
|
|
23
|
+
## Decision Notes
|
|
24
|
+
|
|
25
|
+
| Decision | Reason |
|
|
26
|
+
|----------|--------|
|
|
27
|
+
| Scale punch before fade | The punch creates satisfying "impact" feel before disappearing |
|
|
28
|
+
| 300ms total | Fast enough to not slow gameplay; long enough to be satisfying |
|
|
29
|
+
| Particles optional | Some styles prefer clean pops; others need the feedback |
|