@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,78 @@
|
|
|
1
|
+
import { Scene } from "phaser";
|
|
2
|
+
import { SceneKeys } from "../SceneKeys";
|
|
3
|
+
import { computeUiLayout } from "../utils/UiLayout";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 通用预加载场景。
|
|
7
|
+
*
|
|
8
|
+
* 提供居中进度条 + "Loading..." 文字。
|
|
9
|
+
* 在 preload() 中按需添加 this.load.image / this.load.audio 等调用即可。
|
|
10
|
+
*/
|
|
11
|
+
export class PreloaderScene extends Scene {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(SceneKeys.Preloader);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
preload(): void {
|
|
17
|
+
const { centerX, centerY, uiScale } = computeUiLayout(this);
|
|
18
|
+
|
|
19
|
+
// ─── 进度条 ───
|
|
20
|
+
const barW = 300 * uiScale;
|
|
21
|
+
const barH = 16 * uiScale;
|
|
22
|
+
const barRadius = barH * 0.5;
|
|
23
|
+
|
|
24
|
+
// 背景槽
|
|
25
|
+
const barBg = this.add.graphics();
|
|
26
|
+
barBg.fillStyle(0x333333, 1);
|
|
27
|
+
barBg.fillRoundedRect(
|
|
28
|
+
centerX - barW * 0.5,
|
|
29
|
+
centerY - barH * 0.5,
|
|
30
|
+
barW,
|
|
31
|
+
barH,
|
|
32
|
+
barRadius,
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
// 填充条
|
|
36
|
+
const barFill = this.add.graphics();
|
|
37
|
+
|
|
38
|
+
// Loading 文字
|
|
39
|
+
const loadText = this.add
|
|
40
|
+
.text(centerX, centerY + 30 * uiScale, "Loading...", {
|
|
41
|
+
fontSize: `${16 * uiScale}px`,
|
|
42
|
+
color: "#aaaaaa",
|
|
43
|
+
fontFamily: "Arial, sans-serif",
|
|
44
|
+
})
|
|
45
|
+
.setOrigin(0.5);
|
|
46
|
+
|
|
47
|
+
// ─── 进度回调 ───
|
|
48
|
+
this.load.on("progress", (value: number) => {
|
|
49
|
+
barFill.clear();
|
|
50
|
+
barFill.fillStyle(0x4488ff, 1);
|
|
51
|
+
barFill.fillRoundedRect(
|
|
52
|
+
centerX - barW * 0.5,
|
|
53
|
+
centerY - barH * 0.5,
|
|
54
|
+
barW * value,
|
|
55
|
+
barH,
|
|
56
|
+
barRadius,
|
|
57
|
+
);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
this.load.on("complete", () => {
|
|
61
|
+
loadText.setText("Ready");
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// ──────────────────────────────────────────
|
|
65
|
+
// 在下方添加你的资源加载调用,例如:
|
|
66
|
+
//
|
|
67
|
+
// import logoImage from "assets/images/logo.webp";
|
|
68
|
+
// this.load.image("logo", logoImage);
|
|
69
|
+
//
|
|
70
|
+
// import bgmAudio from "assets/sounds/bgm.mp3";
|
|
71
|
+
// this.load.audio("bgm", bgmAudio);
|
|
72
|
+
// ──────────────────────────────────────────
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
create(): void {
|
|
76
|
+
this.scene.start(SceneKeys.Game);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as Phaser from "phaser";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 安全播放音效。
|
|
5
|
+
* - 音效键不存在时静默返回 null(不抛异常)
|
|
6
|
+
* - 可通过 config 控制音量、循环等
|
|
7
|
+
*/
|
|
8
|
+
export function safePlaySound(
|
|
9
|
+
scene: Phaser.Scene,
|
|
10
|
+
key: string,
|
|
11
|
+
config?: Phaser.Types.Sound.SoundConfig,
|
|
12
|
+
): Phaser.Sound.BaseSound | null {
|
|
13
|
+
if (!scene.cache.audio.exists(key)) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
try {
|
|
17
|
+
return scene.sound.play(key, config) as unknown as Phaser.Sound.BaseSound;
|
|
18
|
+
} catch {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as Phaser from "phaser";
|
|
2
|
+
import { GameConfig } from "../GameConfig";
|
|
3
|
+
|
|
4
|
+
export interface UiLayoutConfig {
|
|
5
|
+
baseWidth?: number;
|
|
6
|
+
baseHeight?: number;
|
|
7
|
+
minScale?: number;
|
|
8
|
+
maxScale?: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface UiLayoutResult {
|
|
12
|
+
camera: Phaser.Cameras.Scene2D.Camera;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
scaleX: number;
|
|
16
|
+
scaleY: number;
|
|
17
|
+
uiScale: number;
|
|
18
|
+
vScale: number;
|
|
19
|
+
centerX: number;
|
|
20
|
+
centerY: number;
|
|
21
|
+
isLandscape: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Layout Canon(Phaser 绑定)。
|
|
26
|
+
*
|
|
27
|
+
* 基于 750×1334 设计稿,统一计算 UI 适配参数:
|
|
28
|
+
* - uiScale = clamp(min(scaleX, scaleY), minScale, maxScale)
|
|
29
|
+
* - vScale = scaleY(仅随高度变化,用于贴底/贴顶垂向距离)
|
|
30
|
+
*
|
|
31
|
+
* @see responsive_2d_layout.aicomponent SKILL.md 第一节
|
|
32
|
+
*/
|
|
33
|
+
export function computeUiLayout(
|
|
34
|
+
sceneOrCamera: Phaser.Scene | Phaser.Cameras.Scene2D.Camera,
|
|
35
|
+
config: UiLayoutConfig = GameConfig,
|
|
36
|
+
): UiLayoutResult {
|
|
37
|
+
const camera =
|
|
38
|
+
sceneOrCamera instanceof Phaser.Scene
|
|
39
|
+
? sceneOrCamera.cameras.main
|
|
40
|
+
: sceneOrCamera;
|
|
41
|
+
|
|
42
|
+
const { width, height } = camera;
|
|
43
|
+
|
|
44
|
+
const baseWidth = config.baseWidth ?? 750;
|
|
45
|
+
const baseHeight = config.baseHeight ?? 1334;
|
|
46
|
+
|
|
47
|
+
const scaleX = width / baseWidth;
|
|
48
|
+
const scaleY = height / baseHeight;
|
|
49
|
+
|
|
50
|
+
const minScale = config.minScale ?? 0.7;
|
|
51
|
+
const maxScale = config.maxScale ?? 1.4;
|
|
52
|
+
|
|
53
|
+
const rawUiScale = Math.min(scaleX, scaleY);
|
|
54
|
+
const uiScale = Phaser.Math.Clamp(rawUiScale, minScale, maxScale);
|
|
55
|
+
const vScale = scaleY;
|
|
56
|
+
|
|
57
|
+
const centerX = width * 0.5;
|
|
58
|
+
const centerY = height * 0.5;
|
|
59
|
+
|
|
60
|
+
const isLandscape = width > height;
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
camera,
|
|
64
|
+
width,
|
|
65
|
+
height,
|
|
66
|
+
scaleX,
|
|
67
|
+
scaleY,
|
|
68
|
+
uiScale,
|
|
69
|
+
vScale,
|
|
70
|
+
centerX,
|
|
71
|
+
centerY,
|
|
72
|
+
isLandscape,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// 图片资源
|
|
2
|
+
declare module "*.png" {
|
|
3
|
+
const src: string;
|
|
4
|
+
export default src;
|
|
5
|
+
}
|
|
6
|
+
declare module "*.webp" {
|
|
7
|
+
const src: string;
|
|
8
|
+
export default src;
|
|
9
|
+
}
|
|
10
|
+
declare module "*.jpg" {
|
|
11
|
+
const src: string;
|
|
12
|
+
export default src;
|
|
13
|
+
}
|
|
14
|
+
declare module "*.jpeg" {
|
|
15
|
+
const src: string;
|
|
16
|
+
export default src;
|
|
17
|
+
}
|
|
18
|
+
declare module "*.svg" {
|
|
19
|
+
const src: string;
|
|
20
|
+
export default src;
|
|
21
|
+
}
|
|
22
|
+
declare module "*.gif" {
|
|
23
|
+
const src: string;
|
|
24
|
+
export default src;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// 音频资源
|
|
28
|
+
declare module "*.mp3" {
|
|
29
|
+
const src: string;
|
|
30
|
+
export default src;
|
|
31
|
+
}
|
|
32
|
+
declare module "*.ogg" {
|
|
33
|
+
const src: string;
|
|
34
|
+
export default src;
|
|
35
|
+
}
|
|
36
|
+
declare module "*.wav" {
|
|
37
|
+
const src: string;
|
|
38
|
+
export default src;
|
|
39
|
+
}
|
|
40
|
+
declare module "*.m4a" {
|
|
41
|
+
const src: string;
|
|
42
|
+
export default src;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// JSON 数据(关卡数据、配置等)
|
|
46
|
+
declare module "*.json" {
|
|
47
|
+
const value: any;
|
|
48
|
+
export default value;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// 构建工具注入的全局变量
|
|
52
|
+
declare const __DEV__: boolean;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
*,
|
|
2
|
+
*::before,
|
|
3
|
+
*::after {
|
|
4
|
+
margin: 0;
|
|
5
|
+
padding: 0;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
-webkit-tap-highlight-color: transparent;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
html,
|
|
11
|
+
body {
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: 100%;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
background-color: #000;
|
|
16
|
+
|
|
17
|
+
/* 禁止移动端文字选中和长按菜单 */
|
|
18
|
+
-webkit-user-select: none;
|
|
19
|
+
user-select: none;
|
|
20
|
+
-webkit-touch-callout: none;
|
|
21
|
+
|
|
22
|
+
/* 禁止 iOS 橡皮筋回弹 */
|
|
23
|
+
overscroll-behavior: none;
|
|
24
|
+
touch-action: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#game-container {
|
|
28
|
+
width: 100%;
|
|
29
|
+
height: 100%;
|
|
30
|
+
|
|
31
|
+
/* 适配 iOS 安全区(刘海屏) */
|
|
32
|
+
padding-top: env(safe-area-inset-top);
|
|
33
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
34
|
+
padding-left: env(safe-area-inset-left);
|
|
35
|
+
padding-right: env(safe-area-inset-right);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
canvas {
|
|
39
|
+
display: block;
|
|
40
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
|
|
6
|
+
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
7
|
+
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
|
8
|
+
<meta name="format-detection" content="telephone=no" />
|
|
9
|
+
<title>Phaser Game</title>
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<div id="game-container"></div>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import Phaser from "phaser";
|
|
2
|
+
import { BootScene } from "./scenes/BootScene";
|
|
3
|
+
import { PreloaderScene } from "./scenes/PreloaderScene";
|
|
4
|
+
import { GameScene } from "./scenes/GameScene";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 创建并启动 Phaser 游戏实例。
|
|
8
|
+
*
|
|
9
|
+
* 设计分辨率 = viewport × 2(HiDPI 适配),Scale.FIT 自动铺满容器。
|
|
10
|
+
* 场景按 Boot → Preloader → Game 顺序启动。
|
|
11
|
+
*/
|
|
12
|
+
export const StartGame = (parent: string): Phaser.Game => {
|
|
13
|
+
const viewportWidth = window.innerWidth || 375;
|
|
14
|
+
const viewportHeight = window.innerHeight || 667;
|
|
15
|
+
|
|
16
|
+
const DESIGN_SCALE = 2;
|
|
17
|
+
const designWidth = Math.round(viewportWidth * DESIGN_SCALE);
|
|
18
|
+
const designHeight = Math.round(viewportHeight * DESIGN_SCALE);
|
|
19
|
+
|
|
20
|
+
const config: Phaser.Types.Core.GameConfig = {
|
|
21
|
+
type: Phaser.WEBGL,
|
|
22
|
+
parent,
|
|
23
|
+
width: designWidth,
|
|
24
|
+
height: designHeight,
|
|
25
|
+
backgroundColor: 0xffffff,
|
|
26
|
+
scene: [BootScene, PreloaderScene, GameScene],
|
|
27
|
+
scale: {
|
|
28
|
+
mode: Phaser.Scale.FIT,
|
|
29
|
+
autoCenter: Phaser.Scale.CENTER_BOTH,
|
|
30
|
+
},
|
|
31
|
+
input: {
|
|
32
|
+
activePointers: 2,
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const game = new Phaser.Game(config);
|
|
37
|
+
|
|
38
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
39
|
+
(window as any).__PHASER_GAME__ = game;
|
|
40
|
+
(window as any).PhaserRef = Phaser;
|
|
41
|
+
console.log("[Game] Started", {
|
|
42
|
+
viewport: { w: viewportWidth, h: viewportHeight, dpr: window.devicePixelRatio },
|
|
43
|
+
design: { w: designWidth, h: designHeight },
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return game;
|
|
48
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "./index.css";
|
|
2
|
+
import { StartGame } from "./game";
|
|
3
|
+
|
|
4
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
5
|
+
// Start the Phaser game immediately
|
|
6
|
+
StartGame("game-container");
|
|
7
|
+
|
|
8
|
+
// Reload on resize to recalculate design resolution
|
|
9
|
+
window.addEventListener("resize", () => {
|
|
10
|
+
window.location.reload();
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
if (__DEV__) {
|
|
15
|
+
console.log("Development mode");
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "playable-ad",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Playable Ad - Phaser 3",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "webpack serve --mode development",
|
|
7
|
+
"build": "webpack --mode production"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"phaser": "^3.90.0"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"typescript": "^5.3.0",
|
|
14
|
+
"webpack": "^5.90.0",
|
|
15
|
+
"webpack-cli": "^5.1.0",
|
|
16
|
+
"webpack-dev-server": "^5.0.0",
|
|
17
|
+
"ts-loader": "^9.5.0",
|
|
18
|
+
"html-webpack-plugin": "^5.6.0",
|
|
19
|
+
"css-loader": "^6.10.0",
|
|
20
|
+
"style-loader": "^3.3.0"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"outDir": "./dist",
|
|
4
|
+
"target": "es5",
|
|
5
|
+
"downlevelIteration": true,
|
|
6
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
7
|
+
"allowJs": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"allowSyntheticDefaultImports": true,
|
|
11
|
+
"strict": false,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"noFallthroughCasesInSwitch": true,
|
|
14
|
+
"strictPropertyInitialization": false,
|
|
15
|
+
"module": "esnext",
|
|
16
|
+
"moduleResolution": "bundler",
|
|
17
|
+
"sourceMap": true,
|
|
18
|
+
"resolveJsonModule": true,
|
|
19
|
+
"isolatedModules": true,
|
|
20
|
+
"paths": {
|
|
21
|
+
"assets/*": ["./assets/*"]
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"exclude": ["node_modules", "tests"]
|
|
25
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
3
|
+
const webpack = require('webpack');
|
|
4
|
+
|
|
5
|
+
module.exports = (env, argv) => {
|
|
6
|
+
const isDev = argv.mode === 'development';
|
|
7
|
+
|
|
8
|
+
return {
|
|
9
|
+
entry: './src/main.ts',
|
|
10
|
+
output: {
|
|
11
|
+
filename: 'bundle.js',
|
|
12
|
+
path: path.resolve(__dirname, 'dist'),
|
|
13
|
+
clean: true,
|
|
14
|
+
},
|
|
15
|
+
resolve: {
|
|
16
|
+
extensions: ['.ts', '.js'],
|
|
17
|
+
alias: {
|
|
18
|
+
assets: path.resolve(__dirname, 'assets'),
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
module: {
|
|
22
|
+
rules: [
|
|
23
|
+
{
|
|
24
|
+
test: /\.ts$/,
|
|
25
|
+
use: 'ts-loader',
|
|
26
|
+
exclude: /node_modules/,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
test: /\.css$/,
|
|
30
|
+
use: ['style-loader', 'css-loader'],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
test: /\.(mp3|ogg|wav|m4a)$/,
|
|
34
|
+
type: 'asset/resource',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
test: /\.(png|jpg|jpeg|webp|svg|gif)$/,
|
|
38
|
+
type: 'asset/resource',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
plugins: [
|
|
43
|
+
new HtmlWebpackPlugin({
|
|
44
|
+
template: './src/index.html',
|
|
45
|
+
}),
|
|
46
|
+
new webpack.DefinePlugin({
|
|
47
|
+
__DEV__: JSON.stringify(isDev),
|
|
48
|
+
}),
|
|
49
|
+
],
|
|
50
|
+
devServer: {
|
|
51
|
+
static: './dist',
|
|
52
|
+
hot: true,
|
|
53
|
+
open: true,
|
|
54
|
+
},
|
|
55
|
+
devtool: isDev ? 'source-map' : false,
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: phaser_scene_lifecycle.aicomponent
|
|
3
|
+
description: Phaser 双场景架构骨架。定义 Preloader → Game 的标准两场景生命周期,Preloader 负责资产预加载,完成后自动切换到 Game 主场景。
|
|
4
|
+
triggers: 需要设置 Phaser 项目的场景管理架构或场景切换流程时触发。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Phaser 双场景生命周期(Phaser Dual Scene Lifecycle)
|
|
8
|
+
|
|
9
|
+
## 说明
|
|
10
|
+
|
|
11
|
+
标准 Phaser 试玩广告双场景架构:
|
|
12
|
+
|
|
13
|
+
1. **Preloader 场景**:加载所有资产,显示加载 Loading UI,加载完成后调用 `sdk.start()` 并切换到 Game 场景
|
|
14
|
+
2. **Game 场景**:主游戏场景,持有所有游戏对象和逻辑
|
|
15
|
+
|
|
16
|
+
两个场景分别在 `preloader_scene.aicomponent` 和 `game_scene.aicomponent` 中实现。
|
|
17
|
+
|
|
18
|
+
## Scaffold
|
|
19
|
+
|
|
20
|
+
本 skill 为骨架层,不直接贡献文件——具体文件由 `preloader_scene` 和 `game_scene` 两个 skill 贡献。
|
|
21
|
+
|
|
22
|
+
`src/game/index.ts`(来自 `phaser.aicomponent`)中通过 `scene: [Preloader, Game]` 注册两个场景。
|
|
23
|
+
|
|
24
|
+
## Imports
|
|
25
|
+
|
|
26
|
+
- `phaser.aicomponent`(硬依赖)
|
|
27
|
+
|
|
28
|
+
## Skill Definition
|
|
29
|
+
|
|
30
|
+
```yaml
|
|
31
|
+
tools:
|
|
32
|
+
- read_file
|
|
33
|
+
- write_file
|
|
34
|
+
inputs: []
|
|
35
|
+
outputs:
|
|
36
|
+
- sceneArchitecture: Preloader → Game two-scene Phaser pattern
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Recipe
|
|
40
|
+
|
|
41
|
+
| 决策 | 原因 |
|
|
42
|
+
|------|------|
|
|
43
|
+
| **双场景而非单场景** | Preloader 独立负责资产加载,避免主游戏场景在资源就绪前尝试渲染;架构模式明确,可测试各自生命周期 |
|
|
44
|
+
| **架构文档 Skill(无代码产出)** | 场景架构是约定(谁先注册、谁负责切换),不是可复用的代码;文档 Skill 让 Agent 理解约束,具体实现由 preloader_scene 和 game_scene 两个 skill 贡献 |
|
|
45
|
+
| **Preloader 调用 sdk.start()** | 资产加载完成是广告 SDK 的 ready 信号;集中在 Preloader 处理,避免在主场景中竞态 |
|
|
46
|
+
|
|
47
|
+
## Adapter
|
|
48
|
+
|
|
49
|
+
- **Role**: `sceneArchitecture` — Phaser Preloader→Game 双场景架构规范(无代码产出)
|
|
50
|
+
- **Provides**: 场景注册约定、切换流程文档
|
|
51
|
+
- **Requires**: `phaser.aicomponent`(硬依赖:Phaser.Scene + SceneManager API)
|
|
52
|
+
- **Consumed by**: `preloader_scene.aicomponent`(按此约定实现 Preloader)、`game_scene.aicomponent`(按此约定实现 Game)
|
|
53
|
+
- **Integration point**: `src/game/index.ts` → `scene: [Preloader, Game]` 注册顺序由本架构约定决定
|
|
54
|
+
|
|
55
|
+
## 场景注册方式
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
// src/game/index.ts (来自 phaser.aicomponent)
|
|
59
|
+
scene: [Preloader, Game] // Phaser 按顺序启动:先 Preloader,再 Game
|
|
60
|
+
|
|
61
|
+
// Preloader.ts 加载完成后切换
|
|
62
|
+
this.scene.start('Game');
|
|
63
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"atomId": "phaser_scene_lifecycle.aicomponent",
|
|
4
|
+
"bundleType": "aicomponent",
|
|
5
|
+
"category": "scene",
|
|
6
|
+
"mode": "fixed",
|
|
7
|
+
"label": { "zh": "Phaser 双场景生命周期骨架", "en": "Phaser dual scene lifecycle skeleton" },
|
|
8
|
+
"tags": ["scene", "lifecycle", "preloader", "game-scene", "phaser", "skeleton"],
|
|
9
|
+
"bindingRoles": ["sceneLifecycle"],
|
|
10
|
+
"scaffold": {
|
|
11
|
+
"files": {},
|
|
12
|
+
"packageJson": {}
|
|
13
|
+
},
|
|
14
|
+
"imports": [
|
|
15
|
+
{ "slot": "engine", "pinAtomId": "phaser.aicomponent", "edgeKind": "requires", "bindAs": "engine" }
|
|
16
|
+
],
|
|
17
|
+
"exports": [
|
|
18
|
+
{ "name": "SceneKeys", "kind": "enum", "location": "src/game/SceneKeys.ts" }
|
|
19
|
+
],
|
|
20
|
+
"neutralDescriptor": {
|
|
21
|
+
"geometry": "two-scene Phaser architecture: Preloader scene handles asset loading then transitions to Game scene",
|
|
22
|
+
"layers": ["scene-routing", "asset-loading-gate", "scene-transition"],
|
|
23
|
+
"replaceable": ["scene list", "loading strategy"]
|
|
24
|
+
},
|
|
25
|
+
"usageHints": [
|
|
26
|
+
"Phaser 双场景标准模式:Preloader 负责资产加载 + 进度显示,完成后切换到 Game 主场景",
|
|
27
|
+
"src/game/index.ts(phaser.aicomponent)中配置 scene: [Preloader, Game]",
|
|
28
|
+
"SceneKeys 枚举统一管理场景名,避免字符串硬编码"
|
|
29
|
+
],
|
|
30
|
+
"files": {
|
|
31
|
+
"skill": "SKILL.md"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pick_and_match_rules.aigameplay
|
|
3
|
+
description: 拾取三消玩法核心规则(PGS)。棋盘上有多种带颜色和形状的物品(可多层堆叠),玩家逐个点选物品放入底部篮子,篮子中凑齐 3 个颜色和形状都相同的物品即自动消除。在倒计时结束前清空棋盘所有物品即胜利;篮子满溢或超时则失败。
|
|
4
|
+
triggers: 需要生成拾取三消、pick and match、triple sort、篮子消除、三消放篮子、tile match 类玩法的 PGS schema、关卡规则时触发。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 拾取三消玩法(Pick & Match)
|
|
8
|
+
|
|
9
|
+
## 玩法说明
|
|
10
|
+
|
|
11
|
+
棋盘上有若干物品,每个物品有**颜色**和**形状**两个维度属性。物品可以多层堆叠(上层遮挡下层)。
|
|
12
|
+
|
|
13
|
+
玩家每次从棋盘上点选一个**未被遮挡**的物品,物品飞入底部的**篮子(tray)**。篮子中的物品按同类聚合排列:
|
|
14
|
+
|
|
15
|
+
- **匹配消除**:篮子中出现 3 个颜色和形状都相同的物品 → 自动消除这 3 个物品 → 篮子腾出空间
|
|
16
|
+
- **篮子满溢**:篮子达到容量上限(默认 7 格)且无法消除 → 游戏失败
|
|
17
|
+
- **胜利**:棋盘上所有物品都被拾取并消除
|
|
18
|
+
- **失败**:篮子满溢 或 倒计时归零(仅当 `levelTime > 0`)
|
|
19
|
+
|
|
20
|
+
## Recipe
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"kind": "pgs",
|
|
25
|
+
"pgsVersion": "1.0",
|
|
26
|
+
"gameplayType": "pick_and_match",
|
|
27
|
+
"rules": {
|
|
28
|
+
"matchCount": 3,
|
|
29
|
+
"trayCapacity": 7,
|
|
30
|
+
"layerStacking": true,
|
|
31
|
+
"groupingInsert": true,
|
|
32
|
+
"timerOptional": true
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
完整 PGS Schema 见 `ref/pgs-schema.json`。
|
|
38
|
+
|
|
39
|
+
## Result
|
|
40
|
+
|
|
41
|
+
产物为 `ref/pgs-schema.json`,描述完整的拾取三消玩法规则,包含:
|
|
42
|
+
|
|
43
|
+
- 实体定义(board / item / tray / timer)
|
|
44
|
+
- 规则(可拾取判定 / 同类聚合插入 / 匹配检测 / 篮子溢出 / 输入锁)
|
|
45
|
+
- 关卡数据 schema(ItemDef 格式,含层级)
|
|
46
|
+
- 算法步骤(9 步主循环)
|
|
47
|
+
- 胜负条件
|
|
48
|
+
- 6 个测试用例(均满足 ≥9 物品最低约束)
|
|
49
|
+
|
|
50
|
+
## 核心机制详解
|
|
51
|
+
|
|
52
|
+
### 1. 物品属性
|
|
53
|
+
|
|
54
|
+
每个物品有两个匹配维度:
|
|
55
|
+
- **颜色**(color):red / blue / green / yellow / purple / pink 等
|
|
56
|
+
- **形状**(shape):circle / square / triangle / star / diamond / heart 等
|
|
57
|
+
|
|
58
|
+
**只有颜色和形状都相同的 3 个物品才会消除。**
|
|
59
|
+
|
|
60
|
+
### 2. 多层堆叠
|
|
61
|
+
|
|
62
|
+
物品可以叠放在其他物品上方。被上层物品遮挡的物品不可点击,需先拾取上层物品。这为关卡设计提供了策略深度。
|
|
63
|
+
|
|
64
|
+
### 3. 同类聚合插入
|
|
65
|
+
|
|
66
|
+
新物品放入篮子时,如果篮子中已有同类物品(颜色+形状相同),新物品自动插入到最后一个同类物品旁边,而非简单追加到末尾。这使得玩家更容易看到即将凑齐的组合。
|
|
67
|
+
|
|
68
|
+
### 4. 关卡设计约束
|
|
69
|
+
|
|
70
|
+
- 每种 (color, shape) 组合的物品数量**必须恰好为 3 个**
|
|
71
|
+
- 棋盘物品总数**至少 9 个**(即至少 3 组不同组合 × 3),少于 9 个游戏过于简单无可玩性
|
|
72
|
+
- 至少 **3 种**不同的 (color, shape) 组合,否则策略性不足
|
|
73
|
+
|
|
74
|
+
## Binding
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"role": "gameplayRule",
|
|
79
|
+
"target": "src/game/",
|
|
80
|
+
"type": "gameplay-module-reference",
|
|
81
|
+
"constraints": {
|
|
82
|
+
"requiredComponents": [
|
|
83
|
+
"pick_match_tray.aicomponent",
|
|
84
|
+
"pick_match_board_renderer.aicomponent",
|
|
85
|
+
"pick_match_input_handler.aicomponent",
|
|
86
|
+
"level_lifecycle.aicomponent"
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Skill Definition
|
|
93
|
+
|
|
94
|
+
```yaml
|
|
95
|
+
tools:
|
|
96
|
+
- read_file
|
|
97
|
+
- write_file
|
|
98
|
+
inputs:
|
|
99
|
+
- pgsSchema: ref/pgs-schema.json
|
|
100
|
+
outputs:
|
|
101
|
+
- reducerTemplate: game logic reducer based on PGS schema
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## 与其他玩法的区别
|
|
105
|
+
|
|
106
|
+
| 维度 | 经典三消 (match3) | 路径消除 (path_elimination) | 拾取三消 (pick_and_match) |
|
|
107
|
+
|-----|------------------|---------------------------|--------------------------|
|
|
108
|
+
| 棋盘模型 | 固定网格,元素填满 | 动态网格,折线路径 | 动态网格,多层堆叠物品 |
|
|
109
|
+
| 输入方式 | 交换相邻两个元素 | 点击路径箭头头部 | 点击物品拾取放入篮子 |
|
|
110
|
+
| 匹配方式 | 3+ 同色连成线 | 方向出口空闲即消除 | 篮子中 3 个同色同形消除 |
|
|
111
|
+
| 匹配维度 | 单维度(颜色/类型) | 无匹配(出口检测) | 双维度(颜色 × 形状) |
|
|
112
|
+
| 失败条件 | 步数耗尽 | 生命归零 / 超时 | 篮子满溢 / 超时 |
|
|
113
|
+
| 策略要素 | 连消 / 特殊块 | 消除顺序 / 路径阻挡 | 堆叠层级 / 篮子管理 |
|