@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,714 @@
|
|
|
1
|
+
import * as Phaser from "phaser";
|
|
2
|
+
import type { ParsedLevel } from "../../levels/LevelTypes";
|
|
3
|
+
import { DEFAULT_ZOOM_STEP, GameConfig } from "../../GameConfig";
|
|
4
|
+
import { CHALLENGE_SEGMENTS_MODE } from "../../DebugConfig";
|
|
5
|
+
import { GAME_TOP_UI_BAR_HEIGHT } from "./GameTopUI";
|
|
6
|
+
import { safePlaySound } from "../../utils/SoundUtils";
|
|
7
|
+
|
|
8
|
+
/** 连击音效最大等级 */
|
|
9
|
+
const COMBO_SOUND_MAX_LEVEL = 9;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 描述 InputHandler 从 Game 场景中所需内容的最小接口。
|
|
13
|
+
* 避免模块级别的循环导入。
|
|
14
|
+
*/
|
|
15
|
+
export interface InputGameRef extends Phaser.Scene {
|
|
16
|
+
level: ParsedLevel | null;
|
|
17
|
+
boardContainer: Phaser.GameObjects.Container;
|
|
18
|
+
boardGraphics: Phaser.GameObjects.Graphics;
|
|
19
|
+
cellSize: number;
|
|
20
|
+
cellWidth: number;
|
|
21
|
+
cellHeight: number;
|
|
22
|
+
zoom: number;
|
|
23
|
+
minZoom: number;
|
|
24
|
+
maxZoom: number;
|
|
25
|
+
boardOffsetX: number;
|
|
26
|
+
boardOffsetY: number;
|
|
27
|
+
removedPaths: Set<number>;
|
|
28
|
+
blockedPaths: Set<number>;
|
|
29
|
+
animatingPaths: Set<number>;
|
|
30
|
+
isInputLocked: boolean;
|
|
31
|
+
introPlaying: boolean;
|
|
32
|
+
isLevelOne: boolean;
|
|
33
|
+
isLevelTwo: boolean;
|
|
34
|
+
currentLives: number;
|
|
35
|
+
zoomTween: Phaser.Tweens.Tween | null;
|
|
36
|
+
gameOverPanel: any;
|
|
37
|
+
comboManager: {
|
|
38
|
+
clickCount: number;
|
|
39
|
+
lastSuccessAtMs: number;
|
|
40
|
+
chainWindowMs: number;
|
|
41
|
+
resetState(): void;
|
|
42
|
+
hideComboUi(): void;
|
|
43
|
+
handleComboUiOnSuccess(): void;
|
|
44
|
+
maybeShowComboPraiseText(
|
|
45
|
+
count: number,
|
|
46
|
+
x: number,
|
|
47
|
+
y: number,
|
|
48
|
+
hasPos: boolean,
|
|
49
|
+
): void;
|
|
50
|
+
};
|
|
51
|
+
tutorialManager: {
|
|
52
|
+
isLevelTwoZoomGuideActive: boolean;
|
|
53
|
+
isLevelOneTutorialActive: boolean;
|
|
54
|
+
levelOneTutorialExpectedPathIndex: number | null;
|
|
55
|
+
hintTargetIndex: number | null;
|
|
56
|
+
hideLevelTwoZoomGuide(): void;
|
|
57
|
+
advanceLevelOneTutorial(): void;
|
|
58
|
+
clearHintHighlight(): void;
|
|
59
|
+
};
|
|
60
|
+
settings: {
|
|
61
|
+
soundOn: boolean;
|
|
62
|
+
getDragSpeedMultiplier(): number;
|
|
63
|
+
};
|
|
64
|
+
levelLifecycle: {
|
|
65
|
+
loseLife(): void;
|
|
66
|
+
playDangerFrame(): void;
|
|
67
|
+
handleLevelSuccess(): void;
|
|
68
|
+
handleTimeOut(): void;
|
|
69
|
+
};
|
|
70
|
+
animationManager: {
|
|
71
|
+
animatePathOffBoard(
|
|
72
|
+
pathIndex: number,
|
|
73
|
+
dx: number,
|
|
74
|
+
dy: number,
|
|
75
|
+
stepsToExit: number,
|
|
76
|
+
isLastPath: boolean,
|
|
77
|
+
onComplete: () => void,
|
|
78
|
+
): void;
|
|
79
|
+
animateBlockedPath(
|
|
80
|
+
pathIndex: number,
|
|
81
|
+
dx: number,
|
|
82
|
+
dy: number,
|
|
83
|
+
stepsUntilBlock: number,
|
|
84
|
+
): void;
|
|
85
|
+
resetBoardViewForWin(): void;
|
|
86
|
+
playWinDiamondAnimation(): void;
|
|
87
|
+
};
|
|
88
|
+
topUI?: {
|
|
89
|
+
startTimer(): void;
|
|
90
|
+
};
|
|
91
|
+
runFlags: { kind: string };
|
|
92
|
+
|
|
93
|
+
// InputHandler 需要的 Game 方法
|
|
94
|
+
cellCenter(col: number, row: number): { x: number; y: number };
|
|
95
|
+
directionToDelta(direction: string): { dx: number; dy: number };
|
|
96
|
+
isCellOccupiedByAnyPath(
|
|
97
|
+
col: number,
|
|
98
|
+
row: number,
|
|
99
|
+
ignorePathIndex?: number,
|
|
100
|
+
): boolean;
|
|
101
|
+
positionBoardContainer(): void;
|
|
102
|
+
relayoutBoard(): void;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* 输入事件处理器。
|
|
107
|
+
* 负责处理鼠标/触摸的点击、拖拽、缩放等输入事件,
|
|
108
|
+
* 以及棋盘上箭头路径的命中检测和移动逻辑。
|
|
109
|
+
*/
|
|
110
|
+
export class InputHandler {
|
|
111
|
+
private scene: InputGameRef;
|
|
112
|
+
|
|
113
|
+
// 指针/拖拽状态
|
|
114
|
+
private isPointerDown = false;
|
|
115
|
+
private isDraggingBoard = false;
|
|
116
|
+
private dragStartWorldX = 0;
|
|
117
|
+
private dragStartWorldY = 0;
|
|
118
|
+
private isPointerDownOnUI = false;
|
|
119
|
+
|
|
120
|
+
// 点击位置(用于连击表扬文本定位)
|
|
121
|
+
private lastTapScreenX = 0;
|
|
122
|
+
private lastTapScreenY = 0;
|
|
123
|
+
private hasLastTapScreenPos = false;
|
|
124
|
+
|
|
125
|
+
// 双指缩放状态
|
|
126
|
+
private pinchZoomActive = false;
|
|
127
|
+
private pinchStartDistance = 0;
|
|
128
|
+
private pinchStartZoom = 1;
|
|
129
|
+
private pinchZoomUsedInGesture = false;
|
|
130
|
+
private lastPinchEndTime = 0;
|
|
131
|
+
|
|
132
|
+
// 引导线
|
|
133
|
+
private guideLinesGraphics: Phaser.GameObjects.Graphics | null = null;
|
|
134
|
+
private guideLinesVisible = false;
|
|
135
|
+
|
|
136
|
+
// 操作追踪
|
|
137
|
+
private actionNumbers = 0;
|
|
138
|
+
private firstInteractionInstallTimer: Phaser.Time.TimerEvent | null = null;
|
|
139
|
+
|
|
140
|
+
// 计时器是否已启动标记
|
|
141
|
+
private hasTimerStarted = false;
|
|
142
|
+
|
|
143
|
+
constructor(scene: InputGameRef) {
|
|
144
|
+
this.scene = scene;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* 重置所有输入相关状态。在 create() 开始时调用。
|
|
149
|
+
*/
|
|
150
|
+
resetState(): void {
|
|
151
|
+
this.isPointerDown = false;
|
|
152
|
+
this.isDraggingBoard = false;
|
|
153
|
+
this.isPointerDownOnUI = false;
|
|
154
|
+
this.pinchZoomActive = false;
|
|
155
|
+
this.pinchStartDistance = 0;
|
|
156
|
+
this.pinchZoomUsedInGesture = false;
|
|
157
|
+
this.lastPinchEndTime = 0;
|
|
158
|
+
this.hasLastTapScreenPos = false;
|
|
159
|
+
this.hasTimerStarted = false;
|
|
160
|
+
this.actionNumbers = 0;
|
|
161
|
+
this.firstInteractionInstallTimer = null;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* 绑定所有输入事件(wheel、pointerdown、pointermove、pointerup、pointerupoutside)。
|
|
166
|
+
* 在 create() 中棋盘构建完成后调用。
|
|
167
|
+
*/
|
|
168
|
+
bindEvents(): void {
|
|
169
|
+
const scene = this.scene;
|
|
170
|
+
|
|
171
|
+
// 鼠标滚轮缩放
|
|
172
|
+
scene.input.on(
|
|
173
|
+
"wheel",
|
|
174
|
+
(
|
|
175
|
+
pointer: Phaser.Input.Pointer,
|
|
176
|
+
_over: unknown[],
|
|
177
|
+
_dx: number,
|
|
178
|
+
dy: number,
|
|
179
|
+
) => {
|
|
180
|
+
if (scene.introPlaying) return;
|
|
181
|
+
if (this.isPointerOnUI(pointer)) return;
|
|
182
|
+
|
|
183
|
+
const baseStep = DEFAULT_ZOOM_STEP;
|
|
184
|
+
const step = dy > 0 ? -baseStep : baseStep;
|
|
185
|
+
const targetZoom = Phaser.Math.Clamp(
|
|
186
|
+
scene.zoom + step,
|
|
187
|
+
scene.minZoom,
|
|
188
|
+
scene.maxZoom,
|
|
189
|
+
);
|
|
190
|
+
this.tweenZoomTo(targetZoom);
|
|
191
|
+
if (scene.tutorialManager.isLevelTwoZoomGuideActive) {
|
|
192
|
+
scene.tutorialManager.hideLevelTwoZoomGuide();
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
// 指针按下:开始拖拽或双指缩放
|
|
198
|
+
scene.input.on("pointerdown", (pointer: Phaser.Input.Pointer) => {
|
|
199
|
+
if (scene.introPlaying) return;
|
|
200
|
+
|
|
201
|
+
const allPointers =
|
|
202
|
+
(scene.input.manager.pointers as Phaser.Input.Pointer[]) || [];
|
|
203
|
+
const activePointers = allPointers.filter((p) => p.isDown);
|
|
204
|
+
|
|
205
|
+
if (activePointers.length >= 2) {
|
|
206
|
+
const p1 = activePointers[0];
|
|
207
|
+
const p2 = activePointers[1];
|
|
208
|
+
if (p1 && p2) {
|
|
209
|
+
this.pinchZoomActive = true;
|
|
210
|
+
this.pinchStartDistance = Phaser.Math.Distance.Between(
|
|
211
|
+
p1.x,
|
|
212
|
+
p1.y,
|
|
213
|
+
p2.x,
|
|
214
|
+
p2.y,
|
|
215
|
+
);
|
|
216
|
+
this.pinchStartZoom = scene.zoom;
|
|
217
|
+
this.pinchZoomUsedInGesture = true;
|
|
218
|
+
this.isPointerDown = false;
|
|
219
|
+
this.isDraggingBoard = false;
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
this.isPointerDownOnUI = this.isPointerOnUI(pointer);
|
|
225
|
+
if (this.isPointerDownOnUI) {
|
|
226
|
+
this.isPointerDown = false;
|
|
227
|
+
this.isDraggingBoard = false;
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
this.isPointerDown = true;
|
|
232
|
+
this.isDraggingBoard = false;
|
|
233
|
+
this.dragStartWorldX = pointer.worldX;
|
|
234
|
+
this.dragStartWorldY = pointer.worldY;
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
// 指针移动:拖拽棋盘或双指缩放
|
|
238
|
+
scene.input.on("pointermove", (pointer: Phaser.Input.Pointer) => {
|
|
239
|
+
const allPointers =
|
|
240
|
+
(scene.input.manager.pointers as Phaser.Input.Pointer[]) || [];
|
|
241
|
+
const activePointers = allPointers.filter((p) => p.isDown);
|
|
242
|
+
|
|
243
|
+
if (this.pinchZoomActive && activePointers.length >= 2) {
|
|
244
|
+
const p1 = activePointers[0];
|
|
245
|
+
const p2 = activePointers[1];
|
|
246
|
+
if (p1 && p2) {
|
|
247
|
+
const newDistance = Phaser.Math.Distance.Between(
|
|
248
|
+
p1.x,
|
|
249
|
+
p1.y,
|
|
250
|
+
p2.x,
|
|
251
|
+
p2.y,
|
|
252
|
+
);
|
|
253
|
+
if (this.pinchStartDistance > 0) {
|
|
254
|
+
const scaleFactor = newDistance / this.pinchStartDistance;
|
|
255
|
+
const targetZoom = this.pinchStartZoom * scaleFactor;
|
|
256
|
+
this.tweenZoomTo(targetZoom);
|
|
257
|
+
this.pinchZoomUsedInGesture = true;
|
|
258
|
+
if (scene.tutorialManager.isLevelTwoZoomGuideActive) {
|
|
259
|
+
scene.tutorialManager.hideLevelTwoZoomGuide();
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
if (!this.isPointerDown) return;
|
|
267
|
+
if (!scene.boardContainer) return;
|
|
268
|
+
|
|
269
|
+
const dxWorld = pointer.worldX - this.dragStartWorldX;
|
|
270
|
+
const dyWorld = pointer.worldY - this.dragStartWorldY;
|
|
271
|
+
const dragThreshold = 5;
|
|
272
|
+
|
|
273
|
+
if (!this.isDraggingBoard) {
|
|
274
|
+
if (
|
|
275
|
+
Math.abs(dxWorld) < dragThreshold &&
|
|
276
|
+
Math.abs(dyWorld) < dragThreshold
|
|
277
|
+
) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
this.isDraggingBoard = true;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
this.dragStartWorldX = pointer.worldX;
|
|
284
|
+
this.dragStartWorldY = pointer.worldY;
|
|
285
|
+
|
|
286
|
+
const dragSpeed = scene.settings.getDragSpeedMultiplier();
|
|
287
|
+
scene.boardOffsetX += dxWorld * dragSpeed;
|
|
288
|
+
scene.boardOffsetY += dyWorld * dragSpeed;
|
|
289
|
+
scene.positionBoardContainer();
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
// 指针释放:结束拖拽或触发点击
|
|
293
|
+
scene.input.on("pointerup", (pointer: Phaser.Input.Pointer) => {
|
|
294
|
+
const allPointers =
|
|
295
|
+
(scene.input.manager.pointers as Phaser.Input.Pointer[]) || [];
|
|
296
|
+
const activePointers = allPointers.filter((p) => p.isDown);
|
|
297
|
+
|
|
298
|
+
const wasDragging = this.isDraggingBoard;
|
|
299
|
+
const wasOnUI = this.isPointerDownOnUI;
|
|
300
|
+
const wasPinchUsed = this.pinchZoomUsedInGesture;
|
|
301
|
+
this.isPointerDownOnUI = false;
|
|
302
|
+
this.isPointerDown = false;
|
|
303
|
+
this.isDraggingBoard = false;
|
|
304
|
+
|
|
305
|
+
if (activePointers.length < 2) {
|
|
306
|
+
this.pinchZoomActive = false;
|
|
307
|
+
this.pinchStartDistance = 0;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// 仅当所有指针都释放时,才认为多指手势结束
|
|
311
|
+
if (activePointers.length === 0) {
|
|
312
|
+
if (wasPinchUsed) {
|
|
313
|
+
this.lastPinchEndTime = scene.time.now;
|
|
314
|
+
}
|
|
315
|
+
this.pinchZoomUsedInGesture = false;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// 来自UI区域的指针不触发棋盘点击
|
|
319
|
+
if (wasOnUI || this.isPointerOnUI(pointer)) return;
|
|
320
|
+
|
|
321
|
+
// 如果本次手势使用了双指缩放,跳过棋盘点击
|
|
322
|
+
if (wasPinchUsed) return;
|
|
323
|
+
|
|
324
|
+
// 忽略双指缩放结束后立即发生的点击
|
|
325
|
+
const SAFE_PINCH_TAP_INTERVAL = 250;
|
|
326
|
+
if (
|
|
327
|
+
this.lastPinchEndTime > 0 &&
|
|
328
|
+
pointer.downTime - this.lastPinchEndTime <= SAFE_PINCH_TAP_INTERVAL
|
|
329
|
+
) {
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// 如果未发生拖拽,视为点击
|
|
334
|
+
if (!wasDragging) {
|
|
335
|
+
this.handlePointerUp(pointer);
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
// 指针在画布外释放
|
|
340
|
+
scene.input.on("pointerupoutside", () => {
|
|
341
|
+
if (this.pinchZoomUsedInGesture) {
|
|
342
|
+
this.lastPinchEndTime = scene.time.now;
|
|
343
|
+
}
|
|
344
|
+
this.isPointerDownOnUI = false;
|
|
345
|
+
this.isPointerDown = false;
|
|
346
|
+
this.isDraggingBoard = false;
|
|
347
|
+
this.pinchZoomActive = false;
|
|
348
|
+
this.pinchStartDistance = 0;
|
|
349
|
+
this.pinchZoomUsedInGesture = false;
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// ── 私有辅助方法 ──
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* 判断指针是否在UI区域上(顶部栏或底部栏)。
|
|
357
|
+
* @param pointer 指针对象
|
|
358
|
+
* @returns 是否在UI区域上
|
|
359
|
+
*/
|
|
360
|
+
private isPointerOnUI(pointer: Phaser.Input.Pointer): boolean {
|
|
361
|
+
const scene = this.scene;
|
|
362
|
+
if (scene.isInputLocked || scene.gameOverPanel) return true;
|
|
363
|
+
|
|
364
|
+
const height = scene.scale.height;
|
|
365
|
+
const BASE_HEIGHT = 1334;
|
|
366
|
+
const scaleY = height / BASE_HEIGHT;
|
|
367
|
+
|
|
368
|
+
const topBarHeight = GAME_TOP_UI_BAR_HEIGHT * scaleY;
|
|
369
|
+
const bottomBarHeight = GameConfig.GAME_BOTTOM_UI_BAR_HEIGHT * scaleY;
|
|
370
|
+
|
|
371
|
+
const y = pointer.y;
|
|
372
|
+
if (y <= topBarHeight) return true;
|
|
373
|
+
if (y >= height - bottomBarHeight) return true;
|
|
374
|
+
return false;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* 将指针的世界坐标转换为棋盘本地坐标。
|
|
379
|
+
* @param pointer 指针对象
|
|
380
|
+
* @returns 本地坐标对象,如果棋盘容器不存在则返回 null
|
|
381
|
+
*/
|
|
382
|
+
private getBoardLocalPos(
|
|
383
|
+
pointer: Phaser.Input.Pointer,
|
|
384
|
+
): { localX: number; localY: number } | null {
|
|
385
|
+
const scene = this.scene;
|
|
386
|
+
if (!scene.boardContainer) return null;
|
|
387
|
+
|
|
388
|
+
const worldX = pointer.worldX - scene.boardContainer.x;
|
|
389
|
+
const worldY = pointer.worldY - scene.boardContainer.y;
|
|
390
|
+
const localX = worldX / scene.zoom;
|
|
391
|
+
const localY = worldY / scene.zoom;
|
|
392
|
+
return { localX, localY };
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* 根据本地坐标命中检测棋盘上的箭头路径。
|
|
397
|
+
* 优先级:箭头头部命中 > 路径体命中 > 最近箭头头部(在半径内)。
|
|
398
|
+
* @param level 关卡数据
|
|
399
|
+
* @param localX 本地X坐标
|
|
400
|
+
* @param localY 本地Y坐标
|
|
401
|
+
* @returns 命中的路径索引,未命中返回 null
|
|
402
|
+
*/
|
|
403
|
+
private pickGridPathIndexAt(
|
|
404
|
+
level: ParsedLevel,
|
|
405
|
+
localX: number,
|
|
406
|
+
localY: number,
|
|
407
|
+
): number | null {
|
|
408
|
+
const scene = this.scene;
|
|
409
|
+
const col = Math.floor(localX / scene.cellWidth);
|
|
410
|
+
const row = Math.floor(localY / scene.cellHeight);
|
|
411
|
+
|
|
412
|
+
if (col < 0 || row < 0 || col >= level.cols || row >= level.rows) {
|
|
413
|
+
return null;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
const cellIndex = row * level.cols + col;
|
|
417
|
+
|
|
418
|
+
let headHitIndex: number | null = null;
|
|
419
|
+
let bodyHitIndex: number | null = null;
|
|
420
|
+
let nearestHeadIndex: number | null = null;
|
|
421
|
+
let nearestHeadDistSq = Number.POSITIVE_INFINITY;
|
|
422
|
+
|
|
423
|
+
for (let i = 0; i < level.paths.length; i++) {
|
|
424
|
+
if (scene.removedPaths.has(i)) continue;
|
|
425
|
+
const path = level.paths[i]!;
|
|
426
|
+
|
|
427
|
+
const head = path.head;
|
|
428
|
+
const headCenter = scene.cellCenter(head.x, head.y);
|
|
429
|
+
const dxHead = localX - headCenter.x;
|
|
430
|
+
const dyHead = localY - headCenter.y;
|
|
431
|
+
const distSqHead = dxHead * dxHead + dyHead * dyHead;
|
|
432
|
+
if (distSqHead < nearestHeadDistSq) {
|
|
433
|
+
nearestHeadDistSq = distSqHead;
|
|
434
|
+
nearestHeadIndex = i;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
if (head.x === col && head.y === row) {
|
|
438
|
+
headHitIndex = i;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
if (path.indices.includes(cellIndex)) {
|
|
442
|
+
bodyHitIndex = bodyHitIndex === null ? i : bodyHitIndex;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
if (headHitIndex !== null) return headHitIndex;
|
|
447
|
+
if (bodyHitIndex !== null) return bodyHitIndex;
|
|
448
|
+
if (nearestHeadIndex !== null && Number.isFinite(nearestHeadDistSq)) {
|
|
449
|
+
const radius = scene.cellSize * 0.9;
|
|
450
|
+
if (nearestHeadDistSq <= radius * radius) {
|
|
451
|
+
return nearestHeadIndex;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
return null;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* 平滑缩放到目标值。缩放回最小值时自动居中棋盘。
|
|
460
|
+
* @param targetZoom 目标缩放值
|
|
461
|
+
*/
|
|
462
|
+
private tweenZoomTo(targetZoom: number): void {
|
|
463
|
+
const scene = this.scene;
|
|
464
|
+
const clamped = Phaser.Math.Clamp(targetZoom, scene.minZoom, scene.maxZoom);
|
|
465
|
+
if (Math.abs(clamped - scene.zoom) < 0.0001) {
|
|
466
|
+
scene.zoom = clamped;
|
|
467
|
+
scene.positionBoardContainer();
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
if (scene.zoomTween) {
|
|
472
|
+
scene.zoomTween.stop();
|
|
473
|
+
scene.zoomTween = null;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
// 立即应用缩放以避免视觉延迟
|
|
477
|
+
scene.zoom = clamped;
|
|
478
|
+
scene.positionBoardContainer();
|
|
479
|
+
|
|
480
|
+
// 当缩放回最小值时,平滑重置棋盘偏移到居中位置
|
|
481
|
+
if (
|
|
482
|
+
clamped === scene.minZoom &&
|
|
483
|
+
(scene.boardOffsetX !== 0 || scene.boardOffsetY !== 0)
|
|
484
|
+
) {
|
|
485
|
+
scene.tweens.add({
|
|
486
|
+
targets: scene,
|
|
487
|
+
boardOffsetX: 0,
|
|
488
|
+
boardOffsetY: 0,
|
|
489
|
+
duration: 150,
|
|
490
|
+
ease: "Sine.easeInOut",
|
|
491
|
+
onUpdate: () => {
|
|
492
|
+
scene.positionBoardContainer();
|
|
493
|
+
},
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* 处理指针释放事件(点击棋盘)。
|
|
500
|
+
* 进行命中检测并尝试移动路径。
|
|
501
|
+
* @param pointer 指针对象
|
|
502
|
+
*/
|
|
503
|
+
private handlePointerUp(pointer: Phaser.Input.Pointer): void {
|
|
504
|
+
const scene = this.scene;
|
|
505
|
+
if (!scene.level || !scene.boardContainer) return;
|
|
506
|
+
if (scene.introPlaying) return;
|
|
507
|
+
this.actionNumbers += 1;
|
|
508
|
+
|
|
509
|
+
// 第二次交互后销毁延迟安装计时器(SDK removed)
|
|
510
|
+
if (this.actionNumbers >= 2 && this.firstInteractionInstallTimer) {
|
|
511
|
+
this.firstInteractionInstallTimer.destroy();
|
|
512
|
+
this.firstInteractionInstallTimer = null;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
const level = scene.level!;
|
|
516
|
+
const localPos = this.getBoardLocalPos(pointer);
|
|
517
|
+
if (!localPos) return;
|
|
518
|
+
|
|
519
|
+
const { localX, localY } = localPos;
|
|
520
|
+
const hitIndex = this.pickGridPathIndexAt(level, localX, localY);
|
|
521
|
+
if (hitIndex === null) return;
|
|
522
|
+
|
|
523
|
+
this.lastTapScreenX = pointer.x;
|
|
524
|
+
this.lastTapScreenY = pointer.y;
|
|
525
|
+
this.hasLastTapScreenPos = true;
|
|
526
|
+
|
|
527
|
+
if (scene.tutorialManager.isLevelTwoZoomGuideActive) {
|
|
528
|
+
scene.tutorialManager.hideLevelTwoZoomGuide();
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// 第一关教程模式下,只允许点击预期的路径
|
|
532
|
+
if (
|
|
533
|
+
scene.isLevelOne &&
|
|
534
|
+
scene.tutorialManager.isLevelOneTutorialActive &&
|
|
535
|
+
scene.tutorialManager.levelOneTutorialExpectedPathIndex !== null &&
|
|
536
|
+
hitIndex !== scene.tutorialManager.levelOneTutorialExpectedPathIndex
|
|
537
|
+
) {
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// 用户点击箭头时隐藏引导线
|
|
542
|
+
if (this.guideLinesVisible) {
|
|
543
|
+
this.hideGuideLines();
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
const removedBefore = scene.removedPaths.has(hitIndex);
|
|
547
|
+
this.attemptMovePath(hitIndex);
|
|
548
|
+
|
|
549
|
+
// 第一关教程:成功消除后推进教程
|
|
550
|
+
if (scene.isLevelOne && scene.tutorialManager.isLevelOneTutorialActive) {
|
|
551
|
+
const removedAfter = scene.removedPaths.has(hitIndex);
|
|
552
|
+
if (!removedBefore && removedAfter) {
|
|
553
|
+
scene.tutorialManager.advanceLevelOneTutorial();
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* 尝试沿箭头方向移动路径。
|
|
560
|
+
* 判断是否出界(成功消除)或被阻挡(播放阻挡动画并扣血)。
|
|
561
|
+
* @param pathIndex 路径索引
|
|
562
|
+
*/
|
|
563
|
+
private attemptMovePath(pathIndex: number): void {
|
|
564
|
+
const scene = this.scene;
|
|
565
|
+
if (!scene.level) return;
|
|
566
|
+
if (scene.currentLives <= 0) return;
|
|
567
|
+
|
|
568
|
+
if (scene.tutorialManager.hintTargetIndex === pathIndex) {
|
|
569
|
+
scene.tutorialManager.clearHintHighlight();
|
|
570
|
+
}
|
|
571
|
+
const level = scene.level;
|
|
572
|
+
const path = level.paths[pathIndex]!;
|
|
573
|
+
|
|
574
|
+
// 已消除或正在动画中
|
|
575
|
+
if (scene.removedPaths.has(pathIndex)) return;
|
|
576
|
+
if (scene.animatingPaths.has(pathIndex)) return;
|
|
577
|
+
|
|
578
|
+
const { dx, dy } = scene.directionToDelta(path.direction);
|
|
579
|
+
if (dx === 0 && dy === 0) return;
|
|
580
|
+
|
|
581
|
+
let x = path.head.x;
|
|
582
|
+
let y = path.head.y;
|
|
583
|
+
|
|
584
|
+
const maxSteps = Math.max(level.cols, level.rows) + 1;
|
|
585
|
+
let stepsUntilBlock: number | null = null;
|
|
586
|
+
|
|
587
|
+
for (let step = 0; step < maxSteps; step++) {
|
|
588
|
+
x += dx;
|
|
589
|
+
y += dy;
|
|
590
|
+
|
|
591
|
+
// 出界:成功 - 播放移出棋盘动画
|
|
592
|
+
if (x < 0 || y < 0 || x >= level.cols || y >= level.rows) {
|
|
593
|
+
const stepsToExit = step + 1;
|
|
594
|
+
|
|
595
|
+
// 首次成功消除时启动计时器
|
|
596
|
+
if (!this.hasTimerStarted) {
|
|
597
|
+
this.hasTimerStarted = true;
|
|
598
|
+
if (scene.topUI) {
|
|
599
|
+
scene.topUI.startTimer();
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
scene.blockedPaths.delete(pathIndex);
|
|
604
|
+
scene.removedPaths.add(pathIndex);
|
|
605
|
+
|
|
606
|
+
// 处理连击逻辑
|
|
607
|
+
{
|
|
608
|
+
const now = scene.time.now;
|
|
609
|
+
const chained =
|
|
610
|
+
scene.comboManager.clickCount > 0 &&
|
|
611
|
+
now - scene.comboManager.lastSuccessAtMs <=
|
|
612
|
+
scene.comboManager.chainWindowMs;
|
|
613
|
+
scene.comboManager.clickCount = chained
|
|
614
|
+
? scene.comboManager.clickCount + 1
|
|
615
|
+
: 1;
|
|
616
|
+
scene.comboManager.lastSuccessAtMs = now;
|
|
617
|
+
scene.comboManager.handleComboUiOnSuccess();
|
|
618
|
+
scene.comboManager.maybeShowComboPraiseText(
|
|
619
|
+
scene.comboManager.clickCount,
|
|
620
|
+
this.lastTapScreenX,
|
|
621
|
+
this.lastTapScreenY,
|
|
622
|
+
this.hasLastTapScreenPos,
|
|
623
|
+
);
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
// 播放点击音效
|
|
627
|
+
if (scene.settings.soundOn) {
|
|
628
|
+
const levelIndex = Math.min(
|
|
629
|
+
COMBO_SOUND_MAX_LEVEL,
|
|
630
|
+
Math.max(1, scene.comboManager.clickCount),
|
|
631
|
+
);
|
|
632
|
+
if (levelIndex >= COMBO_SOUND_MAX_LEVEL) {
|
|
633
|
+
const volumeJitter = 0.7 + Math.random() * 0.1;
|
|
634
|
+
safePlaySound(scene, `click`, { volume: volumeJitter });
|
|
635
|
+
} else {
|
|
636
|
+
safePlaySound(scene, `click`, { volume: 0.7 });
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
const isLastPath = scene.level
|
|
641
|
+
? scene.removedPaths.size >= scene.level.paths.length
|
|
642
|
+
: false;
|
|
643
|
+
|
|
644
|
+
scene.relayoutBoard();
|
|
645
|
+
scene.animationManager.animatePathOffBoard(
|
|
646
|
+
pathIndex,
|
|
647
|
+
dx,
|
|
648
|
+
dy,
|
|
649
|
+
stepsToExit,
|
|
650
|
+
isLastPath,
|
|
651
|
+
() => {
|
|
652
|
+
// 动画完成后检查分段挑战模式
|
|
653
|
+
if (
|
|
654
|
+
CHALLENGE_SEGMENTS_MODE > 0 &&
|
|
655
|
+
scene.removedPaths.size >= CHALLENGE_SEGMENTS_MODE
|
|
656
|
+
) {
|
|
657
|
+
scene.levelLifecycle.handleLevelSuccess();
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
);
|
|
662
|
+
|
|
663
|
+
// 最后一条路径:播放胜利动画
|
|
664
|
+
if (isLastPath) {
|
|
665
|
+
scene.animationManager.resetBoardViewForWin();
|
|
666
|
+
const WIN_ANIM_DELAY_MS = 220;
|
|
667
|
+
scene.time.delayedCall(WIN_ANIM_DELAY_MS, () => {
|
|
668
|
+
scene.animationManager.playWinDiamondAnimation();
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
// 被其他路径阻挡
|
|
675
|
+
if (scene.isCellOccupiedByAnyPath(x, y, pathIndex)) {
|
|
676
|
+
stepsUntilBlock = step + 1;
|
|
677
|
+
break;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
// 如果被阻挡,播放阻挡动画
|
|
682
|
+
if (stepsUntilBlock !== null && stepsUntilBlock > 0) {
|
|
683
|
+
const isFirstBlocked = !scene.blockedPaths.has(pathIndex);
|
|
684
|
+
|
|
685
|
+
if (isFirstBlocked) {
|
|
686
|
+
scene.comboManager.resetState();
|
|
687
|
+
scene.comboManager.hideComboUi();
|
|
688
|
+
scene.levelLifecycle.loseLife();
|
|
689
|
+
scene.levelLifecycle.playDangerFrame();
|
|
690
|
+
}
|
|
691
|
+
if (scene.settings.soundOn) {
|
|
692
|
+
safePlaySound(scene, "arrow_move_error", { volume: 0.8 });
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
scene.animatingPaths.add(pathIndex);
|
|
696
|
+
scene.relayoutBoard();
|
|
697
|
+
scene.animationManager.animateBlockedPath(
|
|
698
|
+
pathIndex,
|
|
699
|
+
dx,
|
|
700
|
+
dy,
|
|
701
|
+
stepsUntilBlock,
|
|
702
|
+
);
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
/** 隐藏引导线并销毁图形对象。 */
|
|
707
|
+
private hideGuideLines(): void {
|
|
708
|
+
if (this.guideLinesGraphics) {
|
|
709
|
+
this.guideLinesGraphics.destroy();
|
|
710
|
+
this.guideLinesGraphics = null;
|
|
711
|
+
}
|
|
712
|
+
this.guideLinesVisible = false;
|
|
713
|
+
}
|
|
714
|
+
}
|