├── .gitignore ├── README.md ├── assets ├── resources.meta ├── resources │ ├── prefabs.meta │ ├── prefabs │ │ ├── dialog_archive.prefab │ │ ├── dialog_archive.prefab.meta │ │ ├── dialog_item.prefab │ │ ├── dialog_item.prefab.meta │ │ ├── dialog_pause.prefab │ │ ├── dialog_pause.prefab.meta │ │ ├── dialog_revive.prefab │ │ ├── dialog_revive.prefab.meta │ │ ├── dialog_settle.prefab │ │ ├── dialog_settle.prefab.meta │ │ ├── game_haul.prefab │ │ ├── game_haul.prefab.meta │ │ ├── game_russia.prefab │ │ ├── game_russia.prefab.meta │ │ ├── game_star.prefab │ │ ├── game_star.prefab.meta │ │ ├── game_star_item.prefab │ │ ├── game_star_item.prefab.meta │ │ ├── game_union.prefab │ │ ├── game_union.prefab.meta │ │ ├── main.prefab │ │ ├── main.prefab.meta │ │ ├── rank.prefab │ │ └── rank.prefab.meta │ ├── sounds.meta │ ├── sounds │ │ ├── bgm.mp3 │ │ ├── bgm.mp3.meta │ │ ├── click.mp3 │ │ ├── click.mp3.meta │ │ ├── die.mp3 │ │ ├── die.mp3.meta │ │ ├── star_award_erase.mp3 │ │ ├── star_award_erase.mp3.meta │ │ ├── star_erase.mp3 │ │ ├── star_erase.mp3.meta │ │ ├── star_fadein.mp3 │ │ ├── star_fadein.mp3.meta │ │ ├── star_like_1.mp3 │ │ ├── star_like_1.mp3.meta │ │ ├── star_like_2.mp3 │ │ ├── star_like_2.mp3.meta │ │ ├── star_like_3.mp3 │ │ ├── star_like_3.mp3.meta │ │ ├── star_multi.mp3 │ │ ├── star_multi.mp3.meta │ │ ├── star_via.mp3 │ │ └── star_via.mp3.meta │ ├── textures.meta │ └── textures │ │ ├── game.meta │ │ ├── game │ │ ├── game.plist │ │ ├── game.plist.meta │ │ ├── game.png │ │ └── game.png.meta │ │ ├── unity.meta │ │ └── unity │ │ ├── unity.plist │ │ ├── unity.plist.meta │ │ ├── unity.png │ │ ├── unity.png.meta │ │ ├── unity_bg_1.jpg │ │ ├── unity_bg_1.jpg.meta │ │ ├── unity_bg_2.jpg │ │ └── unity_bg_2.jpg.meta ├── scenes.meta ├── scenes │ ├── main.fire │ └── main.fire.meta ├── scripts.meta └── scripts │ ├── components.meta │ ├── components │ ├── ComponentInit.js │ ├── ComponentInit.js.meta │ ├── event.meta │ ├── event │ │ ├── EventDispatcher.js │ │ └── EventDispatcher.js.meta │ ├── music.meta │ ├── music │ │ ├── MusicPlayer.js │ │ └── MusicPlayer.js.meta │ ├── mvc.meta │ ├── mvc │ │ ├── Controller.js │ │ ├── Controller.js.meta │ │ ├── Dialog.js │ │ ├── Dialog.js.meta │ │ ├── Model.js │ │ ├── Model.js.meta │ │ ├── View.js │ │ └── View.js.meta │ ├── storage.meta │ └── storage │ │ ├── LocalStorage.js │ │ └── LocalStorage.js.meta │ ├── configs.meta │ ├── configs │ ├── ConfigInit.js │ ├── ConfigInit.js.meta │ ├── EventKey.js │ ├── EventKey.js.meta │ ├── GameConfig.js │ ├── GameConfig.js.meta │ ├── GameConstant.js │ ├── GameConstant.js.meta │ ├── GameText.js │ ├── GameText.js.meta │ ├── ReportKey.js │ ├── ReportKey.js.meta │ ├── StorageKey.js │ ├── StorageKey.js.meta │ ├── game.meta │ ├── game │ │ ├── DigitConfig.js │ │ ├── DigitConfig.js.meta │ │ ├── RussiaConfig.js │ │ ├── RussiaConfig.js.meta │ │ ├── StarConfig.js │ │ ├── StarConfig.js.meta │ │ ├── UnionConfig.js │ │ └── UnionConfig.js.meta │ ├── res.meta │ └── res │ │ ├── GameRes.js │ │ ├── GameRes.js.meta │ │ ├── GameResBase64.js │ │ ├── GameResBase64.js.meta │ │ ├── GameResClassify.js │ │ ├── GameResClassify.js.meta │ │ ├── GameTexture.js │ │ └── GameTexture.js.meta │ ├── launcher.js │ ├── launcher.js.meta │ ├── managers.meta │ ├── managers │ ├── DialogManager.js │ ├── DialogManager.js.meta │ ├── ModuleManager.js │ ├── ModuleManager.js.meta │ ├── ResourceManager.js │ └── ResourceManager.js.meta │ ├── models.meta │ ├── models │ ├── ConfigModel.js │ ├── ConfigModel.js.meta │ ├── ItemModel.js │ ├── ItemModel.js.meta │ ├── ModelInit.js │ ├── ModelInit.js.meta │ ├── UserModel.js │ ├── UserModel.js.meta │ ├── game.meta │ └── game │ │ ├── RussiaGameModel.js │ │ ├── RussiaGameModel.js.meta │ │ ├── StarGameModel.js │ │ ├── StarGameModel.js.meta │ │ ├── UnionGameModel.js │ │ └── UnionGameModel.js.meta │ ├── modules.meta │ ├── modules │ ├── game.meta │ ├── game │ │ ├── AbstractGameController.js │ │ ├── AbstractGameController.js.meta │ │ ├── AbstractGameView.js │ │ ├── AbstractGameView.js.meta │ │ ├── components.meta │ │ ├── components │ │ │ ├── Cube.js │ │ │ ├── Cube.js.meta │ │ │ ├── CubePool.js │ │ │ ├── CubePool.js.meta │ │ │ ├── LikePool.js │ │ │ └── LikePool.js.meta │ │ ├── digit.meta │ │ ├── digit │ │ │ ├── DigitGameController.js │ │ │ ├── DigitGameController.js.meta │ │ │ ├── DigitGameView.js │ │ │ └── DigitGameView.js.meta │ │ ├── haul.meta │ │ ├── haul │ │ │ ├── HaulGameController.js │ │ │ ├── HaulGameController.js.meta │ │ │ ├── HaulGameView.js │ │ │ └── HaulGameView.js.meta │ │ ├── pop.meta │ │ ├── pop │ │ │ ├── PopGameController.js │ │ │ ├── PopGameController.js.meta │ │ │ ├── PopGameView.js │ │ │ └── PopGameView.js.meta │ │ ├── russia.meta │ │ ├── russia │ │ │ ├── RussiaGameController.js │ │ │ ├── RussiaGameController.js.meta │ │ │ ├── RussiaGameView.js │ │ │ ├── RussiaGameView.js.meta │ │ │ ├── RussiaPool.js │ │ │ └── RussiaPool.js.meta │ │ ├── star.meta │ │ ├── star │ │ │ ├── StarGameController.js │ │ │ ├── StarGameController.js.meta │ │ │ ├── StarGameView.js │ │ │ ├── StarGameView.js.meta │ │ │ ├── StarItemView.js │ │ │ ├── StarItemView.js.meta │ │ │ ├── StarPool.js │ │ │ └── StarPool.js.meta │ │ ├── union.meta │ │ └── union │ │ │ ├── UnionGameController.js │ │ │ ├── UnionGameController.js.meta │ │ │ ├── UnionGameView.js │ │ │ ├── UnionGameView.js.meta │ │ │ ├── UnionItemView.js │ │ │ ├── UnionItemView.js.meta │ │ │ ├── UnionPool.js │ │ │ └── UnionPool.js.meta │ ├── global.meta │ ├── global │ │ ├── GlobalController.js │ │ ├── GlobalController.js.meta │ │ ├── GlobalView.js │ │ ├── GlobalView.js.meta │ │ ├── subviews.meta │ │ └── subviews │ │ │ ├── Toast.js │ │ │ └── Toast.js.meta │ ├── item.meta │ ├── item │ │ ├── ItemController.js │ │ ├── ItemController.js.meta │ │ ├── ItemView.js │ │ └── ItemView.js.meta │ ├── loading.meta │ ├── loading │ │ ├── LoadingController.js │ │ ├── LoadingController.js.meta │ │ ├── LoadingView.js │ │ └── LoadingView.js.meta │ ├── login.meta │ ├── login │ │ ├── LoginController.js │ │ ├── LoginController.js.meta │ │ ├── LoginView.js │ │ └── LoginView.js.meta │ ├── main.meta │ ├── main │ │ ├── MainController.js │ │ ├── MainController.js.meta │ │ ├── MainView.js │ │ ├── MainView.js.meta │ │ ├── subviews.meta │ │ └── subviews │ │ │ ├── ArchiveView.js │ │ │ └── ArchiveView.js.meta │ ├── rank.meta │ ├── rank │ │ ├── RankController.js │ │ ├── RankController.js.meta │ │ ├── RankView.js │ │ └── RankView.js.meta │ ├── revive.meta │ ├── revive │ │ ├── ReviveController.js │ │ ├── ReviveController.js.meta │ │ ├── ReviveView.js │ │ └── ReviveView.js.meta │ ├── setting.meta │ ├── setting │ │ ├── PauseView.js │ │ ├── PauseView.js.meta │ │ ├── SettingController.js │ │ └── SettingController.js.meta │ ├── settle.meta │ ├── settle │ │ ├── SettleController.js │ │ ├── SettleController.js.meta │ │ ├── SettleView.js │ │ └── SettleView.js.meta │ ├── toast.meta │ └── toast │ │ ├── ToastController.js │ │ ├── ToastController.js.meta │ │ ├── ToastView.js │ │ └── ToastView.js.meta │ ├── platforms.meta │ ├── platforms │ ├── BasicPlatform.js │ ├── BasicPlatform.js.meta │ ├── WeChatPlatform.js │ └── WeChatPlatform.js.meta │ ├── utils.meta │ ├── utils │ ├── Functions.js │ ├── Functions.js.meta │ ├── Utils.js │ ├── Utils.js.meta │ ├── UtilsInit.js │ └── UtilsInit.js.meta │ ├── widgets.meta │ └── widgets │ ├── CubeSnowAnimation.js │ ├── CubeSnowAnimation.js.meta │ ├── Item.js │ ├── Item.js.meta │ ├── TouchHaloAnimation.js │ └── TouchHaloAnimation.js.meta ├── build-templates └── wechatgame │ ├── images │ ├── common_share_img.jpg │ ├── img_pure.png │ ├── img_rank_item_bg.png │ ├── revive_share_img.jpg │ └── settle_share_img.jpg │ └── src │ └── opendatacontext │ ├── config.js │ ├── index.js │ ├── model.js │ ├── util.js │ └── view.js ├── creator.d.ts ├── jsconfig.json ├── project.json ├── resources └── textures │ ├── game │ ├── game.tps │ └── resources │ │ ├── game_bottom_mask.png │ │ ├── game_cube_fillet.png │ │ ├── game_cube_square.png │ │ ├── game_img_halo.png │ │ ├── game_item_bg.png │ │ ├── game_item_bomb.png │ │ ├── game_item_circle.png │ │ ├── game_item_dye.png │ │ ├── game_item_mix.png │ │ ├── game_star_blue.png │ │ ├── game_star_green.png │ │ ├── game_star_orange.png │ │ ├── game_star_red.png │ │ ├── game_star_select.png │ │ └── game_star_yellow.png │ └── unity │ ├── resources │ ├── unity_circle_bg.png │ ├── unity_close.png │ ├── unity_game_club.png │ ├── unity_more.png │ ├── unity_pause.png │ ├── unity_rank.png │ ├── unity_return.png │ ├── unity_service.png │ ├── unity_share.png │ ├── unity_sound_off.png │ └── unity_sound_on.png │ └── unity.tps └── settings ├── builder.json ├── builder.panel.json ├── project.json └── services.json /.gitignore: -------------------------------------------------------------------------------- 1 | #///////////////////////////////////////////////////////////////////////////// 2 | # Fireball Projects 3 | #///////////////////////////////////////////////////////////////////////////// 4 | 5 | /library/ 6 | temp/ 7 | local/ 8 | build/ 9 | 10 | #///////////////////////////////////////////////////////////////////////////// 11 | # Logs and databases 12 | #///////////////////////////////////////////////////////////////////////////// 13 | 14 | *.log 15 | *.sql 16 | *.sqlite 17 | 18 | #///////////////////////////////////////////////////////////////////////////// 19 | # files for debugger 20 | #///////////////////////////////////////////////////////////////////////////// 21 | 22 | *.sln 23 | *.csproj 24 | *.pidb 25 | *.unityproj 26 | *.suo 27 | 28 | #///////////////////////////////////////////////////////////////////////////// 29 | # OS generated files 30 | #///////////////////////////////////////////////////////////////////////////// 31 | 32 | .DS_Store 33 | ehthumbs.db 34 | Thumbs.db 35 | 36 | #///////////////////////////////////////////////////////////////////////////// 37 | # exvim files 38 | #///////////////////////////////////////////////////////////////////////////// 39 | 40 | *UnityVS.meta 41 | *.err 42 | *.err.meta 43 | *.exvim 44 | *.exvim.meta 45 | *.vimentry 46 | *.vimentry.meta 47 | *.vimproject 48 | *.vimproject.meta 49 | .vimfiles.*/ 50 | .exvim.*/ 51 | quick_gen_project_*_autogen.bat 52 | quick_gen_project_*_autogen.bat.meta 53 | quick_gen_project_*_autogen.sh 54 | quick_gen_project_*_autogen.sh.meta 55 | .exvim.app 56 | 57 | #///////////////////////////////////////////////////////////////////////////// 58 | # webstorm files 59 | #///////////////////////////////////////////////////////////////////////////// 60 | 61 | .idea/ 62 | 63 | #////////////////////////// 64 | # VS Code 65 | #////////////////////////// 66 | 67 | .vscode/ 68 | 69 | .pyc -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ya-framework-creator 2 | YAFramework一个基于CocosCreator的游戏框架,里面集合了几个方块游戏。 3 | 4 | # 目录结构说明 5 | ``` 6 | assets 项目资源和代码 7 | resources 资源目录 8 | | prefabs 用于存放prefab 9 | | sounds 用于存放音效、bgm 10 | | textures 用于存放游戏 11 | | | game 游戏资源 12 | | | unity 通用资源 13 | scenes 场景文件 14 | scripts 脚本 15 | | components 通用的组件 16 | | | event 事件派发类 17 | | | music 音效播放类 18 | | | mvc mvc框架 19 | | | storage 本地存储 20 | | configs 游戏配置 21 | | managers 各种管理类 22 | | models model数据 23 | | modules 模块 24 | | platforms 平台接口 25 | | utils 通用的帮助类 26 | | widgets 27 | launcher 游戏启动入口脚本 28 | ``` 29 | 30 | # 项目框架说明 31 | YAFramework是一个简单的MVC框架,采用单一游戏场景,所以只会存在一个场景文件,假如是main.fire,在场景中一开始只会创建3个节点,也是3个层级:layerView、layerDialog、layerTop,游戏中所有的物件都应该它们的子节点。 32 | 游戏入口脚本是launcher.js,负责各种管理类、配置脚本、通用组件等的初始化工作。 33 | 34 | ## MVC框架 35 | M数据缓存,V视图展示,C交互控制 36 | M的基类是Model 37 | V的基类是View、Dialog 38 | C的基类是Controller 39 | ### Model 40 | 所有模块的M都应该继承此类,用于数据的解析、缓存。 41 | ### View 42 | 如果视图是全屏类型或者说可以当成场景来看,那么就需要继承View,此视图基类只定义了最基本的初始化流程。 43 | ### Dialog 44 | 如果视图是弹窗类型或者可以理解成弹窗,那么就需要继承此类Dialog,所有此类的子类都应该受到DialogManager的管理,其生命周期(创建、关闭)也应该受到DialogManager的监管。 45 | Dialog基类定义并实现了大量通用的方法,降低了弹窗类型的视图操作复杂度,和使用上的麻烦。 46 | ### Controller 47 | 所有模块的C都应该继承此类。 48 | 如果模块只是弹窗类型,其中有用的方法只有initGlobalEvent。 49 | 50 | ## 模块管理器ModuleManager 51 | 所有的Controller都会在此管理器中被引用,并被初始化。 52 | 它控制全屏视图模块或场景的生命周期(创建、关闭)。 53 | 54 | ## 弹窗管理器DialogManager 55 | 56 | ## 资源管理器ResourceManager 57 | -------------------------------------------------------------------------------- /assets/resources.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "6c702f88-fc19-461d-ac85-0703fe84e925", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/resources/prefabs.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "5bc63969-102e-488a-a4db-23e38cd69406", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/resources/prefabs/dialog_archive.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "65c1694d-7182-4e4a-b193-1be31a5d20a4", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "readonly": false, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/resources/prefabs/dialog_item.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "e8756614-f8a5-415e-8b9a-aa0e0979135a", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "readonly": false, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/resources/prefabs/dialog_pause.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "a0acb245-3197-42fe-a006-3b52f5412beb", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "readonly": false, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/resources/prefabs/dialog_revive.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "22c9ebba-e33a-4809-940c-cb5f10f3e8de", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "readonly": false, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/resources/prefabs/dialog_settle.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "6a1dd320-c2ec-43dd-aa67-361ca978fd08", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "readonly": false, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/resources/prefabs/game_haul.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "55c7835b-9563-4009-be7c-d467d600aa98", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "readonly": false, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/resources/prefabs/game_russia.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "4fc0f93b-dbca-4759-8713-0c853a3784a0", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "readonly": false, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/resources/prefabs/game_star.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "0d72d6e4-be3b-4112-b0c9-8d2296df59d7", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "readonly": false, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/resources/prefabs/game_star_item.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "73b98dfc-f8c0-4b21-a9ca-ad197f36d368", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "readonly": false, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/resources/prefabs/game_union.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "9aec37df-b36c-47c0-8ed0-d956911311c0", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "readonly": false, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/resources/prefabs/main.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "bf5290cb-5fbf-4417-af9b-7898ce28ad02", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "readonly": false, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/resources/prefabs/rank.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "2321566c-3e9a-49c3-96eb-ea579b24a3b0", 4 | "optimizationPolicy": "AUTO", 5 | "asyncLoadAssets": false, 6 | "readonly": false, 7 | "subMetas": {} 8 | } -------------------------------------------------------------------------------- /assets/resources/sounds.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "c05b3c52-53c4-48b3-a872-df783080eb93", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/resources/sounds/bgm.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/assets/resources/sounds/bgm.mp3 -------------------------------------------------------------------------------- /assets/resources/sounds/bgm.mp3.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.0.0", 3 | "uuid": "ed0ed015-e849-4c85-8edd-21680ff48a88", 4 | "downloadMode": 0, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/sounds/click.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/assets/resources/sounds/click.mp3 -------------------------------------------------------------------------------- /assets/resources/sounds/click.mp3.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.0.0", 3 | "uuid": "dccc8c7c-8570-4cf5-89cd-6bc53b1bbe7d", 4 | "downloadMode": 0, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/sounds/die.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/assets/resources/sounds/die.mp3 -------------------------------------------------------------------------------- /assets/resources/sounds/die.mp3.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.0.0", 3 | "uuid": "9bef6cee-2df5-4e1b-889e-eae6a69aab7d", 4 | "downloadMode": 0, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/sounds/star_award_erase.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/assets/resources/sounds/star_award_erase.mp3 -------------------------------------------------------------------------------- /assets/resources/sounds/star_award_erase.mp3.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.0.0", 3 | "uuid": "6fc56971-d320-4f46-b41b-795be971da4e", 4 | "downloadMode": 0, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/sounds/star_erase.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/assets/resources/sounds/star_erase.mp3 -------------------------------------------------------------------------------- /assets/resources/sounds/star_erase.mp3.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.0.0", 3 | "uuid": "66436f6b-0ca0-4ba2-8833-25a8f9263375", 4 | "downloadMode": 0, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/sounds/star_fadein.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/assets/resources/sounds/star_fadein.mp3 -------------------------------------------------------------------------------- /assets/resources/sounds/star_fadein.mp3.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.0.0", 3 | "uuid": "0a39fd19-cba8-47b4-a81b-6ed9a9ff5060", 4 | "downloadMode": 0, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/sounds/star_like_1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/assets/resources/sounds/star_like_1.mp3 -------------------------------------------------------------------------------- /assets/resources/sounds/star_like_1.mp3.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.0.0", 3 | "uuid": "9223990a-7889-484e-94f0-b05895ec82a1", 4 | "downloadMode": 0, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/sounds/star_like_2.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/assets/resources/sounds/star_like_2.mp3 -------------------------------------------------------------------------------- /assets/resources/sounds/star_like_2.mp3.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.0.0", 3 | "uuid": "f9de11d5-d2b5-4f13-8071-731a1c32997b", 4 | "downloadMode": 0, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/sounds/star_like_3.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/assets/resources/sounds/star_like_3.mp3 -------------------------------------------------------------------------------- /assets/resources/sounds/star_like_3.mp3.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.0.0", 3 | "uuid": "7e5f0eea-179a-464c-8727-3ecbc112e335", 4 | "downloadMode": 0, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/sounds/star_multi.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/assets/resources/sounds/star_multi.mp3 -------------------------------------------------------------------------------- /assets/resources/sounds/star_multi.mp3.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.0.0", 3 | "uuid": "63662cc3-394b-492c-b728-20879d2fca3a", 4 | "downloadMode": 0, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/sounds/star_via.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/assets/resources/sounds/star_via.mp3 -------------------------------------------------------------------------------- /assets/resources/sounds/star_via.mp3.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.0.0", 3 | "uuid": "77a374a4-a341-4006-87f2-9c451bec53be", 4 | "downloadMode": 0, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /assets/resources/textures.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "99ac9481-1ffc-46bc-a6ee-ae314c8c539f", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/resources/textures/game.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "3169947f-794c-4d08-b59e-e9fdbf2d8e6f", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/resources/textures/game/game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/assets/resources/textures/game/game.png -------------------------------------------------------------------------------- /assets/resources/textures/game/game.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "dd0c54f3-4c48-4fa2-86b3-3ff280f69acf", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 816, 11 | "height": 126, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "game": { 15 | "ver": "1.0.4", 16 | "uuid": "68211c18-6af5-426b-8dfd-ba011b410da4", 17 | "rawTextureUuid": "dd0c54f3-4c48-4fa2-86b3-3ff280f69acf", 18 | "trimType": "auto", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": 0, 22 | "offsetY": 0, 23 | "trimX": 2, 24 | "trimY": 2, 25 | "width": 812, 26 | "height": 122, 27 | "rawWidth": 816, 28 | "rawHeight": 126, 29 | "borderTop": 0, 30 | "borderBottom": 0, 31 | "borderLeft": 0, 32 | "borderRight": 0, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/resources/textures/unity.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "d9a4c764-efb7-4fec-9f97-c4fd76c1115b", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/resources/textures/unity/unity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/assets/resources/textures/unity/unity.png -------------------------------------------------------------------------------- /assets/resources/textures/unity/unity.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "086bc855-202f-4d77-9182-ff0d4d7bcbfb", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 94, 11 | "height": 778, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "unity": { 15 | "ver": "1.0.4", 16 | "uuid": "17d3a612-c34f-4500-93d2-0302de50177d", 17 | "rawTextureUuid": "086bc855-202f-4d77-9182-ff0d4d7bcbfb", 18 | "trimType": "custom", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": 0, 22 | "offsetY": 341, 23 | "trimX": 0, 24 | "trimY": 0, 25 | "width": 94, 26 | "height": 96, 27 | "rawWidth": 94, 28 | "rawHeight": 778, 29 | "borderTop": 0, 30 | "borderBottom": 0, 31 | "borderLeft": 0, 32 | "borderRight": 0, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/resources/textures/unity/unity_bg_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/assets/resources/textures/unity/unity_bg_1.jpg -------------------------------------------------------------------------------- /assets/resources/textures/unity/unity_bg_1.jpg.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "0ec3f493-3943-4df9-b8ef-ce1dc42a5ec9", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 375, 11 | "height": 812, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "unity_bg_1": { 15 | "ver": "1.0.4", 16 | "uuid": "72855092-13f7-4773-8ad8-685bfce15b66", 17 | "rawTextureUuid": "0ec3f493-3943-4df9-b8ef-ce1dc42a5ec9", 18 | "trimType": "custom", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": 0, 22 | "offsetY": 0, 23 | "trimX": 0, 24 | "trimY": 0, 25 | "width": 375, 26 | "height": 812, 27 | "rawWidth": 375, 28 | "rawHeight": 812, 29 | "borderTop": 0, 30 | "borderBottom": 0, 31 | "borderLeft": 0, 32 | "borderRight": 0, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/resources/textures/unity/unity_bg_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/assets/resources/textures/unity/unity_bg_2.jpg -------------------------------------------------------------------------------- /assets/resources/textures/unity/unity_bg_2.jpg.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.3.4", 3 | "uuid": "b9620d8e-c3b7-44a2-821b-32f6ca3ffdb1", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "genMipmaps": false, 9 | "packable": true, 10 | "width": 721, 11 | "height": 1561, 12 | "platformSettings": {}, 13 | "subMetas": { 14 | "unity_bg_2": { 15 | "ver": "1.0.4", 16 | "uuid": "31e8a84f-f79c-4bf7-a826-4a7753fc797c", 17 | "rawTextureUuid": "b9620d8e-c3b7-44a2-821b-32f6ca3ffdb1", 18 | "trimType": "custom", 19 | "trimThreshold": 1, 20 | "rotated": false, 21 | "offsetX": 0, 22 | "offsetY": 0, 23 | "trimX": 0, 24 | "trimY": 0, 25 | "width": 721, 26 | "height": 1561, 27 | "rawWidth": 721, 28 | "rawHeight": 1561, 29 | "borderTop": 0, 30 | "borderBottom": 0, 31 | "borderLeft": 0, 32 | "borderRight": 0, 33 | "subMetas": {} 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /assets/scenes.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "a53b3c0d-211a-47ae-9ba3-4126ced6947d", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scenes/main.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.6", 3 | "uuid": "2d2f792f-a40c-49bb-a189-ed176a246e49", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "ef17c7c8-5087-40b4-9c50-cbc7fb156154", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/components.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "27fbe386-0d87-4d0d-96fd-8a6f9b860746", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/components/ComponentInit.js: -------------------------------------------------------------------------------- 1 | 2 | let EventDispatcher = require("./event/EventDispatcher"); 3 | 4 | let MusicPlayer = require("./music/MusicPlayer"); 5 | 6 | let LocalStorage = require("./storage/LocalStorage"); 7 | 8 | cc.Class({ 9 | 10 | statics: { 11 | init(ya) { 12 | ya.event = new EventDispatcher(); 13 | 14 | ya.storage = new LocalStorage(); 15 | 16 | ya.music = new MusicPlayer(); 17 | } 18 | } 19 | 20 | }); -------------------------------------------------------------------------------- /assets/scripts/components/ComponentInit.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "616a1b54-ddb6-4229-983a-e6a7269f5760", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/components/event.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "d573d175-cfe3-4a96-bd42-c0485be723f7", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/components/event/EventDispatcher.js: -------------------------------------------------------------------------------- 1 | /* 2 | 事件派发器 3 | 支持一对多的事件派发 4 | */ 5 | 6 | cc.Class({ 7 | properties: { 8 | _dispatcher: { default: null, type: cc.EventTarget } 9 | }, 10 | 11 | ctor() { 12 | this._dispatcher = new cc.EventTarget(); 13 | }, 14 | 15 | on(name, callback, target) { 16 | target = target || this; 17 | this._dispatcher.on(name, callback, target); 18 | }, 19 | emit(name, params) { 20 | this._dispatcher.emit(name, params); 21 | }, 22 | off(name, callback, target) { 23 | target = target || this; 24 | this._dispatcher.off(name, callback, target); 25 | }, 26 | targetOff(target) { 27 | target = target || this; 28 | this._dispatcher.targetOff(target); 29 | }, 30 | 31 | addEvent(name, callback, target) { 32 | target = target || this; 33 | this.on(name, callback, target); 34 | }, 35 | 36 | dispatchEvent(name, params) { 37 | this.emit(name, params); 38 | }, 39 | 40 | removeEvent(name, callback, target) { 41 | this.off(name, callback, target); 42 | }, 43 | 44 | removeTargetEvent(target) { 45 | this.targetOff(target); 46 | } 47 | }); -------------------------------------------------------------------------------- /assets/scripts/components/event/EventDispatcher.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "d64253c8-765b-48bd-aaa2-870a2cb23f6e", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/components/music.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "93c57e4f-7647-43ad-89a5-ba92fdb0d151", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/components/music/MusicPlayer.js: -------------------------------------------------------------------------------- 1 | /* 2 | 音乐播放器 3 | 统一处理音效、音乐 4 | */ 5 | 6 | cc.Class({ 7 | properties: { 8 | _effect_mute: false, //临时性的 9 | _effect_enabled: true, 10 | effect: { 11 | get() { 12 | return this._effect_enabled; 13 | }, 14 | set(enabled) { 15 | this._effect_enabled = enabled; 16 | ya.storage.set(ya.skey.EFFECT_ENABLED, this._effect_enabled); 17 | } 18 | }, 19 | 20 | _music_enabled: true, 21 | music: { 22 | get() { 23 | return this._music_enabled; 24 | }, 25 | set(enabled) { 26 | this._music_enabled = enabled; 27 | ya.storage.set(ya.skey.MUSIC_ENABLED, this._music_enabled); 28 | } 29 | }, 30 | 31 | _vibration_enabled: true, 32 | vibration: { 33 | get() { 34 | return this._vibration_enabled; 35 | }, 36 | set(enabled) { 37 | this._vibration_enabled = enabled; 38 | ya.storage.set(ya.skey.VIBRATION_ENABLED, this._vibration_enabled); 39 | } 40 | }, 41 | 42 | music_name: "", 43 | 44 | is_sining_out: false, 45 | is_sining_in: false, 46 | }, 47 | 48 | ctor() { 49 | this._music_enabled = ya.storage.bool(ya.skey.MUSIC_ENABLED, true); 50 | 51 | this._effect_enabled = ya.storage.bool(ya.skey.EFFECT_ENABLED, true); 52 | 53 | this._vibration_enabled = ya.storage.bool(ya.skey.VIBRATION_ENABLED, true); 54 | }, 55 | 56 | //volume: 0.0 ~ 1.0 57 | setMusicVolume(volume) { 58 | volume = Number(volume) || 0; 59 | cc.audioEngine.setMusicVolume(volume); 60 | }, 61 | getMusicVolume() { 62 | return cc.audioEngine.getMusicVolume(); 63 | }, 64 | stopMusic() { 65 | cc.audioEngine.stopMusic(); 66 | this.music_name = ""; 67 | }, 68 | playMusic(name, isloop) { 69 | if (name === this.music_name) return; 70 | 71 | if (!this._music_enabled) return; 72 | 73 | isloop = Boolean(isloop); 74 | 75 | let audio_chip = cc.loader.getRes(name, cc.AudioClip); 76 | if (audio_chip) { 77 | cc.audioEngine.playMusic(audio_chip, isloop); 78 | } 79 | else { 80 | cc.loader.loadRes(name, cc.AudioClip, (err, audio_chip) => { 81 | if (this.music_name === name) { 82 | cc.audioEngine.playMusic(audio_chip, isloop); 83 | } 84 | }); 85 | } 86 | 87 | this.music_name = name; 88 | }, 89 | pauseMusic() { 90 | cc.audioEngine.pauseMusic(); 91 | }, 92 | resumeMusic() { 93 | cc.audioEngine.resumeMusic(); 94 | }, 95 | 96 | sineOutMusic() { 97 | if (this.is_sining_out) return; 98 | 99 | this.is_sining_in = false; 100 | this.is_sining_out = true; 101 | 102 | let volume = this.getMusicVolume(); 103 | let sineout = ()=>{ 104 | if (volume <= 0.02) { 105 | this.stopMusic(); 106 | } 107 | if (!this.is_sining_out || volume <= 0.02) { 108 | this.setMusicVolume(0); 109 | this.is_sining_out = false; 110 | return; 111 | } 112 | 113 | volume = Math.min(volume - 0.01, 0); 114 | this.setMusicVolume(volume); 115 | 116 | setTimeout(() => { 117 | sineout(); 118 | }, 50); 119 | } 120 | sineout(); 121 | }, 122 | sineInMusic(name, isloop) { 123 | if (this.is_sining_in) return; 124 | 125 | this.is_sining_in = true; 126 | this.is_sining_out = false; 127 | 128 | this.playMusic(name, isloop); 129 | 130 | let volume = 0; 131 | let sinein = ()=>{ 132 | if (volume >= 1) { 133 | this.playMusic(name, isloop); 134 | } 135 | if (!this.is_sining_in || volume >= 1) { 136 | this.setMusicVolume(1); 137 | this.is_sining_in = false; 138 | return; 139 | } 140 | volume = Math.min(volume + 0.01, 1); 141 | this.setMusicVolume(volume); 142 | 143 | setTimeout(() => { 144 | sinein(); 145 | }, 50); 146 | } 147 | sinein(); 148 | }, 149 | 150 | playEffect(name, isloop) { 151 | if (this._effect_mute) return; 152 | 153 | if (!this._effect_enabled) return; 154 | 155 | let audio_chip = cc.loader.getRes(name, cc.AudioClip); 156 | if (audio_chip) { 157 | return cc.audioEngine.playEffect(audio_chip, Boolean(isloop)); 158 | } 159 | else { 160 | cc.loader.loadRes(name, cc.AudioClip); 161 | } 162 | }, 163 | stopEffect(id) { 164 | cc.audioEngine.stopEffect(id); 165 | }, 166 | setEffectMute(mute) { 167 | this._effect_mute = Boolean(mute); 168 | if (this._effect_mute) { 169 | cc.audioEngine.stopAllEffects(); 170 | } 171 | } 172 | }); -------------------------------------------------------------------------------- /assets/scripts/components/music/MusicPlayer.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "f3dafe40-9ec8-40ad-a9a7-e46bd0ccb562", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/components/mvc.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "12b1c954-1dcf-4ed6-8185-f773247defd3", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/components/mvc/Controller.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 控制器基类 4 | */ 5 | 6 | cc.Class({ 7 | properties: { 8 | _view: null, 9 | view: { 10 | get() { 11 | return this._view; 12 | } 13 | }, 14 | 15 | root: { 16 | get() { 17 | return ya.layer.view; 18 | } 19 | }, 20 | 21 | _model: null, 22 | model: { 23 | get() { 24 | return this._model; 25 | }, 26 | set(m) { 27 | this._model = m; 28 | } 29 | }, 30 | 31 | _events: [], 32 | }, 33 | 34 | ctor() { 35 | this.initGlobalEvent(); 36 | }, 37 | 38 | initModel() { 39 | 40 | }, 41 | 42 | //初始化全局事件监听 43 | initGlobalEvent() { 44 | //这里使用addGlobalEvent添加事件 45 | }, 46 | 47 | //控制器事件,随着主view销毁而销毁 48 | initModuleEvent() { 49 | //这里使用addModuleEvent添加事件 50 | //销毁事件时使用clearModuleEvent 51 | }, 52 | 53 | //override 54 | initView(params) { 55 | return null; 56 | }, 57 | 58 | show(params) { 59 | if (!this._view) { 60 | this._view = this.initView(params); 61 | if (!this._view) return null; 62 | 63 | this.root.addChild(this._view.node); 64 | 65 | this.initModel(); 66 | this.initModuleEvent(); 67 | } 68 | else { 69 | if (!this._view.active) { 70 | this._view.active = true; 71 | } 72 | } 73 | return this._view; 74 | }, 75 | 76 | remove() { 77 | if (this._view) { 78 | this.clearModuleEvent(); 79 | 80 | this._view.node.destroy(); 81 | this._view = null; 82 | } 83 | }, 84 | hide() { 85 | if (this._view && this._view.node.active) { 86 | this._view.node.active = false; 87 | } 88 | }, 89 | display() { 90 | if (this._view && !this._view.node.active) { 91 | this._view.node.active = true; 92 | } 93 | }, 94 | 95 | addGlobalEvent(name, callback, target) { 96 | target = target || this; 97 | ya.event.on(name, callback, target); 98 | }, 99 | 100 | addModuleEvent(name, callback, target) { 101 | this.addGlobalEvent(name, callback, target); 102 | this._events.push(name); 103 | }, 104 | 105 | clearModuleEvent() { 106 | for (let i = 0; i < this._events.length; i++) { 107 | ya.event.off(this._events[i]); 108 | } 109 | this._events.length = 0; 110 | }, 111 | }); -------------------------------------------------------------------------------- /assets/scripts/components/mvc/Controller.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "1c071118-b4e7-44bc-bcd4-410662172d31", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/components/mvc/Dialog.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "f0cfec56-c06b-411d-9579-2f9951b7f826", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/components/mvc/Model.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 缓存基类 4 | */ 5 | 6 | cc.Class({ 7 | properties: { 8 | _dispatcher: { default: null, type: cc.EventTarget } 9 | }, 10 | 11 | ctor() { 12 | this._dispatcher = new cc.EventTarget(); 13 | }, 14 | 15 | emit(name, params) { 16 | this._dispatcher.emit(name, params); 17 | }, 18 | 19 | on(name, callback, target) { 20 | target = target || this; 21 | this._dispatcher.on(name, callback, target); 22 | }, 23 | 24 | off(name, callback, target) { 25 | target = target || this; 26 | this._dispatcher.off(name, callback, target); 27 | }, 28 | 29 | targetOff(target) { 30 | this._dispatcher.targetOff(target); 31 | } 32 | }); -------------------------------------------------------------------------------- /assets/scripts/components/mvc/Model.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "f066b740-8ea3-47f5-92a9-099edfbffbc3", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/components/mvc/View.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 视图的基础类 4 | */ 5 | 6 | cc.Class({ 7 | extends: cc.Component, 8 | 9 | //负责:视图实例的全局变量初始化 10 | ctor() { 11 | 12 | }, 13 | 14 | //每个视图创建时必须要调用的初始化方法 15 | init(params) { 16 | this.initData(params); 17 | 18 | this.initUI(); 19 | 20 | this.initEvent(); 21 | 22 | this.initClick(); 23 | }, 24 | 25 | //初始化方法:解析外部传进来的初始化数据 26 | initData(params) { 27 | this.init_data = params; 28 | // body 29 | }, 30 | 31 | //初始化UI,获取视图需要的UI句柄 32 | initUI() { 33 | 34 | }, 35 | 36 | //初始化对model数据变化的事件监听 37 | initEvent() { 38 | 39 | }, 40 | 41 | //初始化点击事件的监听 42 | initClick() { 43 | 44 | }, 45 | 46 | //override 47 | //视图被销毁 48 | onDestroy() { 49 | }, 50 | 51 | //IPhoneX 适配 52 | adjustIPhoneX(node_name) { 53 | let offset = ya.platform.getIPhoneXOffsetHeight(); 54 | let node = this.node.getChildByName(node_name); 55 | if (!node) return; 56 | 57 | let widget = node.getComponent(cc.Widget); 58 | if (!widget) return; 59 | 60 | widget.top = offset; 61 | widget.updateAlignment(); 62 | }, 63 | 64 | }); -------------------------------------------------------------------------------- /assets/scripts/components/mvc/View.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "1d73bd96-12e6-4bb3-9dbc-43e7b7092c87", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/components/storage.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "42152f58-95ca-4138-ae7a-eb77f76c99c9", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/components/storage/LocalStorage.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 本地存储 4 | */ 5 | 6 | cc.Class({ 7 | 8 | _isEmpty(value) { 9 | return value === null || value === "" || value === undefined; 10 | }, 11 | 12 | set(key, value) { 13 | if (!key) { 14 | cc.warn("[error in LocalStorage set func]: key is null"); 15 | return; 16 | } 17 | 18 | if (this._isEmpty(value)) { 19 | value = "0"; 20 | } 21 | else if (typeof value === "number") { 22 | value = value.toString(); 23 | } 24 | else if (typeof value === "boolean") { 25 | value = (value ? 1 : 0).toString(); 26 | } 27 | else if (typeof value === "object") { 28 | value = JSON.stringify(value); 29 | } 30 | 31 | cc.sys.localStorage.setItem(key, value); 32 | }, 33 | 34 | clean(key) { 35 | if (!key) { 36 | cc.warn("[error in LocalStorage clean func]: key is null"); 37 | return; 38 | } 39 | 40 | cc.sys.localStorage.setItem(key, null); 41 | }, 42 | 43 | //获取number类型值 44 | int(key, default_value) { 45 | if (!key) { 46 | cc.error("[error in LocalStorage int func]: key is null"); 47 | return default_value || 0; 48 | } 49 | 50 | let value = cc.sys.localStorage.getItem(key); 51 | if (this._isEmpty(value)) { 52 | value = default_value; 53 | } 54 | else { 55 | value = Number(value); 56 | } 57 | 58 | return value; 59 | }, 60 | 61 | //获取Boolean类型值 62 | bool(key, default_value) { 63 | if (!key) { 64 | cc.error("[error in LocalStorage bool func]: key is null"); 65 | return default_value || false; 66 | } 67 | 68 | let value = cc.sys.localStorage.getItem(key); 69 | if (this._isEmpty(value)) { 70 | value = default_value; 71 | } 72 | else { 73 | value = Boolean(Number(value)); 74 | } 75 | 76 | return value; 77 | }, 78 | 79 | //获取string类型值 80 | str(key, default_value) { 81 | if (!key) { 82 | cc.error("[error in LocalStorage str func]: key is null"); 83 | return default_value || ""; 84 | } 85 | 86 | let value = cc.sys.localStorage.getItem(key); 87 | if (this._isEmpty(value)) { 88 | value = default_value; 89 | } 90 | 91 | return value; 92 | }, 93 | 94 | //获取object类型值 95 | obj(key, default_value) { 96 | if (!key) { 97 | cc.error("[error in LocalStorage obj func]: key is null"); 98 | return default_value; 99 | } 100 | 101 | let value = cc.sys.localStorage.getItem(key); 102 | if (this._isEmpty(value)) { 103 | value = default_value; 104 | } 105 | else { 106 | try { 107 | value = JSON.parse(value); 108 | } catch (error) { //纯字符串JSON.parse会报错,例如"dd" 109 | value = default_value; 110 | } 111 | } 112 | 113 | return value; 114 | }, 115 | }); -------------------------------------------------------------------------------- /assets/scripts/components/storage/LocalStorage.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "0ece5f84-01a9-4a6a-a47d-28e6b45f226b", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/configs.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "63e1ed2e-77d2-49f6-b0bd-af378fd2e485", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/configs/ConfigInit.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 配置的初始化 4 | */ 5 | 6 | cc.Class({ 7 | 8 | statics: { 9 | init(ya) { 10 | ya.cfg = require("./GameConfig"); 11 | 12 | ya.const = require("./GameConstant"); 13 | 14 | ya.ekey = require("./EventKey"); 15 | ya.rkey = require("./ReportKey"); 16 | ya.skey = require("./StorageKey"); 17 | 18 | ya.txt = require("./GameText"); 19 | 20 | ya.res = require("./res/GameRes"); 21 | ya.tex = require("./res/GameTexture"); 22 | ya.res64 = require("./res/GameResBase64"); 23 | ya.resclassify = require("./res/GameResClassify"); 24 | } 25 | } 26 | 27 | }); -------------------------------------------------------------------------------- /assets/scripts/configs/ConfigInit.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "9fe02f57-539f-4957-8b90-a0b0c42e84f7", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/configs/EventKey.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 事件派发关键字的定义 4 | */ 5 | 6 | let __uuid = 0; 7 | let uuid = ()=>{ 8 | return "ekey" + (__uuid++).toString(); 9 | }; 10 | 11 | let E = {}; 12 | 13 | E.NET_CONNECTED = uuid(); //网络链接成功 14 | 15 | E.ON_SHOW = uuid(); //切前台 16 | E.ON_HIDE = uuid(); //切后台 17 | 18 | E.SHOW_WAITING = uuid(); //显示等待 19 | E.REMOVE_WAITTING = uuid(); //移除等待 20 | E.SHOW_PROMPT_DIALOG = uuid(); //显示通用提示弹窗 21 | 22 | E.EVT_SHOW_REVIVE = uuid(); 23 | E.EVT_SHOW_PAUSE = uuid(); 24 | E.EVT_SHOW_SETTLE = uuid(); 25 | E.EVT_SHOW_ARCHIVE = uuid(); 26 | E.EVT_SHOW_ITEM = uuid(); 27 | E.EVT_SHOW_BASKET = uuid(); 28 | 29 | E.SHOW_TOAST = uuid(); //显示提示 30 | 31 | E.EVT_GAME_EXIT = uuid(); 32 | E.EVT_GAME_OVER = uuid(); 33 | E.EVT_GAME_USE_DYE = uuid(); 34 | E.EVT_GAME_USE_BOMB = uuid(); 35 | E.EVT_GAME_SHOW_ITEM = uuid(); 36 | E.EVT_GAME_ITEM_LACK = uuid(); //道具不足 37 | 38 | E.MD_GAME_GOAL_CHANGE = uuid(); 39 | E.MD_GAME_LEVEL_CHANGE = uuid(); 40 | E.MD_GAME_SCORE_CHANGE = uuid(); 41 | E.MD_ITEM_NUM_CHANGE = uuid(); //道具数量改变 42 | E.EVT_USE_ITEM_DYE = uuid(); //使用了道具:换色 43 | E.EVT_USE_ITEM_BOMB = uuid(); //使用了道具:炸弹 44 | 45 | E.EVT_RUSSIA_GAME_OVER = uuid(); 46 | E.MD_RUSSIA_SCORE_CHANGE = uuid(); 47 | E.MD_RUSSIA_SHAPE_CHANGE = uuid(); 48 | 49 | E.EVT_UNION_SHOW_ITEM = uuid(); 50 | E.EVT_UNION_GAME_OVER = uuid(); 51 | E.MD_UNION_SCORE_CHANGE = uuid(); 52 | E.MD_UNION_GOAL_CHANGE = uuid(); 53 | 54 | export default E; -------------------------------------------------------------------------------- /assets/scripts/configs/EventKey.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "7b458a00-af8b-403b-a7e3-56e2aab02526", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/configs/GameConfig.js: -------------------------------------------------------------------------------- 1 | /* 2 | 游戏配置 3 | */ 4 | 5 | let C = {}; 6 | 7 | C.SHORT_VERSION = 1; 8 | C.VERSION = "1.0.0"; 9 | C.CHANNEL_NAME = "wechat"; 10 | 11 | export default C; 12 | -------------------------------------------------------------------------------- /assets/scripts/configs/GameConfig.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "28cf6972-5699-4566-9230-bc1ee98204f4", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/configs/GameConstant.js: -------------------------------------------------------------------------------- 1 | /* 2 | 游戏内的所需要使用的全局静态变量 3 | */ 4 | 5 | let C = {}; 6 | 7 | C.WX = {}; 8 | C.WX.AC_INIT = 100; 9 | C.WX.AC_TEST = 101; 10 | C.WX.AC_STORAGE = 102; 11 | C.WX.AC_SCROLL_V = 103; 12 | C.WX.AC_SCROLL_H = 104; 13 | C.WX.AC_F_STAR_FETCH = 121; 14 | C.WX.AC_G_STAR_FETCH = 122; 15 | C.WX.AC_F_STAR_SETTLE = 123; 16 | C.WX.AC_F_RUSSIA_FETCH = 131; 17 | C.WX.AC_G_RUSSIA_FETCH = 132; 18 | C.WX.AC_F_RUSSIA_SETTLE = 133; 19 | C.WX.AC_F_HAUL_FETCH = 141; 20 | C.WX.AC_G_HAUL_FETCH = 142; 21 | C.WX.AC_F_DIGIT_FETCH = 151; 22 | C.WX.AC_G_DIGIT_FETCH = 152; 23 | C.WX.AC_F_UNION_FETCH = 161; 24 | C.WX.AC_G_UNION_FETCH = 162; 25 | C.WX.AC_F_UNION_SETTLE = 163; 26 | C.WX.AC_F_POP_FETCH = 171; 27 | C.WX.AC_G_POP_FETCH = 172; 28 | 29 | 30 | C.REVIVE_MODE = {}; 31 | C.REVIVE_MODE.NONE = -1; 32 | C.REVIVE_MODE.FREE = 0; 33 | C.REVIVE_MODE.SHARE = 1; 34 | C.REVIVE_MODE.VIDEO = 2; 35 | 36 | C.GAME_MODE = {}; 37 | C.GAME_MODE.NONE = -1; 38 | C.GAME_MODE.STAR = 0; 39 | C.GAME_MODE.RUSSIA = 1; 40 | C.GAME_MODE.HAUL = 2; 41 | C.GAME_MODE.UNION = 3; 42 | C.GAME_MODE.DIGIT = 4; //数字三消 43 | C.GAME_MODE.POP = 5; //开心消消乐模式 44 | 45 | C.ITEM_MODE = {}; 46 | C.ITEM_MODE.MIX = 0; 47 | C.ITEM_MODE.DYE = 1; 48 | C.ITEM_MODE.BOMB = 2; 49 | C.ITEM_MODE.CHARM = 3; 50 | 51 | C.LIKE = {}; 52 | C.LIKE.COOL = 5; 53 | C.LIKE.PERFECT = 10; 54 | C.LIKE.SUPERSTAR = 15; 55 | C.LIKE.UNION_COOL = 10; 56 | C.LIKE.UNION_PERFECT = 15; 57 | C.LIKE.UNION_SUPERSTAR = 20; 58 | 59 | export default C; -------------------------------------------------------------------------------- /assets/scripts/configs/GameConstant.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "46438f5f-d23c-4530-b9cb-1ae66978a8e5", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/configs/GameText.js: -------------------------------------------------------------------------------- 1 | /* 2 | 游戏中的文本配置文件 3 | */ 4 | 5 | let T = {}; 6 | 7 | T.ad_err_tips = "拉取视频广告失败,错误码:%s"; 8 | 9 | T.share_title_common = "极简主义,极致体验,不一样的消除游戏"; 10 | T.share_title_revive = "卡住了,好难受,快来帮帮我(当前得分:%d)"; 11 | T.share_title_settle = "我在%s获得%d分,来,我们一起较量下吧"; 12 | 13 | T.star_001 = "第 %d 关"; 14 | T.star_002 = "目标: %d"; 15 | T.star_003 = "奖励 %d 分"; 16 | T.star_004 = "剩余 %d 个"; 17 | 18 | T.str_001 = "复活继续"; 19 | T.str_002 = "好友助力"; 20 | T.str_003 = "视频复活"; 21 | T.str_004 = "每局可复活两次(%d/%d)"; 22 | T.str_005 = "音效开"; 23 | T.str_006 = "音效关"; 24 | T.str_008 = "开发小哥哥正在紧张赶制中..."; 25 | T.str_009 = "微信版本太低,不支持客服消息"; 26 | T.str_010 = "微信版本太低,不支持游戏圈"; 27 | T.str_011 = "请选择要改变颜色的方块"; 28 | T.str_012 = "请选择要变成的方块"; 29 | T.str_013 = "请选择要轰炸的区域"; 30 | T.str_014 = "恭喜过关"; 31 | T.str_015 = "COOL"; 32 | T.str_016 = "PERFECT"; 33 | T.str_017 = "SUPER STAR"; 34 | T.str_018 = "根据局内表现,系统会自动赠送道具"; 35 | T.str_019 = "领取"; 36 | T.str_020 = "帅呆了!免费送你道具,继续加油哦!"; 37 | T.str_021 = "分数超过%d,免费送你道具,助你轻松上王者"; 38 | T.str_022 = "分享翻倍"; 39 | T.str_023 = "视频翻倍"; 40 | 41 | T.mode_001 = "消灭星星玩法"; 42 | T.mode_002 = "俄罗斯方块玩法"; 43 | T.mode_003 = "方块合并玩法"; 44 | T.item_mix = "重置"; 45 | T.item_bomb = "炸弹"; 46 | T.item_dye = "换色"; 47 | 48 | 49 | export default T; -------------------------------------------------------------------------------- /assets/scripts/configs/GameText.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "bf4c453e-5e34-46a1-8b7e-0578abe2da22", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/configs/ReportKey.js: -------------------------------------------------------------------------------- 1 | /* 2 | 统计上报关键字定义 3 | */ 4 | 5 | let R = {}; 6 | 7 | export default R; -------------------------------------------------------------------------------- /assets/scripts/configs/ReportKey.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "14b678c1-83cf-4d82-9856-6c10f57b6afe", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/configs/StorageKey.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 本地存储的关键字 4 | */ 5 | 6 | let S = {}; 7 | 8 | S.MUSIC_ENABLED = "s1"; //音乐是否可用 9 | S.EFFECT_ENABLED = "s2" //音效是否可用 10 | S.VIBRATION_ENABLED = "s3"; //震动是否可用 11 | 12 | S.SHARE_STAR_REVIVE_NUM = "s4"; //star分享复活次数 13 | S.STAR_WEEK_SCORE = "s5"; 14 | S.STAR_WEEK_TIME = "s6"; 15 | S.STAR_MAX_SCORE = "s7"; 16 | S.STAR_ARCHIVE = "s8"; 17 | 18 | S.ITEM_DYE_NUM = "s9"; 19 | S.ITEM_MIX_NUM = "s10"; 20 | S.ITEM_BOMB_NUM = "s11"; 21 | 22 | S.SHARE_STAR_ITEM_NUM = "s12"; 23 | S.SHARE_RUSSIA_REVIVE_NUM = "s20"; //russia分享复活次数 24 | S.RUSSIA_WEEK_SCORE = "s21"; 25 | S.RUSSIA_WEEK_TIME = "s22"; 26 | S.RUSSIA_MAX_SCORE = "s23"; 27 | S.RUSSIA_ARCHIVE = "s24"; 28 | 29 | S.UNION_WEEK_SCORE = "s31"; 30 | S.UNION_WEEK_TIME = "s32"; 31 | S.UNION_MAX_SCORE = "s33"; 32 | S.UNION_ARCHIVE = "s34"; 33 | S.SHARE_UNION_ITEM_NUM = "s35"; 34 | S.SHARE_UNION_REVIVE_NUM = "s36"; 35 | 36 | export default S; -------------------------------------------------------------------------------- /assets/scripts/configs/StorageKey.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "9ecb11f5-4e60-4b25-8f2b-e05678038fc8", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/configs/game.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "7b6f5a7b-25ef-4925-aaae-dfc146d9435a", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/configs/game/DigitConfig.js: -------------------------------------------------------------------------------- 1 | 2 | let DC = {}; 3 | 4 | DC.COLOR = [ 5 | cc.color(255, 255, 255), 6 | cc.color(255, 255, 255), //1 7 | cc.color(255, 255, 255), //2 8 | cc.color(255, 255, 255), //3 9 | cc.color(255, 255, 255), //4 10 | cc.color(255, 255, 255), //5 11 | cc.color(255, 255, 255), //6 12 | cc.color( 82, 93, 188), //7 13 | cc.color(226, 111, 23), //8 14 | cc.color(153, 96, 199), //9 15 | cc.color(192, 58, 45), //10 16 | cc.color(115, 100, 115), //11 17 | cc.color( 83, 94, 189), //12 18 | ]; 19 | 20 | DC.ROW = 5; 21 | DC.COLUMN = 5; 22 | 23 | 24 | export default DC; -------------------------------------------------------------------------------- /assets/scripts/configs/game/DigitConfig.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "a35c5e84-7297-40a7-a52b-723b8a589924", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/configs/game/RussiaConfig.js: -------------------------------------------------------------------------------- 1 | 2 | let RC = {}; 3 | 4 | RC.NONE = 0; 5 | RC.RED = 1; 6 | RC.ORANGE = 2; 7 | RC.YELLOW = 3; 8 | RC.GREEN = 4; 9 | RC.BLUE = 5; 10 | 11 | RC.COLOR_LIST = [RC.RED, RC.ORANGE, RC.YELLOW, RC.GREEN, RC.BLUE]; 12 | 13 | RC.COLOR = { 14 | [RC.RED]: cc.color(237, 66, 75), 15 | [RC.ORANGE]: cc.color(242, 84, 219), 16 | [RC.YELLOW]: cc.color(241, 160, 10), 17 | [RC.GREEN]: cc.color(65, 184, 4), 18 | [RC.BLUE]: cc.color(22, 142, 231), 19 | }; 20 | 21 | RC.SHAPE0 = 0; 22 | RC.SHAPE1 = 1; // . 23 | RC.SHAPE2 = 2; // ... 24 | RC.SHAPE3 = 3; // :.. 25 | RC.SHAPE4 = 4; // ..: 26 | RC.SHAPE5 = 5; // .:. 27 | RC.SHAPE6 = 6; // .:' 28 | RC.SHAPE7 = 7; // ':. 29 | RC.SHAPE8 = 8; // :: 30 | 31 | RC.SHAPES = [ 32 | RC.SHAPE1, 33 | RC.SHAPE2, 34 | RC.SHAPE3, 35 | RC.SHAPE4, 36 | RC.SHAPE5, 37 | RC.SHAPE6, 38 | RC.SHAPE7, 39 | RC.SHAPE8 40 | ]; 41 | RC.SHAPE_LEN = RC.SHAPES.length; 42 | 43 | RC.ROW = 20; 44 | RC.COLUMN = 10; 45 | 46 | RC.WIDTH = 45; 47 | RC.GAP = 5; 48 | RC.BORDER = 10; 49 | 50 | RC.U_ROW = 3; 51 | RC.U_COLUMN = 3; 52 | RC.U_WIDTH = 145; 53 | 54 | RC.SHAPE_COLUMN_INDEX = 4; 55 | 56 | RC.MOVE_DIS_X = 10; 57 | RC.MOVE_DIS_Y = 10; 58 | 59 | RC.STATUS = { 60 | NONE: 0, 61 | PLAYING: 1, 62 | PAUSE: 2, 63 | ERASING: 3, 64 | OVER: 4, 65 | }; 66 | 67 | RC.REVIVE_ROW = 8; 68 | 69 | RC.SCORE_INC = 10; 70 | 71 | RC.REVIVE_NUM = 2; 72 | RC.REVIVE_MAX_SHARE = 6; //最多分享复活几次 73 | 74 | RC.GOAL_AWARD_SCORE = 2e4; 75 | RC.GOAL_AWARD_SCORE_INC = 1e4; 76 | 77 | export default RC; -------------------------------------------------------------------------------- /assets/scripts/configs/game/RussiaConfig.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "948bd260-d132-4bf3-98e7-e5b244df8b47", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/configs/game/StarConfig.js: -------------------------------------------------------------------------------- 1 | 2 | let SC = {}; 3 | 4 | SC.NONE = 0; 5 | SC.RED = 1; 6 | SC.ORANGE = 2; 7 | SC.YELLOW = 3; 8 | SC.GREEN = 4; 9 | SC.BLUE = 5; 10 | 11 | SC.COLOR_LIST = [SC.RED, SC.ORANGE, SC.YELLOW, SC.GREEN, SC.BLUE]; 12 | 13 | SC.COLOR = { 14 | [SC.RED]: cc.color(237, 66, 75), 15 | [SC.ORANGE]: cc.color(242, 84, 219), 16 | [SC.YELLOW]: cc.color(241, 160, 10), 17 | [SC.GREEN]: cc.color(65, 184, 4), 18 | [SC.BLUE]: cc.color(22, 142, 231), 19 | }; 20 | 21 | SC.DIR = [ 22 | { x: 0, y: 1 }, 23 | { x: 1, y: 0 }, 24 | { x: 0, y: -1 }, 25 | { x: -1, y: 0 }, 26 | ]; 27 | 28 | SC.ROW = 10; 29 | SC.COLUMN = 10; 30 | 31 | SC.WIDTH = 64; 32 | SC.GAP = 6; 33 | SC.BORDER = 13; 34 | 35 | SC.SCORE = 5; 36 | SC.SCORE_INC = 10; 37 | 38 | SC.GOAL = [1e3, 3e3, 4500, 6e3, 8e3, 1e4, 13e3, 16e3, 19e3, 22e3]; 39 | SC.GOAL_LEN = SC.GOAL.length; 40 | SC.GOAL_INC = 3500; 41 | 42 | SC.AWARD = 2000; 43 | 44 | SC.REVIVE_NUM = 2; 45 | SC.REVIVE_MAX_SHARE = 6; //最多分享复活几次 46 | SC.ITEM_NUM = 2; 47 | SC.ITEM_MAX_SHARE = 10; 48 | 49 | SC.GOAL_AWARD_SCORE = 2e4; 50 | SC.GOAL_AWARD_SCORE_INC = 1e4; 51 | 52 | export default SC; 53 | -------------------------------------------------------------------------------- /assets/scripts/configs/game/StarConfig.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "82a6f791-bca6-496a-b4ce-17b705c7778a", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/configs/game/UnionConfig.js: -------------------------------------------------------------------------------- 1 | let UC = {}; 2 | 3 | UC.NONE = 0; 4 | UC.RED = 1; 5 | UC.YELLOW = 2; 6 | UC.BLUE = 3; 7 | UC.DARK = 4; 8 | 9 | UC.COLOR_LIST = [UC.RED, UC.YELLOW, UC.BLUE]; 10 | UC.COLOR_LEN = 3; 11 | 12 | UC.COLOR = { 13 | [UC.RED]: cc.color(237, 66, 75), 14 | [UC.YELLOW]: cc.color(241, 160, 10), 15 | [UC.BLUE]: cc.color(22, 142, 231), 16 | [UC.DARK]: cc.color(65, 4, 4), 17 | }; 18 | 19 | UC.ROW = 6; 20 | UC.COLUMN = 6; 21 | 22 | UC.GOALS = [200, 500, 1e3, 1500, 2e3]; 23 | UC.GOAL_INC = 500; 24 | 25 | UC.DIR = [ 26 | { x: 0, y: 1 }, 27 | { x: 1, y: 0 }, 28 | { x: 0, y: -1 }, 29 | { x: -1, y: 0 }, 30 | ]; 31 | 32 | UC.BORDER = 20; 33 | UC.GAP = 10; 34 | UC.WIDTH = 105; 35 | UC.MAX_NUM = 50; 36 | 37 | UC.REVIVE_NUM = 2; 38 | UC.REVIVE_MAX_SHARE = 6; //最多分享复活几次 39 | UC.ITEM_NUM = 2; 40 | UC.ITEM_MAX_SHARE = 10; 41 | 42 | UC.GOAL_AWARD_SCORE = 2e4; 43 | UC.GOAL_AWARD_SCORE_INC = 1e4; 44 | 45 | export default UC; -------------------------------------------------------------------------------- /assets/scripts/configs/game/UnionConfig.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "a404ad66-0e01-42fc-a534-f71c5c19bb8e", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/configs/res.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "6c375a02-f627-42ac-a7ee-d91815e83364", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/configs/res/GameRes.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 资源配置文件 4 | */ 5 | 6 | let prefab = "prefabs/"; 7 | let texture = "textures/"; 8 | let sound = "sounds/"; 9 | 10 | let R = {}; 11 | 12 | R.image_share_common = "images/common_share_img.jpg"; 13 | R.image_share_revive = "images/revive_share_img.jpg"; 14 | R.image_share_settle = "images/settle_share_img.jpg"; 15 | R.image_pure = "images/img_pure.png"; 16 | 17 | R.prefab_game_star = prefab + "game_star"; 18 | R.prefab_game_star_item = prefab + "game_star_item"; 19 | R.prefab_game_russia = prefab + "game_russia"; 20 | R.prefab_game_haul = prefab + "game_haul"; 21 | R.prefab_game_union = prefab + "game_union"; 22 | R.prefab_revive = prefab + "dialog_revive"; 23 | R.prefab_pause = prefab + "dialog_pause"; 24 | R.prefab_settle = prefab + "dialog_settle"; 25 | R.prefab_archive = prefab + "dialog_archive"; 26 | R.prefab_item = prefab + "dialog_item"; 27 | R.prefab_main = prefab + "main"; 28 | R.prefab_rank = prefab + "rank"; 29 | 30 | R.sound_click = sound + "click"; 31 | R.sound_star_erase = sound + "star_erase"; 32 | R.sound_star_via = sound + "star_via"; 33 | R.sound_star_multi = sound + "star_multi"; 34 | R.sound_star_award_erase = sound + "star_award_erase"; 35 | R.sound_star_fadein = sound + "star_fadein"; 36 | R.sound_die = sound + "die"; 37 | R.sound_like_1 = sound + "star_like_1"; 38 | R.sound_like_2 = sound + "star_like_2"; 39 | R.sound_like_3 = sound + "star_like_3"; 40 | R.sound_bgm = sound + "bgm"; 41 | 42 | R.game = texture + "game/game"; 43 | R.unity = texture + "unity/unity"; 44 | 45 | export default R; -------------------------------------------------------------------------------- /assets/scripts/configs/res/GameRes.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "de20476d-8fc0-4985-8e16-8ef3ff9fab0f", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/configs/res/GameResBase64.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | base64资源配置文件 4 | */ 5 | 6 | let B = {}; 7 | 8 | B.cube_square = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACAQMAAABIeJ9nAAAAA1BMVEX///+nxBvIAAAACklEQVQI12MAAgAABAABINItbwAAAABJRU5ErkJggg=="; 9 | 10 | export default B; -------------------------------------------------------------------------------- /assets/scripts/configs/res/GameResBase64.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "cd759643-39e7-40c8-bdee-9a445ef354b9", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/configs/res/GameResClassify.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 资源模块分类,用于模块资源加载 4 | */ 5 | 6 | let res = require("./GameRes"); 7 | 8 | let C = {}; 9 | 10 | C.main = [ 11 | [res.game, cc.SpriteAtlas], 12 | res.prefab_main, 13 | [res.sound_click, cc.AudioClip], 14 | [res.sound_bgm, cc.AudioClip], 15 | ]; 16 | 17 | C.global = [ 18 | 19 | ]; 20 | 21 | C.game_star = [ 22 | [res.game, cc.SpriteAtlas], 23 | [res.unity, cc.SpriteAtlas], 24 | res.prefab_game_star, 25 | res.prefab_game_star_item, 26 | [res.sound_star_erase, cc.AudioClip], 27 | [res.sound_star_via, cc.AudioClip], 28 | [res.sound_star_award_erase, cc.AudioClip], 29 | [res.sound_star_fadein, cc.AudioClip], 30 | [res.sound_die, cc.AudioClip], 31 | [res.sound_like_1, cc.AudioClip], 32 | [res.sound_like_2, cc.AudioClip], 33 | [res.sound_like_3, cc.AudioClip], 34 | res.prefab_item, 35 | ]; 36 | 37 | C.game_russia = [ 38 | [res.game, cc.SpriteAtlas], 39 | [res.unity, cc.SpriteAtlas], 40 | res.prefab_game_russia, 41 | ]; 42 | 43 | C.game_haul = [ 44 | [res.game, cc.SpriteAtlas], 45 | [res.unity, cc.SpriteAtlas], 46 | res.prefab_game_haul, 47 | ]; 48 | 49 | C.game_union = [ 50 | [res.game, cc.SpriteAtlas], 51 | [res.unity, cc.SpriteAtlas], 52 | res.prefab_game_union, 53 | res.prefab_game_star_item, 54 | res.prefab_item, 55 | [res.sound_like_1, cc.AudioClip], 56 | [res.sound_like_2, cc.AudioClip], 57 | [res.sound_like_3, cc.AudioClip], 58 | ]; 59 | 60 | C.revive = [ 61 | res.prefab_revive, 62 | ]; 63 | 64 | C.pause = [ 65 | res.prefab_pause, 66 | ]; 67 | 68 | C.settle = [ 69 | res.prefab_settle, 70 | ]; 71 | 72 | C.rank = [ 73 | res.prefab_rank, 74 | ]; 75 | 76 | C.archive = [ 77 | res.prefab_archive, 78 | ]; 79 | 80 | export default C; -------------------------------------------------------------------------------- /assets/scripts/configs/res/GameResClassify.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "910eb83c-1f28-46d2-be5c-d19fd051418b", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/configs/res/GameTexture.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 图集中的贴图纹理配置文件 4 | */ 5 | 6 | let T = {}; 7 | 8 | T.game_cube_square = "game_cube_square"; 9 | T.game_cube_fillet = "game_cube_fillet"; 10 | T.game_img_halo = "game_img_halo"; 11 | T.game_item_bg = "game_item_bg"; 12 | T.game_item_mix = "game_item_mix"; 13 | T.game_item_dye = "game_item_dye"; 14 | T.game_item_bomb = "game_item_bomb"; 15 | T.game_star_red = "game_star_red"; 16 | T.game_star_green = "game_star_green"; 17 | T.game_star_blue = "game_star_blue"; 18 | T.game_star_orange = "game_star_orange"; 19 | T.game_star_yellow = "game_star_yellow"; 20 | T.game_star_select = "game_star_select"; 21 | T.game_item_circle = "game_item_circle"; 22 | 23 | T.unity_circle_bg = "unity_circle_bg"; 24 | 25 | export default T; -------------------------------------------------------------------------------- /assets/scripts/configs/res/GameTexture.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "d63fe608-9c0a-4149-b847-83bc109c2459", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/launcher.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 启动器 4 | 主场景被加载后,用来对游戏的初始化 5 | */ 6 | 7 | let ya = window.ya = {}; 8 | 9 | let ComponentInit = require("./components/ComponentInit"); 10 | let ConfigInit = require("./configs/ConfigInit"); 11 | let ModelInit = require("./models/ModelInit"); 12 | let UtilsInit = require("./utils/UtilsInit"); 13 | 14 | let DialogManager = require("./managers/DialogManager"); 15 | let ModuleManager = require("./managers/ModuleManager"); 16 | let ResouceManager = require("./managers/ResourceManager"); 17 | 18 | let BasicPlatform = require("./platforms/BasicPlatform"); 19 | let WeChatPlatform = require("./platforms/WeChatPlatform"); 20 | 21 | cc.Class({ 22 | extends: cc.Component, 23 | 24 | properties: { 25 | layerView: cc.Node, 26 | layerDialog: cc.Node, 27 | layerTop: cc.Node, 28 | }, 29 | 30 | onLoad() { 31 | 32 | this.initLayer(); 33 | 34 | ConfigInit.init(ya); 35 | 36 | ComponentInit.init(ya); 37 | 38 | UtilsInit.init(ya); 39 | 40 | ya.model = new ModelInit(); 41 | 42 | this.initPlatform(); 43 | 44 | this.initManager(); 45 | 46 | this.launch(); 47 | }, 48 | 49 | initLayer() { 50 | ya.layer = {}; 51 | 52 | ya.layer.view = this.layerView; //场景层 53 | ya.layer.dialog = this.layerDialog; //弹窗层 54 | ya.layer.top = this.layerTop; //最顶层 55 | }, 56 | 57 | initPlatform() { 58 | ya.platform = cc.sys.platform == cc.sys.WECHAT_GAME ? new WeChatPlatform() : new BasicPlatform(); 59 | }, 60 | 61 | initManager() { 62 | ya.dm = new DialogManager(); 63 | ya.mm = new ModuleManager(); 64 | ya.rm = new ResouceManager(); 65 | }, 66 | 67 | launch() { 68 | //global/toast常驻内存 69 | ya.mm.get("global").show(); 70 | ya.mm.get("toast").show(); 71 | 72 | ya.mm.show("loading"); 73 | } 74 | }); -------------------------------------------------------------------------------- /assets/scripts/launcher.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "f4bd2cdd-a60f-40a2-9cad-99a2ff98d572", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/managers.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "047a3772-62c8-4a13-bed4-d1531c693fea", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/managers/DialogManager.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "0e79305d-a44a-4838-af45-2cd0d71855f3", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/managers/ModuleManager.js: -------------------------------------------------------------------------------- 1 | /* 2 | 模块管理器 3 | 统一初始化Controller,并持有所有Controller的句柄 4 | */ 5 | 6 | let GlobalController = require("../modules/global/GlobalController"); 7 | let MainController = require("../modules/main/MainController"); 8 | let RankController = require("../modules/rank/RankController"); 9 | let LoginController = require("../modules/login/LoginController"); 10 | let LoadingController = require("../modules/loading/LoadingController"); 11 | let ToastController = require("../modules/toast/ToastController"); 12 | let ReviveController = require("../modules/revive/ReviveController"); 13 | let SettingController = require("../modules/setting/SettingController"); 14 | let SettleController = require("../modules/settle/SettleController"); 15 | let ItemController = require("../modules/item/ItemController"); 16 | 17 | let PopGameController = require("../modules/game/pop/PopGameController"); 18 | let StarGameController = require("../modules/game/star/StarGameController"); 19 | let HaulGameController = require("../modules/game/haul/HaulGameController"); 20 | let DigitGameController = require("../modules/game/digit/DigitGameController"); 21 | let UnionGameController = require("../modules/game/union/UnionGameController"); 22 | let RussiaGameController = require("../modules/game/russia/RussiaGameController"); 23 | 24 | cc.Class({ 25 | properties: { 26 | _controllers: { default: {} }, 27 | _uniques: { default: {} }, 28 | _unique_classes: { default: {} }, 29 | 30 | _stack: [], 31 | _stack_num: 0, 32 | }, 33 | 34 | ctor() { 35 | this.init(); 36 | }, 37 | 38 | init() { 39 | this._controllers["global"] = new GlobalController(); 40 | 41 | this._controllers["loading"] = new LoadingController(); 42 | 43 | this._controllers["login"] = new LoginController(); 44 | 45 | this._controllers["main"] = new MainController(); 46 | 47 | this._controllers["rank"] = new RankController(); 48 | 49 | this._controllers["toast"] = new ToastController(); 50 | 51 | this._controllers["revive"] = new ReviveController(); 52 | 53 | this._controllers["setting"] = new SettingController(); 54 | 55 | this._controllers["settle"] = new SettleController(); 56 | 57 | this._controllers["item"] = new ItemController(); 58 | 59 | this.initUniqueController(); 60 | }, 61 | 62 | //某些Controller只能同时存在一个 63 | initUniqueController() { 64 | //斗地主的几个玩法 65 | this._uniques["game"] = ["digit", "haul", "union", "pop", "russia", "star"]; 66 | this._unique_classes = { 67 | pop: PopGameController, 68 | star: StarGameController, 69 | haul: HaulGameController, 70 | digit: DigitGameController, 71 | union: UnionGameController, 72 | russia: RussiaGameController, 73 | } 74 | }, 75 | 76 | createController(name) { 77 | let ClassName = this._unique_classes[name]; 78 | return new ClassName(); 79 | }, 80 | 81 | //检查给定的name是否在unique列表中 82 | getUniqueName(name) { 83 | let found_name = ""; 84 | for (let uni_name in this._uniques) { 85 | if (this._uniques[uni_name].indexOf(name) !== -1) { 86 | found_name = uni_name; 87 | break; 88 | } 89 | } 90 | return found_name; 91 | }, 92 | 93 | get(name) { 94 | return this._controllers[name]; 95 | }, 96 | 97 | //显示某一视图模块 98 | //name 待显示的模块名称 99 | //params 传给视图的参数 100 | //cleanly 显示视图之前是否要清理其他已打开的视图 101 | show(name, params, cleanly) { 102 | if (cleanly) { 103 | this.clean(); 104 | } 105 | 106 | //如果name在unique列表中,则要创建一个 107 | if (this.getUniqueName(name)) { 108 | this._controllers[name] = this.createController(name); 109 | } 110 | 111 | let controller = this._controllers[name]; 112 | if (!controller) { 113 | cc.warn(`Not Found: ${name} in show fun of ya.mm`); 114 | return; 115 | } 116 | 117 | controller.show(params); 118 | 119 | this._stack.push(name); 120 | this._stack_num++; 121 | }, 122 | 123 | //隐藏除了栈顶视图之外的其他所有视图 124 | hide() { 125 | for (let i = 0, controller; i < this._stack_num - 1; i++) { 126 | controller = this._controllers[this._stack[i]]; 127 | controller && controller.hide(); 128 | } 129 | }, 130 | 131 | //移除某一视图模块 132 | remove(name) { 133 | let controller = this._controllers[name]; 134 | if (!controller) { 135 | cc.warn(`Not Found: ${name} in remove fun of ya.mm`); 136 | return; 137 | } 138 | 139 | controller.remove(); 140 | 141 | for (let i = 0; i < this._stack_num; i++) { 142 | if (this._stack[i] === name) { 143 | if (i === this._stack_num - 1 && i !== 0) { 144 | controller = this._controllers[this._stack[i - 1]]; 145 | controller && controller.display(); 146 | } 147 | 148 | //如果name在unique列表中,则要移除引用 149 | this.getUniqueName(name) && (this._controllers[name] = null); 150 | 151 | this._stack.splice(i, 1); 152 | this._stack_num--; 153 | 154 | break; 155 | } 156 | } 157 | }, 158 | 159 | //移除所有的视图模块 160 | clean() { 161 | let name, controller; 162 | while (this._stack.length > 0) { 163 | name = this._stack.pop(); 164 | controller = this._controllers[name]; 165 | 166 | controller && controller.remove(); 167 | 168 | //如果name在unique列表中,则要移除引用 169 | this.getUniqueName(name) && (this._controllers[name] = null); 170 | } 171 | this._stack_num = 0; 172 | } 173 | }); -------------------------------------------------------------------------------- /assets/scripts/managers/ModuleManager.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "c797fcb2-826a-47b1-a495-798db578249b", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/managers/ResourceManager.js: -------------------------------------------------------------------------------- 1 | /* 2 | 资源管理器 3 | 统一处理资源的加载 4 | */ 5 | 6 | cc.Class({ 7 | properties: { 8 | _loadded_module: { default: {} }, 9 | 10 | _sprite_atlas: { default: {} }, 11 | 12 | _sprite_frames: { default: {} }, 13 | }, 14 | 15 | //获取指定模块的资源列表 16 | getResList(parent, modules) { 17 | let ret = []; 18 | 19 | !modules && (modules = parent, parent = ya.resclassify); 20 | 21 | if (typeof modules === "string") { 22 | ret = ya.utils.clone(parent[modules]); 23 | } 24 | else { 25 | for (let i = 0; i < modules.length; i++) { 26 | ret = ret.concat(this.getResList(parent, modules[i])); 27 | } 28 | } 29 | 30 | return ret; 31 | }, 32 | 33 | splitPathAndType(res) { 34 | let path = [], type = []; 35 | 36 | for (let i = 0; i < res.length; i++) { 37 | if (typeof res[i] === "string") { 38 | path[i] = res[i]; 39 | } 40 | else { 41 | path[i] = res[i][0]; 42 | type[i] = res[i][1]; 43 | } 44 | } 45 | 46 | return [path, type]; 47 | }, 48 | 49 | //加载纹理缓存 50 | load(modules, iterator, complete) { 51 | 52 | iterator || (iterator = function () { }); 53 | complete || (complete = function () { }); 54 | 55 | //显示加载百分比 56 | let funcPercent = (percent) => { 57 | if (!this.isLoadded("global")) return; 58 | if (typeof module !== "string" || (module !== "global" && module !== "iloadding" && module !== "maineffect")) { 59 | ya.event.dispatchEvent(ya.ekey.SHOW_WAITING, { txt: ya.txt.net002 + percent + "%", isAutoDestroy: false }); 60 | } 61 | } 62 | 63 | //加载回调 64 | let iteratorFunc = () => (result, count, total) =>{ 65 | if (iterator) iterator(result, count, total); 66 | funcPercent(Math.ceil(count / total * 100)); 67 | } 68 | 69 | funcPercent(0); //显示加载百分比为0 70 | 71 | let res_list = this.splitPathAndType(this.getResList(modules)); 72 | 73 | cc.loader.loadResArray(res_list[0], res_list[1], (count, total, result) => { 74 | this.loadIterator(result, count, total, iteratorFunc); 75 | }, (errors, resources) => { 76 | if (!!errors) { 77 | this.load(modules, iterator, complete); 78 | } 79 | else { 80 | this.loadComplete(resources, modules, complete); 81 | } 82 | }); 83 | }, 84 | 85 | //下载的迭代器 86 | loadIterator(count, total, result, iterator) { 87 | //下载出错 88 | if (!result) { 89 | 90 | } 91 | else { 92 | if (iterator) iterator(count, total, result); 93 | } 94 | }, 95 | 96 | //下载完成的回调 97 | loadComplete(resources, modules, complete) { 98 | ya.event.dispatchEvent(ya.ekey.REMOVE_WAITING); 99 | 100 | this.setLoadded(modules, true); 101 | 102 | this.setResourceLoadded(resources); 103 | 104 | if (complete) complete(); 105 | }, 106 | 107 | setLoadded(modules, loadded) { 108 | typeof modules === "string" && (modules = [modules]); 109 | 110 | for (let i = 0; i < modules.length; i++) { 111 | this._loadded_module[modules[i]] = loadded; 112 | } 113 | }, 114 | 115 | //获取某个模块是否加载完成 116 | isLoadded(modules) { 117 | typeof modules === "string" && (modules = [modules]); 118 | 119 | for (let i = 0; i < modules.length; i++) { 120 | if (!this._loadded_module[modules[i]]) { 121 | return false; 122 | } 123 | } 124 | 125 | return true; 126 | }, 127 | 128 | //检查并加载指定的模块 129 | checkLoad(modules, iterator, callback) { 130 | !callback && (callback = iterator, iterator = null); 131 | 132 | if (this.isLoadded(modules)) { 133 | callback(); 134 | } 135 | else { 136 | this.load(modules, iterator, callback); 137 | } 138 | }, 139 | 140 | setResourceLoadded(resources) { 141 | if (!resources || resources.length <= 0) return; 142 | 143 | resources.forEach(item => { 144 | if (item instanceof cc.SpriteAtlas) { 145 | this._sprite_atlas[item.name] = item; 146 | 147 | let sprite_frames = item.getSpriteFrames(); 148 | for (let k in sprite_frames) { 149 | let sf = sprite_frames[k]; 150 | this._sprite_frames[sf.name] = sf; 151 | } 152 | } 153 | }); 154 | }, 155 | 156 | //参数说明 157 | //atlas: ya.res中的定义 158 | //name: ya.tex中的定义 159 | getSpriteFrame(atlas, name) { 160 | //如果只传了一个参数默认是直接获取精灵 161 | if (!name) { 162 | return this._sprite_frames[atlas]; 163 | } 164 | 165 | let realatlas = cc.path.basename(cc.path.mainFileName(atlas)) + ".plist"; 166 | if (this._sprite_atlas[realatlas]) { 167 | return this._sprite_atlas[realatlas].getSpriteFrame(name); 168 | } 169 | }, 170 | }); -------------------------------------------------------------------------------- /assets/scripts/managers/ResourceManager.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "575d9207-8476-4fd3-889b-6575d27004b8", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/models.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "aaaf821d-f8b8-4781-8000-cebf85ab69d2", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/models/ConfigModel.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 游戏配置 4 | */ 5 | 6 | let Model = require("../components/mvc/Model"); 7 | 8 | cc.Class({ 9 | extends: Model, 10 | 11 | properties: { 12 | inreview: false, 13 | }, 14 | 15 | ctor() { 16 | this.init(); 17 | }, 18 | 19 | init() { 20 | let review_time = 1546266593773; 21 | let cur_time = new Date().getTime(); 22 | 23 | if (cur_time < review_time) { 24 | this.inreview = true; 25 | } 26 | else { 27 | this.inreview = false; 28 | } 29 | } 30 | }); -------------------------------------------------------------------------------- /assets/scripts/models/ConfigModel.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "2e2fded5-3bcd-4f06-97ba-9d45ca61d15a", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/models/ItemModel.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 道具 4 | */ 5 | 6 | let Model = require("../components/mvc/Model"); 7 | 8 | cc.Class({ 9 | extends: Model, 10 | 11 | properties: { 12 | 13 | }, 14 | 15 | ctor() { 16 | 17 | this.item_dye_num = ya.storage.int(ya.skey.ITEM_DYE_NUM, 0); 18 | this.item_mix_num = ya.storage.int(ya.skey.ITEM_MIX_NUM, 0); 19 | this.item_bomb_num = ya.storage.int(ya.skey.ITEM_BOMB_NUM, 0); 20 | 21 | }, 22 | 23 | getItemNum(mode) { 24 | let num = 0; 25 | switch(mode) { 26 | case ya.const.ITEM_MODE.MIX: 27 | num = this.item_mix_num; break; 28 | case ya.const.ITEM_MODE.DYE: 29 | num = this.item_dye_num; break; 30 | case ya.const.ITEM_MODE.BOMB: 31 | num = this.item_bomb_num; break; 32 | } 33 | return num; 34 | }, 35 | 36 | setItemNum(mode, n) { 37 | let skey = ""; 38 | switch(mode) { 39 | case ya.const.ITEM_MODE.MIX: 40 | skey = ya.skey.ITEM_MIX_NUM; 41 | this.item_mix_num = n; break; 42 | case ya.const.ITEM_MODE.DYE: 43 | skey = ya.skey.ITEM_DYE_NUM; 44 | this.item_dye_num = n; break; 45 | case ya.const.ITEM_MODE.BOMB: 46 | skey = ya.skey.ITEM_BOMB_NUM; 47 | this.item_bomb_num = n; break; 48 | } 49 | 50 | if (skey !== "") { 51 | ya.storage.set(skey, n); 52 | this.emit(ya.ekey.MD_ITEM_NUM_CHANGE, {mode: mode, num: n}); 53 | } 54 | 55 | }, 56 | 57 | addItemNum(mode, n) { 58 | let m = 0; 59 | switch(mode) { 60 | case ya.const.ITEM_MODE.MIX: 61 | m = this.item_mix_num + n; 62 | break; 63 | case ya.const.ITEM_MODE.DYE: 64 | m = this.item_dye_num + n; 65 | break; 66 | case ya.const.ITEM_MODE.BOMB: 67 | m = this.item_bomb_num + n; 68 | break; 69 | } 70 | 71 | this.setItemNum(mode, m); 72 | } 73 | 74 | }); -------------------------------------------------------------------------------- /assets/scripts/models/ItemModel.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "5f587b7a-fa49-4961-94b2-ac0e1682d3aa", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/models/ModelInit.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 缓存的初始化 4 | */ 5 | 6 | let ConfigModel = require("./ConfigModel"); 7 | 8 | let StarGameModel = require("./game/StarGameModel"); 9 | let UnionGameModel = require("./game/UnionGameModel"); 10 | let RussiaGameModel = require("./game/RussiaGameModel"); 11 | 12 | let ItemModel = require("./ItemModel"); 13 | 14 | cc.Class({ 15 | 16 | ctor() { 17 | this.cfg = new ConfigModel(); 18 | 19 | this.game = { 20 | star: new StarGameModel(), 21 | union: new UnionGameModel(), 22 | russia: new RussiaGameModel(), 23 | }; 24 | 25 | this.item = new ItemModel(); 26 | }, 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /assets/scripts/models/ModelInit.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "662a79c7-32be-4f17-8f62-f64c4d1f65da", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/models/UserModel.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 自己的数据 4 | */ 5 | 6 | let Model = require("../components/mvc/Model"); 7 | 8 | cc.Class({ 9 | extends: Model, 10 | 11 | properties: { 12 | 13 | } 14 | 15 | }); -------------------------------------------------------------------------------- /assets/scripts/models/UserModel.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "bde2f46f-bbeb-4e0c-96e3-2d8390a4f233", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/models/game.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "0e7b5904-e33a-4f3d-a7f4-1f0423641c4a", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/models/game/RussiaGameModel.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "51ee347d-7393-4c46-b56b-d02a3bf4a1fe", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/models/game/StarGameModel.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "7e68d8d1-18eb-436f-926e-5b90b69584c9", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/models/game/UnionGameModel.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "f84c7c42-59c4-4fc7-856b-4495c2b924f2", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "38969577-adee-40e8-8f9e-371a00f39193", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "e42ecd1b-6b6f-4b60-a69d-3cdd7c220bf0", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/AbstractGameController.js: -------------------------------------------------------------------------------- 1 | 2 | let Controller = require("../../components/mvc/Controller"); 3 | 4 | let SC = require("../../configs/game/StarConfig"); 5 | 6 | cc.Class({ 7 | 8 | extends: Controller, 9 | 10 | // override 11 | initModel() { 12 | this.game_mode = ya.const.GAME_MODE.STAR; 13 | 14 | this.model = ya.model.game.star; 15 | 16 | this.CFG = SC; 17 | }, 18 | 19 | initModuleEvent() { 20 | this.addModuleEvent(ya.ekey.EVT_GAME_OVER, this.onGameOver, this); 21 | this.addModuleEvent(ya.ekey.EVT_GAME_EXIT, this.onGameExit, this); 22 | this.addModuleEvent(ya.ekey.EVT_GAME_USE_DYE, this.onUseDye, this); 23 | this.addModuleEvent(ya.ekey.EVT_GAME_USE_BOMB, this.onUseBomb, this); 24 | this.addModuleEvent(ya.ekey.EVT_GAME_SHOW_ITEM, this.onShowItem, this); 25 | this.addModuleEvent(ya.ekey.EVT_GAME_ITEM_LACK, this.onItemLack, this); 26 | }, 27 | 28 | onGameOver() { 29 | let revive_mode = this.model.getReviveMode(); 30 | if (revive_mode === ya.const.REVIVE_MODE.NONE) { 31 | this.showSettle(); 32 | } 33 | else { 34 | ya.event.emit(ya.ekey.EVT_SHOW_REVIVE, { 35 | mode: revive_mode, 36 | score: this.model.score, 37 | revive_num: this.model.revive_num, 38 | total_num: this.CFG.REVIVE_NUM, 39 | success_cb: () => { 40 | this.reviveSuccess(); 41 | }, 42 | fail_cb: () => { 43 | this.showSettle(); 44 | } 45 | }); 46 | } 47 | }, 48 | 49 | // override 50 | showSettle() { 51 | this.reportWeekScore(); 52 | 53 | ya.event.emit(ya.ekey.EVT_SHOW_SETTLE, { 54 | mode: this.game_mode, 55 | score: this.model.score, 56 | restart_cb: () => { 57 | this.view.restart(); 58 | }, 59 | main_cb: () => { 60 | ya.mm.show("main", null, true); 61 | } 62 | }); 63 | }, 64 | // override 65 | reportWeekScore() { 66 | //清理存档 67 | ya.storage.clean(ya.skey.STAR_ARCHIVE); 68 | }, 69 | // override 70 | reviveSuccess() { 71 | this.model.revive_num += 1; 72 | 73 | this.view.revive(); 74 | }, 75 | reviveFail() { 76 | ya.mm.show("main", null, true); 77 | }, 78 | 79 | onGameExit() { 80 | ya.mm.show("main", null, true); 81 | }, 82 | 83 | onUseDye(params) { 84 | this.view.useItemDye(params); 85 | }, 86 | onUseBomb(params) { 87 | this.view.useItemBomb(params); 88 | }, 89 | 90 | onShowItem(params) { 91 | let items = params.items || []; 92 | let content = params.content; 93 | 94 | if (items.length <= 0) return; 95 | 96 | for (let i = 0; i < items.length; i++) { 97 | items[i] = {mode: items[i], num: 1}; 98 | } 99 | 100 | let add_item = (n) => { 101 | for (let i = 0; i < items.length; i++) { 102 | items[i].num = n; 103 | ya.model.item.addItemNum(items[i].mode, n); 104 | } 105 | this.view.runGotItemAction(items); 106 | }; 107 | 108 | let data = {}; 109 | data.items = items; 110 | data.content = content; 111 | data.got_mode = this.model.getItemGotMode(); 112 | data.normal_cb = () => { 113 | add_item(1); 114 | }; 115 | data.double_cb = () => { 116 | add_item(2); 117 | }; 118 | 119 | ya.event.emit(ya.ekey.EVT_SHOW_ITEM, data); 120 | }, 121 | 122 | onItemLack(params) { 123 | let mode = params.mode; 124 | let got_mode = params.got_mode; 125 | 126 | let add_item = ()=>{ 127 | ya.model.item.addItemNum(mode, 1); 128 | this.view.runGotItemAction([{mode: mode, num: 1}]); 129 | }; 130 | 131 | if (got_mode === ya.const.REVIVE_MODE.SHARE) { 132 | ya.platform.share({ 133 | title: ya.txt.share_title_common, 134 | imageUrl: ya.res.share_common_img, 135 | cb: (code)=>{ 136 | if (code === 0) { 137 | add_item(); 138 | } 139 | } 140 | }); 141 | } 142 | else if (got_mode === ya.const.REVIVE_MODE.VIDEO) { 143 | ya.platform.showVideoAd((is_ended)=>{ 144 | if (is_ended) { 145 | add_item(); 146 | } 147 | }); 148 | } 149 | else { 150 | ya.event.emit(ya.ekey.SHOW_TOAST, {txt: ya.txt.str_018}); 151 | } 152 | } 153 | 154 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/game/AbstractGameController.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "c561844e-d698-491f-8e4a-45b155df7f71", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/AbstractGameView.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "faee3895-bb90-4818-bb46-21d8b2f6b938", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/components.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "d26c1d73-4f6f-49ec-924d-1ddb1a1d83ac", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/components/Cube.js: -------------------------------------------------------------------------------- 1 | 2 | cc.Class({ 3 | extends: cc.Component, 4 | 5 | properties: { 6 | dst_color: null, 7 | duration: 0, 8 | color_mode: 0, 9 | }, 10 | 11 | fill(params) { 12 | this.color_mode = params.color_mode, 13 | 14 | this.node.rotation = params.rotation === undefined ? 0 : params.rotation; 15 | this.node.scale = params.scale === undefined ? 1.0 : params.scale; 16 | this.node.color = params.color === undefined ? cc.color(255, 255, 255) : params.color; 17 | this.node.anchorX = params.ax === undefined ? 0.5 : params.ax; 18 | this.node.anchorY = params.ay === undefined ? 0.5 : params.ay; 19 | this.node.opacity = params.opacity === undefined ? 255 : params.opacity; 20 | this.node.setContentSize(params.size || cc.size(10, 10)); 21 | 22 | let sprite = this.node.getComponent(cc.Sprite); 23 | let tex = sprite.spriteFrame && sprite.spriteFrame.getTexture(); 24 | let url = params.url || ya.tex.game_cube_square; 25 | if (!tex || tex.url !== url) { 26 | sprite.spriteFrame = ya.rm.getSpriteFrame(url); 27 | } 28 | }, 29 | 30 | init(params) { 31 | let sprite = this.node.addComponent(cc.Sprite); 32 | sprite.type = cc.Sprite.Type.SLICED; 33 | sprite.sizeMode = cc.Sprite.SizeMode.CUSTOM; 34 | this.fill(params); 35 | }, 36 | 37 | setSpriteFrame(url) { 38 | let sprite = this.node.getComponent(cc.Sprite); 39 | sprite.spriteFrame = ya.rm.getSpriteFrame(url); 40 | } 41 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/game/components/Cube.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "7d7ed886-5589-4a8b-8728-94e472a902d3", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/components/CubePool.js: -------------------------------------------------------------------------------- 1 | /* 2 | 方块生成器 3 | */ 4 | 5 | let Cube = require("./Cube"); 6 | 7 | let _instance; 8 | 9 | let CubePool = cc.Class({ 10 | statics: { 11 | getInstance() { 12 | if (!_instance) { 13 | _instance = new CubePool(); 14 | } 15 | return _instance; 16 | } 17 | }, 18 | 19 | ctor() { 20 | this.pool = new cc.NodePool(); 21 | }, 22 | 23 | get(params) { 24 | params = params || {}; 25 | let cube; 26 | if (this.pool.size() > 0) { 27 | cube = this.pool.get(); 28 | cube.getComponent("Cube").fill(params); 29 | } 30 | else { 31 | cube = new cc.Node(); 32 | let script = cube.addComponent(Cube); 33 | script.init(params); 34 | } 35 | 36 | return cube; 37 | }, 38 | 39 | put(cube) { 40 | this.pool.put(cube); 41 | } 42 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/game/components/CubePool.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "f2b51ed0-a086-4133-a450-29a8112ceb79", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/components/LikePool.js: -------------------------------------------------------------------------------- 1 | 2 | let _instance; 3 | 4 | let LikePool = cc.Class({ 5 | statics: { 6 | getInstance() { 7 | if (!_instance) { 8 | _instance = new LikePool(); 9 | } 10 | return _instance; 11 | } 12 | }, 13 | 14 | ctor() { 15 | this.pool = new cc.NodePool(); 16 | }, 17 | 18 | get(params) { 19 | params = params || {}; 20 | let node, lbl, out; 21 | if (this.pool.size() > 0) { 22 | node = this.pool.get(); 23 | lbl = node.getComponent(cc.Label); 24 | out = node.getComponent(cc.LabelOutline); 25 | } 26 | else { 27 | node = new cc.Node(); 28 | lbl = node.addComponent(cc.Label); 29 | out = node.addComponent(cc.LabelOutline); 30 | lbl.fontSize = 60; 31 | lbl.lineHeight = 150; 32 | lbl.horizontalAlign = cc.macro.TextAlignment.CENTER; 33 | lbl.verticalAlign =cc.macro.TextAlignment.CENTER; 34 | out.color = cc.color(255, 255, 255); 35 | out.width = 5; 36 | } 37 | 38 | node.setRotation(0); 39 | lbl.color = params.color || cc.color(255, 0, 0); 40 | lbl.string = params.str || ""; 41 | 42 | return node; 43 | }, 44 | 45 | put(node) { 46 | if (!node) return; 47 | 48 | node.stopAllActions(); 49 | 50 | this.pool.put(node); 51 | }, 52 | 53 | run(node) { 54 | node.opacity = 0; 55 | node.position = cc.v2(0, cc.winSize.height*0.6); 56 | node.runAction(cc.sequence( 57 | cc.spawn(cc.moveBy(0.2, cc.v2(cc.winSize.width*0.5, 0)), cc.fadeIn(0.5)), 58 | cc.spawn(cc.moveBy(0.5, cc.v2(0, 150)), cc.sequence(cc.scaleTo(0.25, 1.1), cc.scaleTo(0.25, 1.0))), 59 | cc.fadeOut(0.2), 60 | cc.callFunc(()=>{ 61 | this.put(node); 62 | }) 63 | )); 64 | }, 65 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/game/components/LikePool.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "3f1ae60a-921f-4850-a01b-7d2319d7b94e", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/digit.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "fed300cc-5184-4f5f-bd0f-a8181722cc6e", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/digit/DigitGameController.js: -------------------------------------------------------------------------------- 1 | 2 | let Controller = require("../../../components/mvc/Controller"); 3 | 4 | cc.Class({ 5 | 6 | extends: Controller, 7 | 8 | initView(params) { 9 | let prefab = cc.loader.getRes(ya.res.prefab_game_digit); 10 | let script = cc.instantiate(prefab).getComponent("DigitGameView"); 11 | script.init(params); 12 | return script; 13 | }, 14 | 15 | initGlobalEvent() { 16 | 17 | }, 18 | 19 | initModuleEvent() { 20 | 21 | }, 22 | 23 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/game/digit/DigitGameController.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "e794c39d-e8bf-4c3a-ae40-19857d66d3ac", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/digit/DigitGameView.js: -------------------------------------------------------------------------------- 1 | 2 | let View = require("../../../components/mvc/View"); 3 | 4 | cc.Class({ 5 | extends: View, 6 | 7 | initUI() { 8 | 9 | }, 10 | 11 | initData(params) { 12 | 13 | }, 14 | 15 | initEvent() { 16 | 17 | }, 18 | 19 | initClick() { 20 | 21 | } 22 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/game/digit/DigitGameView.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "27c1e3fa-d41b-4907-9b6a-21ff13af4d92", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/haul.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "e4dbd5c7-6a5c-446a-b781-04bf2a077af6", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/haul/HaulGameController.js: -------------------------------------------------------------------------------- 1 | 2 | let Controller = require("../../../components/mvc/Controller"); 3 | 4 | cc.Class({ 5 | 6 | extends: Controller, 7 | 8 | initView(params) { 9 | let prefab = cc.loader.getRes(ya.res.prefab_game_haul); 10 | let script = cc.instantiate(prefab).getComponent("HaulGameView"); 11 | script.init(params); 12 | return script; 13 | }, 14 | 15 | initGlobalEvent() { 16 | 17 | }, 18 | 19 | initModuleEvent() { 20 | 21 | }, 22 | 23 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/game/haul/HaulGameController.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "ca6b960c-5689-4ff2-a651-182c14478d2c", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/haul/HaulGameView.js: -------------------------------------------------------------------------------- 1 | 2 | let View = require("../../../components/mvc/View"); 3 | 4 | let Item = require("../../../widgets/Item"); 5 | 6 | cc.Class({ 7 | extends: View, 8 | 9 | properties: { 10 | nd_metion: cc.Node, 11 | }, 12 | 13 | initData(params) { 14 | 15 | }, 16 | 17 | initUI() { 18 | let item = new Item(); 19 | item.init({ mode: ya.const.ITEM_MODE.MIX, power: true, num: 199}); 20 | item.position = cc.v2(200, 200); 21 | this.node.addChild(item); 22 | }, 23 | 24 | initEvent() { 25 | 26 | }, 27 | 28 | initClick() { 29 | 30 | ya.utils.addTouchEvent(this.node, 31 | (event)=>{ 32 | 33 | }, 34 | (event)=>{ 35 | 36 | }, 37 | (event)=>{ 38 | 39 | }); 40 | }, 41 | 42 | onClick(event, name) { 43 | if (window['wx']) { 44 | let context = wx.getOpenDataContext(); 45 | if (name === "init") { 46 | context.postMessage({ action: ya.const.WX.AC_INIT }); 47 | } 48 | else if (name === "test") { 49 | context.postMessage({ action: ya.const.WX.AC_TEST }); 50 | } 51 | } 52 | }, 53 | 54 | onClickBlue() { 55 | }, 56 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/game/haul/HaulGameView.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "2986ead2-af9f-459b-b769-e76cb54d7e99", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/pop.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "bab36182-ff56-4853-9ae7-2b91785f0e8d", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/pop/PopGameController.js: -------------------------------------------------------------------------------- 1 | 2 | let Controller = require("../../../components/mvc/Controller"); 3 | 4 | cc.Class({ 5 | 6 | extends: Controller, 7 | 8 | initView(params) { 9 | let prefab = cc.loader.getRes(ya.res.prefab_game_pop); 10 | let script = cc.instantiate(prefab).getComponent("PopGameView"); 11 | script.init(params); 12 | return script; 13 | }, 14 | 15 | initGlobalEvent() { 16 | 17 | }, 18 | 19 | initModuleEvent() { 20 | 21 | }, 22 | 23 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/game/pop/PopGameController.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "eb1c8def-2a58-43a0-b368-6a0dd292199a", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/pop/PopGameView.js: -------------------------------------------------------------------------------- 1 | 2 | let View = require("../../../components/mvc/View"); 3 | 4 | cc.Class({ 5 | extends: View, 6 | 7 | initUI() { 8 | 9 | }, 10 | 11 | initData(params) { 12 | 13 | }, 14 | 15 | initEvent() { 16 | 17 | }, 18 | 19 | initClick() { 20 | 21 | } 22 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/game/pop/PopGameView.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "cde32bec-357c-46d0-b256-a07506266192", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/russia.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "41816aaf-fd4e-4fe9-9a4e-09c2ddd63c55", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/russia/RussiaGameController.js: -------------------------------------------------------------------------------- 1 | 2 | let AbstractGameController = require("../AbstractGameController"); 3 | 4 | let RC = require("../../../configs/game/RussiaConfig"); 5 | 6 | cc.Class({ 7 | 8 | extends: AbstractGameController, 9 | 10 | initModel() { 11 | this.game_mode = ya.const.GAME_MODE.RUSSIA; 12 | 13 | this.model = ya.model.game.russia; 14 | 15 | this.CFG = RC; 16 | }, 17 | 18 | initView(params) { 19 | let prefab = cc.loader.getRes(ya.res.prefab_game_russia); 20 | let script = cc.instantiate(prefab).getComponent("RussiaGameView"); 21 | script.init(params); 22 | return script; 23 | }, 24 | 25 | initGlobalEvent() { 26 | this._super(); 27 | }, 28 | 29 | initModuleEvent() { 30 | this._super(); 31 | }, 32 | 33 | reportWeekScore() { 34 | //清理存档 35 | ya.storage.clean(ya.skey.RUSSIA_ARCHIVE); 36 | 37 | let cur_time = new Date().getTime(); 38 | let cur_score = ya.model.game.russia.score; 39 | let week_score = ya.storage.int(ya.skey.RUSSIA_WEEK_SCORE, 0); 40 | let week_time = ya.storage.int(ya.skey.RUSSIA_WEEK_TIME, cur_time); 41 | let max_score = ya.storage.int(ya.skey.RUSSIA_MAX_SCORE, 0); 42 | 43 | if (!ya.utils.isSameWeek(week_time, cur_time)) { 44 | week_score = cur_score; 45 | } 46 | else { 47 | week_score = Math.max(week_score, cur_score); 48 | } 49 | max_score = Math.max(max_score, week_score); 50 | 51 | ya.storage.set(ya.skey.RUSSIA_WEEK_SCORE, week_score); 52 | ya.storage.set(ya.skey.RUSSIA_WEEK_TIME, cur_time); 53 | ya.storage.set(ya.skey.RUSSIA_MAX_SCORE, max_score); 54 | 55 | ya.platform.report({russia_score: week_score, russia_time: cur_time}); 56 | }, 57 | 58 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/game/russia/RussiaGameController.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "f79b7dbd-35b8-484b-9bc6-dec76ba8804e", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/russia/RussiaGameView.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "e5b87ba1-4138-4920-be5b-3840daf45975", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/russia/RussiaPool.js: -------------------------------------------------------------------------------- 1 | 2 | let RC = require("../../../configs/game/RussiaConfig"); 3 | let CP = require("../components/CubePool"); 4 | let cpinstance = CP.getInstance(); 5 | 6 | let _instance; 7 | 8 | let RussiaPool = cc.Class({ 9 | statics: { 10 | getInstance() { 11 | if (!_instance) { 12 | _instance = new RussiaPool(); 13 | } 14 | return _instance; 15 | }, 16 | }, 17 | 18 | ctor() { 19 | this.pool_shape = new cc.NodePool(); 20 | this.pool_motion = new cc.NodePool(); 21 | }, 22 | 23 | getCube(params) { 24 | return cpinstance.get(params); 25 | }, 26 | 27 | putCube(cube) { 28 | cpinstance.put(cube); 29 | }, 30 | 31 | createShape() { 32 | let node = new cc.Node(); 33 | node.anchorX = node.anchorY = 0; 34 | node.setContentSize(cc.size(RC.U_WIDTH, RC.U_WIDTH)); 35 | return node; 36 | }, 37 | 38 | getShape(map) { 39 | let shape; 40 | if (this.pool_shape.size() > 0) { 41 | shape = this.pool_shape.get(); 42 | } 43 | else { 44 | shape = this.createShape(); 45 | } 46 | shape.scale = 1.0; 47 | shape.opacity = 255; 48 | shape.position = cc.v2(0, 0); 49 | 50 | for (let i = 0, cube; i < RC.U_ROW; i++) { 51 | for (let j = 0; j < RC.U_COLUMN; j++) { 52 | if (map[i][j] !== RC.NONE) { 53 | cube = this.getCube({ 54 | color: RC.COLOR[map[i][j] || 1], 55 | size: cc.size(RC.WIDTH, RC.WIDTH) 56 | }); 57 | cube.position = this.getCubePosition(i, j); 58 | shape.addChild(cube); 59 | } 60 | } 61 | } 62 | 63 | return shape; 64 | }, 65 | 66 | putShape(shape) { 67 | if (!shape) return; 68 | 69 | while (shape.children.length > 0) { 70 | this.putCube(shape.children[0]); 71 | } 72 | this.pool_shape.put(shape); 73 | }, 74 | 75 | getCubePosition(r, c) { 76 | let x = c * (RC.GAP + RC.WIDTH) + 0.5 * RC.WIDTH; 77 | let y = r * (RC.GAP + RC.WIDTH) + 0.5 * RC.WIDTH; 78 | return cc.v2(x, y); 79 | }, 80 | 81 | getMotion(color) { 82 | let motion; 83 | if (this.pool_motion.size() > 0) { 84 | motion = this.pool_motion.get(); 85 | } 86 | else { 87 | motion = new cc.Node(); 88 | let streak = motion.addComponent(cc.MotionStreak); 89 | streak.fadeTime = 1.0; 90 | streak.minSeg = 1; 91 | streak.stroke = RC.WIDTH; 92 | streak.color = color || cc.color(255, 255, 255); 93 | streak.texture = cc.loader.getRes(ya.res.global_cube_square); 94 | } 95 | return motion; 96 | }, 97 | putMotion(motion) { 98 | motion.getComponent(cc.MotionStreak).reset(); 99 | this.pool_motion.put(motion); 100 | }, 101 | 102 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/game/russia/RussiaPool.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "1e533b29-dc99-4dcf-a4a0-5cd5f760b007", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/star.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "c9bbd16a-6d3c-412e-aa73-1caf2d10f4ff", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/star/StarGameController.js: -------------------------------------------------------------------------------- 1 | 2 | let AbstractGameController = require("../AbstractGameController"); 3 | 4 | let SC = require("../../../configs/game/StarConfig"); 5 | 6 | cc.Class({ 7 | 8 | extends: AbstractGameController, 9 | 10 | initModel() { 11 | this.game_mode = ya.const.GAME_MODE.STAR; 12 | 13 | this.model = ya.model.game.star; 14 | 15 | this.CFG = SC; 16 | }, 17 | 18 | initView(params) { 19 | let prefab = cc.loader.getRes(ya.res.prefab_game_star); 20 | let script = cc.instantiate(prefab).getComponent("StarGameView"); 21 | script.init(params); 22 | return script; 23 | }, 24 | 25 | initGlobalEvent() { 26 | this._super(); 27 | }, 28 | 29 | initModuleEvent() { 30 | this._super(); 31 | }, 32 | 33 | reportWeekScore() { 34 | //清理存档 35 | ya.storage.clean(ya.skey.STAR_ARCHIVE); 36 | 37 | let cur_time = new Date().getTime(); 38 | let cur_score = ya.model.game.star.score; 39 | let week_score = ya.storage.int(ya.skey.STAR_WEEK_SCORE, 0); 40 | let week_time = ya.storage.int(ya.skey.STAR_WEEK_TIME, cur_time); 41 | let max_score = ya.storage.int(ya.skey.STAR_MAX_SCORE, 0); 42 | 43 | if (!ya.utils.isSameWeek(week_time, cur_time)) { 44 | week_score = cur_score; 45 | } 46 | else { 47 | week_score = Math.max(week_score, cur_score); 48 | } 49 | max_score = Math.max(max_score, week_score); 50 | 51 | ya.storage.set(ya.skey.STAR_WEEK_SCORE, week_score); 52 | ya.storage.set(ya.skey.STAR_WEEK_TIME, cur_time); 53 | ya.storage.set(ya.skey.STAR_MAX_SCORE, max_score); 54 | 55 | ya.platform.report({star_score: week_score, star_time: cur_time}); 56 | }, 57 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/game/star/StarGameController.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "167d06cc-3b19-416a-a765-931ba9399608", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/star/StarGameView.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "07d61208-4d6d-4b60-bf56-5de8aac40a4c", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/star/StarItemView.js: -------------------------------------------------------------------------------- 1 | 2 | let View = require("../../../components/mvc/View"); 3 | 4 | let SC = require("../../../configs/game/StarConfig"); 5 | let SP = require("./StarPool"); 6 | let spinstance = SP.getInstance(); 7 | 8 | cc.Class({ 9 | extends: View, 10 | 11 | properties: { 12 | nd_mask: cc.Node, 13 | nd_map: cc.Node, 14 | 15 | lbl_tip: cc.Node, 16 | 17 | btn_cancel: cc.Node, 18 | 19 | container: cc.Node, 20 | }, 21 | 22 | initData(params) { 23 | this._super(params); 24 | 25 | this.selected_r = -1; 26 | this.selected_c = -1; 27 | this.cubes = []; 28 | 29 | this.mode = params.mode || ya.const.ITEM_MODE.DYE; 30 | }, 31 | 32 | initUI() { 33 | 34 | this.nd_map = this.node.getChildByName("nd_map"); 35 | this.nd_mask = this.node.getChildByName("nd_mask"); 36 | 37 | this.lbl_tip = this.nd_map.getChildByName("lbl_tip"); 38 | this.container = this.nd_map.getChildByName("container"); 39 | this.btn_cancel = this.container.getChildByName("btn_cancel"); 40 | 41 | let str = ""; 42 | if (this.mode === ya.const.ITEM_MODE.DYE) { 43 | str = ya.txt.str_011; 44 | } 45 | else { 46 | str = ya.txt.str_013; 47 | } 48 | this.lbl_tip.getComponent(cc.Label).string = str; 49 | 50 | this.runTipAction(); 51 | }, 52 | 53 | initClick() { 54 | ya.utils.addClickEvent(this.btn_cancel, ()=>{ 55 | this.onClickCancel(); 56 | }); 57 | 58 | let start_pos, end_pos; 59 | ya.utils.addTouchEvent(this.nd_map, 60 | (event)=>{ 61 | end_pos = event.touch.getLocation(); 62 | if (Math.abs(start_pos.x - end_pos.x) < 10 && 63 | Math.abs(start_pos.y - end_pos.y) < 10) 64 | { 65 | this.onClickMap(event.touch); 66 | } 67 | }, 68 | (event)=>{ 69 | 70 | }, 71 | (event)=>{ 72 | start_pos = event.touch.getLocation(); 73 | }); 74 | 75 | ya.utils.addClickEvent(this.node, (event) => { 76 | this.onClickCancel(); 77 | }); 78 | 79 | }, 80 | 81 | onClickCancel() { 82 | this.node.destroy(); 83 | }, 84 | 85 | onClickMap(touch) { 86 | let rc = this.getCubeIndex(touch.getLocation()); 87 | let map_data = ya.model.game.star.map; 88 | 89 | if (rc.r === -1 || rc.c === -1) return; 90 | 91 | if (map_data[rc.r][rc.c] !== SC.NONE) { 92 | 93 | this.selected_r = rc.r; 94 | this.selected_c = rc.c; 95 | 96 | if (this.mode === ya.const.ITEM_MODE.BOMB) { 97 | this.onClickBomb(); 98 | } 99 | else { 100 | this.container.active = true; 101 | 102 | this.resetContainer(rc.r, rc.c, map_data[rc.r][rc.c]); 103 | 104 | this.lbl_tip.getComponent(cc.Label).string = ya.txt.str_012; 105 | } 106 | } 107 | else { 108 | this.container.active = false; 109 | } 110 | }, 111 | onClickDye(color) { 112 | ya.event.emit(ya.ekey.EVT_GAME_USE_DYE, { 113 | r: this.selected_r, 114 | c: this.selected_c, 115 | color: color 116 | }); 117 | 118 | this.node.destroy(); 119 | }, 120 | onClickBomb() { 121 | ya.event.emit(ya.ekey.EVT_GAME_USE_BOMB, { 122 | r: this.selected_r, 123 | c: this.selected_c, 124 | }); 125 | 126 | this.node.destroy(); 127 | }, 128 | 129 | getCubeIndex(p) { 130 | p = this.nd_map.convertToNodeSpace(p); 131 | 132 | p.y -= SC.BORDER - SC.GAP; 133 | p.x -= SC.BORDER - SC.GAP; 134 | 135 | if (p.y < 0 || p.x < 0) { 136 | return { r: -1, c: -1 }; 137 | } 138 | 139 | let n = SC.WIDTH + SC.GAP; 140 | 141 | let r = ~~(p.y / n), c = ~~(p.x / n); 142 | 143 | r >= SC.ROW && (r = -1); 144 | c >= SC.COLUMN && (c = -1); 145 | 146 | return { r: r, c: c }; 147 | }, 148 | 149 | getCubePosition(i) { 150 | return cc.v2(-180 + i * 120, 0); 151 | }, 152 | 153 | resetContainer(r, c, color) { 154 | for (let i = 0, j = 0, cube; i < SC.COLOR_LIST.length; i++) { 155 | if (SC.COLOR_LIST[i] !== color) { 156 | cube = this.cubes[j] ? this.cubes[j] : spinstance.getCube(); 157 | spinstance.fill(cube, { 158 | color: SC.COLOR_LIST[i], 159 | url: ya.tex.game_cube_fillet, 160 | size: cc.size(100, 100) 161 | }); 162 | cube.position = this.getCubePosition(j); 163 | if (!cube.parent) { 164 | ya.utils.addClickEvent(cube, ()=>{ 165 | this.onClickDye(SC.COLOR_LIST[i]); 166 | }); 167 | this.container.addChild(cube); 168 | } 169 | this.cubes[j++] = cube; 170 | } 171 | } 172 | 173 | let size = this.container.getContentSize(); 174 | let x = c * (SC.WIDTH + SC.GAP) + SC.WIDTH * 0.5 + SC.BORDER; 175 | let y = r * (SC.WIDTH + SC.GAP) + SC.WIDTH * 0.5 + SC.BORDER + size.height; 176 | if (x < size.width * 0.5) x = size.width * 0.5; 177 | if (x + size.width * 0.5 > cc.winSize.width) x = cc.winSize.width - size.width * 0.5; 178 | 179 | this.container.position = cc.v2(x, y); 180 | }, 181 | 182 | runTipAction() { 183 | this.lbl_tip.runAction(cc.repeatForever(cc.sequence( 184 | cc.fadeTo(1, 100), 185 | cc.fadeIn(1) 186 | ))); 187 | }, 188 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/game/star/StarItemView.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "02a40b86-e18b-4206-84f7-3465878e0ad9", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/star/StarPool.js: -------------------------------------------------------------------------------- 1 | 2 | let CP = require("../components/CubePool"); 3 | let cpinstance = CP.getInstance(); 4 | 5 | let SC = require("../../../configs/game/StarConfig"); 6 | 7 | let _instance; 8 | 9 | let StarPool = cc.Class({ 10 | 11 | statics: { 12 | getInstance() { 13 | if (!_instance) { 14 | _instance = new StarPool(); 15 | } 16 | return _instance; 17 | } 18 | }, 19 | 20 | ctor() { 21 | this.pool_score = new cc.NodePool(); 22 | }, 23 | 24 | getUrl(color) { 25 | let url; 26 | switch(color) { 27 | case SC.RED: 28 | url = ya.tex.game_star_red; break; 29 | case SC.ORANGE: 30 | url = ya.tex.game_star_orange; break; 31 | case SC.YELLOW: 32 | url = ya.tex.game_star_yellow; break; 33 | case SC.GREEN: 34 | url = ya.tex.game_star_green; break; 35 | case SC.BLUE: 36 | url = ya.tex.game_star_blue; break; 37 | } 38 | return url; 39 | }, 40 | 41 | getCube(params) { 42 | params = params || {}; 43 | params.url = this.getUrl(params.color); 44 | params.color = cc.color(255, 255, 255); 45 | 46 | return cpinstance.get(params); 47 | }, 48 | fill(cube, params) { 49 | params.url = this.getUrl(params.color); 50 | params.color = cc.color(255, 255, 255); 51 | cube.getComponent("Cube").fill(params); 52 | }, 53 | setSpriteFrame(cube, color) { 54 | cube.getComponent("Cube").setSpriteFrame(this.getUrl(color)); 55 | }, 56 | 57 | putCube(cube) { 58 | cube.stopAllActions(); 59 | cpinstance.put(cube); 60 | }, 61 | 62 | createScore() { 63 | let score = new cc.Node(); 64 | let label = score.addComponent(cc.Label); 65 | return score; 66 | }, 67 | 68 | getScore(num) { 69 | let score; 70 | if (this.pool_score.size() > 0) { 71 | score = this.pool_score.get(); 72 | } 73 | else { 74 | score = this.createScore(); 75 | } 76 | score.scale = 1.0; 77 | score.getComponent(cc.Label).string = num.toString(); 78 | return score; 79 | }, 80 | 81 | putScore(score) { 82 | this.pool_score.put(score); 83 | } 84 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/game/star/StarPool.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "cf9b9408-f29d-457a-9d3a-1226472a4aee", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/union.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "cf5767e8-ea1c-4257-a71c-076235d043f1", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/union/UnionGameController.js: -------------------------------------------------------------------------------- 1 | 2 | let AbstractGameController = require("../AbstractGameController"); 3 | 4 | let UC = require("../../../configs/game/UnionConfig"); 5 | 6 | cc.Class({ 7 | 8 | extends: AbstractGameController, 9 | 10 | initModel() { 11 | this.game_mode = ya.const.GAME_MODE.UNION; 12 | 13 | this.model = ya.model.game.union; 14 | 15 | this.CFG = UC; 16 | }, 17 | 18 | initView(params) { 19 | let prefab = cc.loader.getRes(ya.res.prefab_game_union); 20 | let script = cc.instantiate(prefab).getComponent("UnionGameView"); 21 | script.init(params); 22 | return script; 23 | }, 24 | 25 | initGlobalEvent() { 26 | this._super(); 27 | }, 28 | 29 | initModuleEvent() { 30 | this._super(); 31 | }, 32 | 33 | reportWeekScore() { 34 | //清理存档 35 | ya.storage.clean(ya.skey.UNION_ARCHIVE); 36 | 37 | let cur_score = this.model.score; 38 | let cur_time = new Date().getTime(); 39 | let week_score = ya.storage.int(ya.skey.UNION_WEEK_SCORE, 0); 40 | let week_time = ya.storage.int(ya.skey.UNION_WEEK_TIME, cur_time); 41 | let max_score = ya.storage.int(ya.skey.UNION_MAX_SCORE, 0); 42 | 43 | if (!ya.utils.isSameWeek(week_time, cur_time)) { 44 | week_score = cur_score; 45 | } 46 | else { 47 | week_score = Math.max(week_score, cur_score); 48 | } 49 | max_score = Math.max(max_score, week_score); 50 | 51 | ya.storage.set(ya.skey.UNION_WEEK_SCORE, week_score); 52 | ya.storage.set(ya.skey.UNION_WEEK_TIME, cur_time); 53 | ya.storage.set(ya.skey.UNION_MAX_SCORE, max_score); 54 | 55 | ya.platform.report({ union_score: week_score, union_time: cur_time}); 56 | }, 57 | 58 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/game/union/UnionGameController.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "36f631b3-195e-4d74-9268-5c15669dbaf2", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/union/UnionGameView.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "2a46147c-a47e-436b-963b-6fee79cd07e9", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/union/UnionItemView.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "ac30816f-ae51-47d0-aead-f90f5d169012", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/game/union/UnionPool.js: -------------------------------------------------------------------------------- 1 | 2 | let CP = require("../components/CubePool"); 3 | let cpinstance = CP.getInstance(); 4 | 5 | let _instance; 6 | 7 | let UnionPool = cc.Class({ 8 | 9 | statics: { 10 | getInstance() { 11 | if (!_instance) { 12 | _instance = new UnionPool(); 13 | } 14 | return _instance; 15 | } 16 | }, 17 | 18 | ctor() { 19 | this.pool_digit = new cc.NodePool(); 20 | }, 21 | 22 | getCube(params) { 23 | let cube = cpinstance.get(params); 24 | let digit = this.getDigit(params.num); 25 | digit.setName("digit"); 26 | cube.addChild(digit); 27 | return cube; 28 | }, 29 | 30 | putCube(cube) { 31 | cube.stopAllActions(); 32 | 33 | this.putDigit(cube.getChildByName("digit")); 34 | 35 | cpinstance.put(cube); 36 | }, 37 | 38 | createDigit(str) { 39 | let node = new cc.Node(); 40 | let label = node.addComponent(cc.Label); 41 | label.string = str || ""; 42 | return node; 43 | }, 44 | 45 | getDigit(num) { 46 | let node; 47 | if (this.pool_digit.size() > 0) { 48 | node = this.pool_digit.get(); 49 | } 50 | else { 51 | node = this.createDigit(); 52 | } 53 | node.scale = 1.0; 54 | node.getComponent(cc.Label).string = (num < 2 ? "" : num).toString(); 55 | return node; 56 | }, 57 | 58 | setCubeColor(cube, color) { 59 | cube.color = color; 60 | }, 61 | setCubeDigit(cube, num) { 62 | let str = (num < 2 ? "" : num).toString(); 63 | cube.getChildByName("digit").getComponent(cc.Label).string = str; 64 | }, 65 | 66 | putDigit(node) { 67 | this.pool_digit.put(node); 68 | } 69 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/game/union/UnionPool.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "e65c1443-8bb8-4366-a1aa-fd114d0d77a3", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/global.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "34fe8d4e-e654-4f8d-b9ee-21eed0817932", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/global/GlobalController.js: -------------------------------------------------------------------------------- 1 | /* 2 | 全局控制器 3 | 任何全局性的东西都可以放到这里 4 | */ 5 | 6 | let Controller = require("../../components/mvc/Controller"); 7 | 8 | let GlobalView = require("./GlobalView"); 9 | 10 | cc.Class({ 11 | extends: Controller, 12 | 13 | properties: { 14 | 15 | root: { 16 | override: true, 17 | get() { 18 | return ya.layer.top; 19 | } 20 | }, 21 | }, 22 | 23 | ctor() { 24 | 25 | }, 26 | 27 | initView() { 28 | let node = new cc.Node(); 29 | let script = node.addComponent(GlobalView); 30 | script.init(); 31 | return script; 32 | }, 33 | 34 | initGlobalEvent() { 35 | //前后台切换-切前台监听 36 | cc.game.on(cc.game.EVENT_SHOW, (params)=>{ 37 | 38 | }); 39 | 40 | //前后台切换-切后台监听 41 | cc.game.on(cc.game.EVENT_HIDE, ()=>{ 42 | 43 | }); 44 | 45 | //监听切前台 46 | ya.event.on(ya.ekey.ON_SHOW, this.onShow, this); 47 | //监听切后台 48 | ya.event.on(ya.ekey.ON_HIDE, this.onHide, this); 49 | 50 | //显示等待界面 51 | ya.event.on(ya.ekey.SHOW_WAITTING, this.onShowWaitting, this); 52 | //移除等待界面 53 | ya.event.on(ya.ekey.REMOVE_WAITTING, this.onRemoveWaitting, this); 54 | 55 | ya.event.on(ya.ekey.SHOW_TOAST, this.onShowToast, this); 56 | 57 | }, 58 | 59 | onShow(params) { 60 | 61 | }, 62 | onHide() { 63 | 64 | }, 65 | 66 | onShowWaitting() { 67 | 68 | }, 69 | 70 | onRemoveWaitting() { 71 | 72 | }, 73 | 74 | onShowToast(params) { 75 | this.view.showToast(params); 76 | }, 77 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/global/GlobalController.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "52704a60-e5fb-46af-91eb-19727e04fd9c", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/global/GlobalView.js: -------------------------------------------------------------------------------- 1 | 2 | let View = require("../../components/mvc/View"); 3 | 4 | let Toast = require("./subviews/Toast"); 5 | 6 | cc.Class({ 7 | extends: View, 8 | 9 | properties: { 10 | 11 | }, 12 | 13 | initData() { 14 | this.pool_toast = new cc.NodePool(); 15 | }, 16 | 17 | showToast(params) { 18 | let node, script; 19 | if (this.pool_toast.size() > 0) { 20 | node = this.pool_toast.get(); 21 | script = node.getComponent("Toast"); 22 | } 23 | else { 24 | node = new cc.Node(); 25 | script = node.addComponent(Toast); 26 | script.init(); 27 | } 28 | 29 | script.setData(params); 30 | 31 | node.position = cc.v2(cc.winSize.width*0.5, cc.winSize.height*0.6); 32 | this.node.addChild(node); 33 | 34 | script.show(()=>{ 35 | this.pool_toast.put(node); 36 | }); 37 | }, 38 | 39 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/global/GlobalView.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "e8ffe985-b83e-4e8f-9f5c-a76cd201359c", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/global/subviews.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "775ba768-d193-4d88-b280-3c4cc0c91cca", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/global/subviews/Toast.js: -------------------------------------------------------------------------------- 1 | 2 | cc.Class({ 3 | extends: cc.Component, 4 | 5 | init() { 6 | this.node.setContentSize(cc.size(600, 100)); 7 | 8 | let img_bg = new cc.Node(); 9 | let sprite = img_bg.addComponent(cc.Sprite); 10 | sprite.type = cc.Sprite.Type.SLICED; 11 | sprite.sizeMode = cc.Sprite.SizeMode.CUSTOM; 12 | sprite.spriteFrame = ya.rm.getSpriteFrame(ya.tex.game_cube_square); 13 | img_bg.color = cc.color(80, 80, 80); 14 | img_bg.setContentSize(cc.size(600, 50)); 15 | this.node.addChild(img_bg); 16 | 17 | let node = new cc.Node(); 18 | this.lbl_str = node.addComponent(cc.Label); 19 | this.lbl_str.fontSize = 25; 20 | this.lbl_str.lineHeight = 25; 21 | this.node.addChild(node); 22 | }, 23 | 24 | setData(params) { 25 | let txt = params.txt; 26 | this.lbl_str.string = txt; 27 | }, 28 | 29 | show(cb) { 30 | this.node.runAction(cc.sequence( 31 | cc.spawn(cc.fadeIn(0.5), cc.moveBy(0.5, cc.v2(0, 50))), 32 | cc.delayTime(1.8), 33 | cc.fadeOut(0.2), 34 | cc.callFunc(()=>{ 35 | cb && cb(); 36 | }) 37 | )); 38 | } 39 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/global/subviews/Toast.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "25509047-2145-403d-96c6-662b21b012bd", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/item.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "8bb75ecf-6d46-4a57-9bab-18a47613b29d", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/item/ItemController.js: -------------------------------------------------------------------------------- 1 | 2 | let Controller = require("../../components/mvc/Controller"); 3 | 4 | cc.Class({ 5 | extends: Controller, 6 | 7 | properties: { 8 | id_item: -1, 9 | id_basket: -1, 10 | }, 11 | 12 | initGlobalEvent() { 13 | ya.event.on(ya.ekey.EVT_SHOW_ITEM, this.onShowItem, this); 14 | ya.event.on(ya.ekey.EVT_SHOW_BASKET, this.onShowBasket, this); 15 | }, 16 | 17 | onShowItem(params) { 18 | this.id_item = ya.dm.push({ 19 | prefab: ya.res.prefab_item, 20 | script: "ItemView", 21 | init_data: params, 22 | loadded_data: true, show_type: 1 23 | }); 24 | ya.dm.pop(); 25 | }, 26 | 27 | onShowBasket(params) { 28 | this.id_item = ya.dm.push({ 29 | prefab: ya.res.prefab_basket, 30 | script: "BasketView", 31 | init_data: params, 32 | loadded_data: true, show_type: 1 33 | }); 34 | ya.dm.pop(); 35 | }, 36 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/item/ItemController.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "c35c8036-c819-47b9-938b-8d1d2d4194bc", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/item/ItemView.js: -------------------------------------------------------------------------------- 1 | let Dialog = require("../../components/mvc/Dialog"); 2 | 3 | let Item = require("../../widgets/Item"); 4 | 5 | cc.Class({ 6 | extends: Dialog, 7 | 8 | properties: { 9 | nd_item: cc.Node, 10 | lbl_content: cc.Node, 11 | 12 | btn_normal: cc.Node, 13 | btn_double: cc.Node, 14 | }, 15 | 16 | initData(params) { 17 | this._super(params); 18 | 19 | let d = this.init_data; 20 | this.got_mode = d.got_mode; 21 | this.normal_cb = d.normal_cb; 22 | this.double_cb = d.double_cb; 23 | this.content = d.content; 24 | this.items = d.items; 25 | }, 26 | 27 | initUI() { 28 | let x = -0.5 * (this.items.length - 1) * 150; 29 | for (let i = 0, item; i < this.items.length; i++) { 30 | item = new Item(); 31 | item.init(this.items[i]); 32 | item.x = x; 33 | this.node.addChild(item); 34 | x += 150; 35 | } 36 | 37 | this.btn_normal.active = false; 38 | 39 | let dobule_str = ""; 40 | if (this.got_mode === ya.const.REVIVE_MODE.NONE || 41 | this.got_mode === ya.const.REVIVE_MODE.FREE) 42 | { 43 | dobule_str = ya.txt.str_019; 44 | } 45 | else if (this.got_mode === ya.const.REVIVE_MODE.SHARE) { 46 | dobule_str = ya.txt.str_022; 47 | } 48 | else if (this.got_mode === ya.const.REVIVE_MODE.VIDEO) { 49 | dobule_str = ya.txt.str_023; 50 | } 51 | this.btn_double.getChildByName("Label").getComponent(cc.Label).string = dobule_str; 52 | 53 | this.lbl_content.getComponent(cc.Label).string = this.content; 54 | }, 55 | 56 | initEvent() { 57 | 58 | }, 59 | 60 | initClick() { 61 | ya.utils.addClickEvent(this.btn_normal, ()=>{ 62 | this.removeSelf(); 63 | this.normal_cb && this.normal_cb(); 64 | }); 65 | 66 | ya.utils.addClickEvent(this.btn_double, ()=>{ 67 | this.onClickDouble(); 68 | }); 69 | }, 70 | 71 | onClickDouble() { 72 | if (this.got_mode === ya.const.REVIVE_MODE.SHARE) { 73 | ya.platform.share({ 74 | title: ya.txt.share_title_common, 75 | imageUrl: ya.res.share_common_img, 76 | cb: (code)=>{ 77 | if (code === 0) { 78 | this.removeSelf(); 79 | this.double_cb && this.double_cb(); 80 | } 81 | } 82 | }); 83 | } 84 | else if (this.got_mode === ya.const.REVIVE_MODE.VIDEO) { 85 | ya.platform.showVideoAd((is_ended)=>{ 86 | if (is_ended) { 87 | this.removeSelf(); 88 | this.double_cb && this.double_cb(); 89 | } 90 | }); 91 | } 92 | else if (this.got_mode === ya.const.REVIVE_MODE.NONE || 93 | this.got_mode === ya.const.REVIVE_MODE.FREE) 94 | { 95 | this.removeSelf(); 96 | this.normal_cb && this.normal_cb(); 97 | } 98 | }, 99 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/item/ItemView.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "3c097915-01d6-4b72-8c07-0ca56c472254", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/loading.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "668aed3d-4906-4d2d-9db4-7ca1f1ccb26b", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/loading/LoadingController.js: -------------------------------------------------------------------------------- 1 | /* 2 | 加载界面控制器 3 | */ 4 | 5 | let Controller = require("../../components/mvc/Controller"); 6 | 7 | let LoadingView = require("./LoadingView"); 8 | 9 | cc.Class({ 10 | extends: Controller, 11 | 12 | ctor() { 13 | 14 | }, 15 | 16 | initView(params) { 17 | let node = new cc.Node(); 18 | let script = node.addComponent(LoadingView); 19 | script.init(params); 20 | return script; 21 | }, 22 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/loading/LoadingController.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "910fcf92-57bb-4847-a079-20b3d5d2c03b", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/loading/LoadingView.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 加载界面 4 | */ 5 | 6 | let View = require("../../components/mvc/View"); 7 | 8 | cc.Class({ 9 | extends: View, 10 | 11 | properties: { 12 | 13 | }, 14 | 15 | initData() { 16 | ya.model.cfg.init(); 17 | }, 18 | 19 | initUI() { 20 | ya.rm.checkLoad("main", () => { 21 | ya.mm.show("main"); 22 | 23 | setTimeout(()=>{ 24 | ya.music.sineInMusic(ya.res.sound_bgm, true); 25 | }, 500); 26 | 27 | }); 28 | }, 29 | 30 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/loading/LoadingView.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "398c8e2c-005b-488e-a275-2323881bdfc2", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/login.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "58dca124-cbe4-443f-a332-fc35fc1cb249", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/login/LoginController.js: -------------------------------------------------------------------------------- 1 | /* 2 | 登录界面控制器 3 | */ 4 | 5 | let Controller = require("../../components/mvc/Controller"); 6 | 7 | cc.Class({ 8 | extends: Controller, 9 | 10 | ctor() { 11 | 12 | }, 13 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/login/LoginController.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "49d5e742-5a7e-4424-b787-f2fa1c96b973", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/login/LoginView.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 登录界面 4 | */ 5 | 6 | let View = require("../../components/mvc/View"); 7 | 8 | cc.Class({ 9 | extends: View, 10 | 11 | properties: { 12 | 13 | } 14 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/login/LoginView.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "ba208cf7-b3fc-446d-9c52-ee4ec81c2968", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/main.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "cdcd5897-5933-4e2d-8085-41544277faa9", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/main/MainController.js: -------------------------------------------------------------------------------- 1 | 2 | let Controller = require("../../components/mvc/Controller"); 3 | 4 | cc.Class({ 5 | extends: Controller, 6 | 7 | ctor() { 8 | 9 | }, 10 | 11 | initView(params) { 12 | let prefab = cc.loader.getRes(ya.res.prefab_main); 13 | let script = cc.instantiate(prefab).getComponent("MainView"); 14 | script.init(params); 15 | 16 | return script; 17 | }, 18 | 19 | initGlobalEvent() { 20 | ya.event.on(ya.ekey.EVT_SHOW_ARCHIVE, this.onShowArchive, this); 21 | }, 22 | 23 | initModuleEvent() { 24 | 25 | }, 26 | 27 | onShowArchive(params) { 28 | ya.rm.checkLoad("archive", ()=>{ 29 | ya.dm.push({ 30 | prefab: ya.res.prefab_archive, 31 | script: "ArchiveView", 32 | init_data: params, 33 | loadded_data: true, show_type: 1 34 | }); 35 | ya.dm.pop(); 36 | }); 37 | }, 38 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/main/MainController.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "24e7b6ed-2d42-4bba-9b0b-05c5f77ff8bb", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/main/MainView.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "8b4fc89e-c39e-4c85-acb3-16b3b1505551", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/main/subviews.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "4321f6fc-8f1b-43c6-9e87-67e024181c6e", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/main/subviews/ArchiveView.js: -------------------------------------------------------------------------------- 1 | 2 | let Dialog = require("../../../components/mvc/Dialog"); 3 | 4 | cc.Class({ 5 | extends: Dialog, 6 | 7 | properties: { 8 | btn_close: cc.Node, 9 | btn_continue: cc.Node, 10 | btn_restart: cc.Node, 11 | }, 12 | 13 | initData(params) { 14 | this._super(params); 15 | 16 | let d = this.init_data; 17 | this.continue_cb = d.continue_cb; 18 | this.restart_cb = d.restart_cb; 19 | }, 20 | 21 | initUI() { 22 | 23 | }, 24 | 25 | initClick() { 26 | ya.utils.addClickEvent(this.btn_close, ()=>{ 27 | this.onClickClose(); 28 | }); 29 | ya.utils.addClickEvent(this.btn_continue, ()=>{ 30 | this.onClickContinue(); 31 | }); 32 | ya.utils.addClickEvent(this.btn_restart, ()=>{ 33 | this.onClickRestart(); 34 | }); 35 | }, 36 | 37 | onClickClose() { 38 | this.removeSelf(); 39 | }, 40 | onClickContinue() { 41 | this.removeSelf(); 42 | 43 | this.continue_cb && this.continue_cb(); 44 | }, 45 | onClickRestart() { 46 | this.removeSelf(); 47 | 48 | this.restart_cb && this.restart_cb(); 49 | }, 50 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/main/subviews/ArchiveView.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "308433a9-6fe9-4e61-82bd-78fbef5d7c62", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/rank.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "affe5e29-8302-4f3c-bb7e-a01c163611d1", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/rank/RankController.js: -------------------------------------------------------------------------------- 1 | 2 | let Controller = require("../../components/mvc/Controller"); 3 | 4 | cc.Class({ 5 | extends: Controller, 6 | 7 | properties: { 8 | id_rank: -1, 9 | }, 10 | 11 | ctor() { 12 | 13 | }, 14 | 15 | initView(params) { 16 | let prefab = cc.loader.getRes(ya.res.prefab_rank); 17 | let script = cc.instantiate(prefab).getComponent("RankView"); 18 | script.init(params); 19 | return script; 20 | }, 21 | 22 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/rank/RankController.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "10c5ab4e-2396-48f0-9686-4168e6712af5", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/rank/RankView.js: -------------------------------------------------------------------------------- 1 | 2 | let View = require("../../components/mvc/View"); 3 | 4 | cc.Class({ 5 | extends: View, 6 | 7 | properties: { 8 | nd_rank: cc.Node, 9 | img_rank: cc.Node, 10 | 11 | btn_star: cc.Node, 12 | btn_union: cc.Node, 13 | btn_russia: cc.Node, 14 | }, 15 | 16 | initData(params) { 17 | this._super(params); 18 | 19 | let d = this.init_data || {}; 20 | this.mode = d.mode || ya.const.GAME_MODE.STAR; 21 | 22 | this.view_width = 500; 23 | this.view_height = 790; 24 | 25 | this.is_support_wx = CC_WECHATGAME && (!!(window['wx'] && window['wx'].getOpenDataContext)); 26 | }, 27 | 28 | initUI() { 29 | let action = 0; 30 | if (this.mode === ya.const.GAME_MODE.STAR) { 31 | action = ya.const.WX.AC_F_STAR_FETCH; 32 | } 33 | else if (this.mode === ya.const.GAME_MODE.UNION) { 34 | action = ya.const.WX.AC_F_UNION_FETCH; 35 | } 36 | else if (this.mode === ya.const.GAME_MODE.RUSSIA) { 37 | action = ya.const.WX.AC_F_RUSSIA_FETCH; 38 | } 39 | 40 | if (this.is_support_wx) { 41 | let canvas = wx.getOpenDataContext().canvas; 42 | canvas.width = this.view_width; 43 | canvas.height = this.view_height; 44 | 45 | this._wx_tex = new cc.Texture2D(); 46 | this._wx_spriteframe = new cc.SpriteFrame(); 47 | 48 | window['wx'].getOpenDataContext().postMessage({ action: action }); 49 | } 50 | }, 51 | 52 | initEvent() { 53 | 54 | }, 55 | 56 | initClick() { 57 | if (this.is_support_wx) { 58 | this.nd_rank.on(cc.Node.EventType.TOUCH_MOVE, (event) => { 59 | this.onMove(event); 60 | }, this); 61 | } 62 | 63 | ya.utils.addClickEvent(this.btn_star, ()=>{ 64 | this.onClickStar(); 65 | }); 66 | ya.utils.addClickEvent(this.btn_union, ()=>{ 67 | this.onClickUnion(); 68 | }); 69 | ya.utils.addClickEvent(this.btn_russia, ()=>{ 70 | this.onClickRussia(); 71 | }); 72 | }, 73 | 74 | update(dt) { 75 | if (this.is_support_wx) { 76 | this._wx_tex.initWithElement(window['wx'].getOpenDataContext().canvas); 77 | this._wx_tex.handleLoadedTexture(); 78 | this._wx_spriteframe.setTexture(this._wx_tex); 79 | this.img_rank.getComponent(cc.Sprite).spriteFrame = this._wx_spriteframe; 80 | } 81 | }, 82 | 83 | onMove(event) { 84 | let touch = event.touch; 85 | let curp = touch.getLocation(); 86 | let prep = touch.getPreviousLocation(); 87 | 88 | let action = ya.const.WX.AC_SCROLL_V; 89 | if (this.is_support_wx) { 90 | window['wx'].getOpenDataContext().postMessage({ action: action, offsety: curp.y - prep.y }); 91 | } 92 | }, 93 | 94 | onClickClose() { 95 | ya.mm.show("main", null, true); 96 | }, 97 | 98 | onClickStar() { 99 | if (this.mode === ya.const.GAME_MODE.STAR) return; 100 | 101 | this.mode = ya.const.GAME_MODE.STAR; 102 | 103 | if (this.is_support_wx) { 104 | window['wx'].getOpenDataContext().postMessage({ action: ya.const.WX.AC_F_STAR_FETCH }); 105 | } 106 | }, 107 | onClickUnion() { 108 | if (this.mode === ya.const.GAME_MODE.UNION) return; 109 | 110 | this.mode = ya.const.GAME_MODE.UNION; 111 | 112 | if (this.is_support_wx) { 113 | window['wx'].getOpenDataContext().postMessage({ action: ya.const.WX.AC_F_UNION_FETCH }); 114 | } 115 | }, 116 | 117 | onClickRussia() { 118 | if (this.mode === ya.const.GAME_MODE.RUSSIA) return; 119 | 120 | this.mode = ya.const.GAME_MODE.RUSSIA; 121 | 122 | if (this.is_support_wx) { 123 | window['wx'].getOpenDataContext().postMessage({ action: ya.const.WX.AC_F_RUSSIA_FETCH }); 124 | } 125 | }, 126 | 127 | }); 128 | -------------------------------------------------------------------------------- /assets/scripts/modules/rank/RankView.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "96734c64-b0f8-4a92-887b-b85c300220a6", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/revive.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "53fc6d3b-c101-4d49-bd92-48eccbb6d35f", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/revive/ReviveController.js: -------------------------------------------------------------------------------- 1 | 2 | let Controller = require("../../components/mvc/Controller"); 3 | 4 | cc.Class({ 5 | extends: Controller, 6 | 7 | properties: { 8 | id_revive: -1, 9 | }, 10 | 11 | ctor() { 12 | 13 | }, 14 | 15 | initGlobalEvent() { 16 | ya.event.on(ya.ekey.EVT_SHOW_REVIVE, this.onShowRevive, this); 17 | }, 18 | 19 | onShowRevive(params) { 20 | ya.rm.checkLoad("revive", ()=>{ 21 | this.id_revive = ya.dm.push({ 22 | prefab: ya.res.prefab_revive, 23 | script: "ReviveView", 24 | init_data: params, 25 | loadded_data: true, show_type: 1 26 | }); 27 | ya.dm.pop(); 28 | }); 29 | } 30 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/revive/ReviveController.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "548230a7-df45-49a9-aeb9-b52e4bcc0c10", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/revive/ReviveView.js: -------------------------------------------------------------------------------- 1 | 2 | let Dialog = require("../../components/mvc/Dialog"); 3 | 4 | cc.Class({ 5 | extends: Dialog, 6 | 7 | properties: { 8 | lbl_tip: cc.Label, 9 | 10 | lbl_revive_txt: cc.Label, 11 | }, 12 | 13 | initData(params) { 14 | this._super(params); 15 | 16 | let d = this.init_data; 17 | this.mode = d.mode; 18 | this.score = d.score; 19 | this.revive_num = d.revive_num; 20 | this.total_num = d.total_num; 21 | this.success_cb = d.success_cb; 22 | this.fail_cb = d.fail_cb; 23 | }, 24 | 25 | initUI() { 26 | ya.music.playEffect(ya.res.sound_die); 27 | 28 | let str = cc.js.formatStr(ya.txt.str_004, this.revive_num, this.total_num); 29 | 30 | this.lbl_tip.string = str; 31 | 32 | if (this.mode === ya.const.REVIVE_MODE.FREE) { 33 | this.lbl_revive_txt.string = ya.txt.str_001; 34 | } 35 | else if (this.mode === ya.const.REVIVE_MODE.SHARE) { 36 | this.lbl_revive_txt.string = ya.txt.str_002; 37 | } 38 | else if (this.mode === ya.const.REVIVE_MODE.VIDEO) { 39 | this.lbl_revive_txt.string = ya.txt.str_003; 40 | } 41 | }, 42 | 43 | initEvent() { 44 | 45 | }, 46 | 47 | onClickClose() { 48 | this.fail_cb && this.fail_cb(); 49 | 50 | this.removeSelf(); 51 | }, 52 | 53 | onClickSpace() { 54 | // this.onClickClose(); 55 | }, 56 | 57 | onClickRevive() { 58 | if (this.mode === ya.const.REVIVE_MODE.FREE) { 59 | this.reviveSuccess(); 60 | } 61 | else if (this.mode === ya.const.REVIVE_MODE.SHARE) { 62 | ya.platform.share({ 63 | title: cc.js.formatStr(ya.txt.share_title_revive, this.score), 64 | imageUrl: ya.res.image_share_revive, 65 | cb: (code, res)=>{ 66 | if (code === 0) { 67 | this.reviveSuccess(); 68 | } 69 | } 70 | }); 71 | } 72 | else if (this.mode === ya.const.REVIVE_MODE.VIDEO) { 73 | ya.platform.showVideoAd((is_ended)=>{ 74 | if (is_ended) { 75 | this.reviveSuccess(); 76 | } 77 | }); 78 | } 79 | }, 80 | 81 | reviveSuccess() { 82 | this.success_cb && this.success_cb(); 83 | 84 | this.removeSelf(); 85 | }, 86 | }); 87 | -------------------------------------------------------------------------------- /assets/scripts/modules/revive/ReviveView.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "417dad31-4732-4aec-91ba-28981a632997", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/setting.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "d0ee2562-6ed9-4c03-9bec-938229f8be70", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/setting/PauseView.js: -------------------------------------------------------------------------------- 1 | 2 | let Dialog = require("../../components/mvc/Dialog"); 3 | 4 | cc.Class({ 5 | extends: Dialog, 6 | 7 | properties: { 8 | 9 | lbl_sound: cc.Label, 10 | 11 | btn_close: cc.Node, 12 | btn_continue: cc.Node, 13 | btn_restart: cc.Node, 14 | btn_main: cc.Node, 15 | btn_sound: cc.Node, 16 | 17 | }, 18 | 19 | initData(params) { 20 | this._super(params); 21 | 22 | let d = this.init_data; 23 | this.continue_cb = d.continue_cb; 24 | this.restart_cb = d.restart_cb; 25 | this.main_cb = d.main_cb; 26 | 27 | }, 28 | 29 | initUI() { 30 | 31 | let enabled = ya.storage.bool(ya.skey.EFFECT_ENABLED, true); 32 | this.lbl_sound.string = enabled ? ya.txt.str_005 : ya.txt.str_006; 33 | }, 34 | 35 | initClick() { 36 | ya.utils.addClickEvent(this.btn_close, ()=>{ 37 | this.onClickClose(); 38 | }) 39 | ya.utils.addClickEvent(this.btn_continue, ()=>{ 40 | this.onClickContinue(); 41 | }) 42 | ya.utils.addClickEvent(this.btn_restart, ()=>{ 43 | this.onClickRestart(); 44 | }) 45 | ya.utils.addClickEvent(this.btn_main, ()=>{ 46 | this.onClickMain(); 47 | }) 48 | ya.utils.addClickEvent(this.btn_sound, ()=>{ 49 | this.onClickSound(); 50 | }) 51 | }, 52 | 53 | onClickClose() { 54 | this.removeSelf(); 55 | 56 | this.continue_cb && this.continue_cb(); 57 | }, 58 | 59 | onClickSpace() { 60 | this.onClickClose(); 61 | }, 62 | 63 | onClickContinue() { 64 | this.removeSelf(); 65 | 66 | this.continue_cb && this.continue_cb(); 67 | }, 68 | 69 | onClickRestart() { 70 | this.removeSelf(); 71 | 72 | this.restart_cb && this.restart_cb(); 73 | }, 74 | 75 | onClickMain() { 76 | this.removeSelf(); 77 | 78 | this.main_cb && this.main_cb(); 79 | 80 | ya.mm.show("main", null, true); 81 | }, 82 | 83 | onClickSound() { 84 | let enabled = !ya.storage.bool(ya.skey.EFFECT_ENABLED, true); 85 | this.lbl_sound.string = enabled ? ya.txt.str_005 : ya.txt.str_006; 86 | ya.music.effect = enabled; 87 | } 88 | 89 | }); 90 | -------------------------------------------------------------------------------- /assets/scripts/modules/setting/PauseView.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "252c73e3-e289-48f6-922f-183bab45c63a", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/setting/SettingController.js: -------------------------------------------------------------------------------- 1 | 2 | let Controller = require("../../components/mvc/Controller"); 3 | 4 | cc.Class({ 5 | extends: Controller, 6 | 7 | properties: { 8 | is_pause: -1, 9 | }, 10 | 11 | ctor() { 12 | 13 | }, 14 | 15 | initGlobalEvent() { 16 | ya.event.on(ya.ekey.EVT_SHOW_PAUSE, this.onShowPause, this); 17 | }, 18 | 19 | onShowPause(params) { 20 | ya.rm.checkLoad("pause", ()=>{ 21 | this.id_revive = ya.dm.push({ 22 | prefab: ya.res.prefab_pause, 23 | script: "PauseView", 24 | init_data: params, 25 | loadded_data: true, show_type: 1 26 | }); 27 | ya.dm.pop(); 28 | }); 29 | } 30 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/setting/SettingController.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "64b7bfb5-35d0-40b5-958e-14f95a3444fd", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/settle.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "6629751c-c14b-4a29-b52b-5e019cd752b1", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/settle/SettleController.js: -------------------------------------------------------------------------------- 1 | 2 | let Controller = require("../../components/mvc/Controller"); 3 | 4 | cc.Class({ 5 | extends: Controller, 6 | 7 | properties: { 8 | id_settle: -1, 9 | }, 10 | 11 | ctor() { 12 | 13 | }, 14 | 15 | initGlobalEvent() { 16 | ya.event.on(ya.ekey.EVT_SHOW_SETTLE, this.onShowSettle, this); 17 | }, 18 | 19 | onShowSettle(params) { 20 | ya.rm.checkLoad("settle", ()=>{ 21 | this.id_settle = ya.dm.push({ 22 | prefab: ya.res.prefab_settle, 23 | script: "SettleView", 24 | init_data: params, 25 | loadded_data: true, show_type: 1 26 | }); 27 | ya.dm.pop(); 28 | }); 29 | } 30 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/settle/SettleController.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "bb146a3b-a920-4844-acdf-1a1d820fab3a", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/settle/SettleView.js: -------------------------------------------------------------------------------- 1 | 2 | let Dialog = require("../../components/mvc/Dialog"); 3 | 4 | cc.Class({ 5 | extends: Dialog, 6 | 7 | properties: { 8 | lbl_cur_score: cc.Label, 9 | 10 | img_rank: cc.Node, 11 | 12 | btn_close: cc.Node, 13 | btn_share: cc.Node, 14 | btn_main: cc.Node, 15 | btn_restart: cc.Node, 16 | }, 17 | 18 | initData(params) { 19 | this._super(params); 20 | 21 | let d = this.init_data; 22 | this.mode = d.mode; 23 | this.score = d.score; 24 | 25 | this.restart_cb = d.restart_cb; 26 | this.main_cb = d.main_cb; 27 | 28 | this.view_width = 580; 29 | this.view_height = 220; 30 | 31 | this.is_support_wx = CC_WECHATGAME && (!!(window['wx'] && window['wx'].getOpenDataContext)); 32 | }, 33 | 34 | initUI() { 35 | this.lbl_cur_score.string = this.score.toString(); 36 | 37 | let action = 0; 38 | if (this.mode === ya.const.GAME_MODE.STAR) { 39 | action = ya.const.WX.AC_F_STAR_SETTLE; 40 | } 41 | else if (this.mode === ya.const.GAME_MODE.RUSSIA) { 42 | action = ya.const.WX.AC_F_RUSSIA_SETTLE; 43 | } 44 | else if (this.mode === ya.const.GAME_MODE.UNION) { 45 | action = ya.const.WX.AC_F_UNION_SETTLE; 46 | } 47 | 48 | if (this.is_support_wx) { 49 | let canvas = wx.getOpenDataContext().canvas; 50 | canvas.width = this.view_width; 51 | canvas.height = this.view_height; 52 | 53 | this._wx_tex = new cc.Texture2D(); 54 | this._wx_spriteframe = new cc.SpriteFrame(); 55 | 56 | window['wx'].getOpenDataContext().postMessage({ action: action }); 57 | } 58 | }, 59 | 60 | initClick() { 61 | ya.utils.addClickEvent(this.btn_close, ()=>{ 62 | this.onClickClose(); 63 | }); 64 | ya.utils.addClickEvent(this.btn_share, ()=>{ 65 | this.onClickShare(); 66 | }); 67 | ya.utils.addClickEvent(this.btn_main, ()=>{ 68 | this.onClickMain(); 69 | }); 70 | ya.utils.addClickEvent(this.btn_restart, ()=>{ 71 | this.onClickRestart(); 72 | }); 73 | }, 74 | 75 | update(dt) { 76 | if (this.is_support_wx) { 77 | this._wx_tex.initWithElement(window['wx'].getOpenDataContext().canvas); 78 | this._wx_tex.handleLoadedTexture(); 79 | this._wx_spriteframe.setTexture(this._wx_tex); 80 | this.img_rank.getComponent(cc.Sprite).spriteFrame = this._wx_spriteframe; 81 | } 82 | }, 83 | 84 | onClickSpace() { 85 | // this.onClickClose(); 86 | }, 87 | 88 | onClickClose() { 89 | this.removeSelf(); 90 | 91 | ya.mm.show("main", null, true); 92 | }, 93 | 94 | onClickShare() { 95 | let title = "", str = ""; 96 | if (this.mode === ya.const.GAME_MODE.STAR) { 97 | str = ya.txt.mode_001; 98 | } 99 | else if (this.mode === ya.const.GAME_MODE.RUSSIA) { 100 | str = ya.txt.mode_002; 101 | } 102 | else if (this.mode === ya.const.GAME_MODE.UNION) { 103 | str = ya.txt.mode_003; 104 | } 105 | title = cc.js.formatStr(ya.txt.share_title_settle, str, this.score); 106 | ya.platform.share({ 107 | title: title, 108 | imageUrl: ya.res.image_share_settle 109 | }); 110 | }, 111 | 112 | onClickRestart() { 113 | this.removeSelf(); 114 | 115 | this.restart_cb && this.restart_cb(); 116 | }, 117 | 118 | onClickMain() { 119 | this.removeSelf(); 120 | 121 | this.main_cb && this.main_cb(); 122 | }, 123 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/settle/SettleView.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "6a199f1a-0ef4-40fb-9116-73a3b09aeb14", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/toast.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "3e93c817-a032-4897-a1ff-aa933ef8694d", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/modules/toast/ToastController.js: -------------------------------------------------------------------------------- 1 | /* 2 | toast管理器 3 | */ 4 | 5 | let Controller = require("../../components/mvc/Controller"); 6 | 7 | cc.Class({ 8 | extends: Controller, 9 | 10 | properties: { 11 | 12 | }, 13 | 14 | initGlobalEvent() { 15 | ya.event.on(ya.ekey.SHOW_TOAST, this.onShowToast, this); 16 | }, 17 | 18 | onShowToast(params) { 19 | if (!this.view) return; 20 | 21 | this.view.addToast(params); 22 | } 23 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/toast/ToastController.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "44b74b31-66ed-49b2-a069-79e2b196852a", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/modules/toast/ToastView.js: -------------------------------------------------------------------------------- 1 | 2 | let View = require("../../components/mvc/View"); 3 | 4 | cc.Class({ 5 | extends: View, 6 | 7 | properties: { 8 | pool: cc.NodePool, 9 | }, 10 | 11 | addToast() { 12 | 13 | } 14 | }); -------------------------------------------------------------------------------- /assets/scripts/modules/toast/ToastView.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "8513bf63-6cce-456c-b4bb-0ef6534d038a", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/platforms.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "856c111f-b141-48dc-b28e-71d941fddfb2", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/platforms/BasicPlatform.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "d70a69ab-37ff-4fd0-a083-e3d2454abdbd", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/platforms/WeChatPlatform.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "643a175a-4e90-4813-bad9-8da59913bdd5", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/utils.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "fe6d5ea4-1d26-4150-8103-5214eb08e2d3", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/utils/Functions.js: -------------------------------------------------------------------------------- 1 | 2 | cc.Class({ 3 | 4 | randInt(l, r) { 5 | return Math.round(cc.misc.lerp(l - 0.4, r + 0.4, Math.random())); 6 | }, 7 | 8 | mix(arr) { 9 | let len = arr.length; 10 | for (let i = 0, t, r; i < len; i++) { 11 | r = this.randInt(0, len - 1); 12 | t = arr[i], arr[i] = arr[r], arr[r] = t; 13 | } 14 | }, 15 | 16 | bfs(map, r, c, R, C) { 17 | let used = [], ret = []; 18 | for (let i = 0; i < R; i++) { 19 | used[i] = []; 20 | for (let j = 0; j < C; j++) { 21 | used[i][j] = false; 22 | } 23 | } 24 | used[r][c] = true; 25 | 26 | let p, nr, nc; 27 | let stays = [{ r: r, c: c, n: 0 }]; 28 | let dir = [[0, -1], [1, 0], [0, 1], [-1, 0]]; 29 | while (stays.length > 0) { 30 | ret.push(p = stays.shift()); 31 | for (let i = 0; i < 4; i++) { 32 | nr = p.r + dir[i][0], nc = p.c + dir[i][1]; 33 | if (nr >= 0 && nr < R && nc >= 0 && nc < C) { 34 | if (map[nr][nc] === map[r][c] && !used[nr][nc]) { 35 | used[nr][nc] = true; 36 | stays.push({ r: nr, c: nc, n: p.n + 1 }); 37 | } 38 | } 39 | } 40 | } 41 | 42 | return ret; 43 | }, 44 | 45 | }); -------------------------------------------------------------------------------- /assets/scripts/utils/Functions.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "327fb645-d085-4c12-98a6-d011de2b1ae1", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/utils/Utils.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 帮助类 4 | */ 5 | 6 | cc.Class({ 7 | 8 | clone(object) { 9 | if (!object || typeof (object) !== "object") { 10 | return object; 11 | } 12 | 13 | let Constructor = object.constructor; 14 | let ret = new Constructor(); 15 | 16 | for (let attr in object) { 17 | if (object.hasOwnProperty(attr)) { 18 | let value = object[attr]; 19 | 20 | if (value === object) { 21 | return; 22 | } 23 | 24 | if (typeof (value) === "object") { 25 | ret[attr] = this.clone(value); 26 | } 27 | else { 28 | ret[attr] = value; 29 | } 30 | } 31 | } 32 | return ret; 33 | }, 34 | 35 | addClickEvent(node, efunc) { 36 | node.on(cc.Node.EventType.TOUCH_END, (event) => { 37 | if (efunc) efunc(event); 38 | ya.music.playEffect(ya.res.sound_click); 39 | event.stopPropagation(); 40 | }); 41 | }, 42 | 43 | addStartEvent(node, sfunc) { 44 | node.on(cc.Node.EventType.TOUCH_START, (event) => { 45 | if (sfunc) sfunc(event); 46 | event.stopPropagation(); 47 | }); 48 | }, 49 | 50 | addMoveEvent(node, mfunc) { 51 | node.on(cc.Node.EventType.TOUCH_MOVE, (event) => { 52 | if (mfunc) mfunc(event); 53 | event.stopPropagation(); 54 | }); 55 | }, 56 | 57 | addCancelEvent(node, cfunc) { 58 | node.on(cc.Node.EventType.TOUCH_CANCEL, (event) => { 59 | if (cfunc) cfunc(event); 60 | }); 61 | }, 62 | 63 | addTouchEvent(node, efunc, mfunc, bfunc, cfunc) { 64 | node.on(cc.Node.EventType.TOUCH_END, (event) => { 65 | if (efunc) efunc(event); 66 | event.stopPropagation(); 67 | }); 68 | node.on(cc.Node.EventType.TOUCH_START, (event) => { 69 | if (bfunc) bfunc(event); 70 | event.stopPropagation(); 71 | }); 72 | node.on(cc.Node.EventType.TOUCH_MOVE, (event) => { 73 | if (mfunc) mfunc(event); 74 | event.stopPropagation(); 75 | }); 76 | node.on(cc.Node.EventType.TOUCH_CANCEL, (event) => { 77 | if (cfunc) cfunc(event); 78 | }); 79 | }, 80 | 81 | isSameWeek(old_time, now_time) { 82 | old_time = old_time || new Date().getTime(); 83 | now_time = now_time || new Date().getTime(); 84 | 85 | let old_day = ~~(old_time / this.day_time); 86 | let now_day = ~~(now_time / this.day_time); 87 | 88 | return (~~((old_day + 4) / 7)) === (~~((now_day + 4) / 7)); 89 | }, 90 | 91 | }); -------------------------------------------------------------------------------- /assets/scripts/utils/Utils.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "005da595-b2f0-4e61-ba47-7abb11eaabb7", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/utils/UtilsInit.js: -------------------------------------------------------------------------------- 1 | 2 | let Utils = require("./Utils"); 3 | let Functions = require("./Functions"); 4 | 5 | cc.Class({ 6 | 7 | statics: { 8 | init(ya) { 9 | 10 | ya.utils = new Utils(); 11 | 12 | ya.func = new Functions(); 13 | 14 | } 15 | } 16 | 17 | }); -------------------------------------------------------------------------------- /assets/scripts/utils/UtilsInit.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "62bded81-859b-46b9-aeed-5c4c8003c53a", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/widgets.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "747e4299-900e-4a11-a8bf-669961927103", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/scripts/widgets/CubeSnowAnimation.js: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 下方块雪动画 4 | */ 5 | 6 | //每一帧移动的距离 7 | let FRAME_DISTANCE = 2; 8 | 9 | //最多有多少个cube 10 | let MAX_CUBE_NUM = 50; 11 | 12 | //创建的频率 13 | let CREATE_HZ = 30; 14 | 15 | cc.Class({ 16 | extends: cc.Component, 17 | 18 | properties: { 19 | pool: null, 20 | cubes: [], 21 | 22 | colors: [], 23 | 24 | direction: cc.Vec2, 25 | 26 | border: cc.Rect, 27 | 28 | sprite_frame: null, 29 | 30 | is_loadded: false, 31 | 32 | //能否继续创建cube 33 | is_create_enabed: true, 34 | //当前cube数量 35 | cur_cube_num: 0, 36 | 37 | //还有多少帧开始创建cube 38 | offset_frame_num: 0, 39 | 40 | //上一帧创建时的位置 41 | pre_position: 0, 42 | }, 43 | 44 | ctor() { 45 | this.pool = new cc.NodePool(); 46 | 47 | this.colors = [ 48 | cc.color(229, 103, 107), 49 | cc.color(43, 195, 233), 50 | cc.color(229, 223, 39), 51 | cc.color(35, 217, 56), 52 | cc.color(71, 129, 232) 53 | ]; 54 | 55 | //向下 56 | this.direction = cc.v2(0, -1); 57 | 58 | this.border = cc.rect(-200, -200, cc.winSize.width + 200, cc.winSize.height + 200); 59 | 60 | let img = new Image(); 61 | img.onload = () => { 62 | let tex = new cc.Texture2D(); 63 | tex.initWithElement(img); 64 | tex.handleLoadedTexture(); 65 | this.sprite_frame = new cc.SpriteFrame(tex); 66 | this.is_loadded = true; 67 | 68 | this.createMaskLayer(); 69 | }; 70 | img.src = ya.res64.cube_square; 71 | }, 72 | 73 | update() { 74 | if (!this.is_loadded) return; 75 | 76 | //移动cube 77 | for (let cube, i = this.cubes.length - 1; i >= 0; i--) { 78 | cube = this.cubes[i]; 79 | cube.x += this.direction.x * FRAME_DISTANCE; 80 | cube.y += this.direction.y * FRAME_DISTANCE; 81 | 82 | if (cube.x < this.border.x || cube.x > this.border.width || 83 | cube.y < this.border.y || cube.y > this.border.height) 84 | { 85 | this.pool.put(cube); 86 | this.cubes.splice(i, 1); 87 | } 88 | } 89 | }, 90 | 91 | lateUpdate() { 92 | if (!this.is_loadded) return; 93 | 94 | this.offset_frame_num--; 95 | if (this.offset_frame_num > 0) return; 96 | this.offset_frame_num = CREATE_HZ; 97 | 98 | let cube; 99 | if (this.pool.size() > 0) { 100 | cube = this.pool.get(); 101 | } 102 | else if (this.is_create_enabed) { 103 | cube = this.createCube(); 104 | } 105 | 106 | if (cube) { 107 | cube.position = this.getRandomPosition(); 108 | this.node.addChild(cube); 109 | this.cubes.push(cube); 110 | } 111 | }, 112 | 113 | getRandomPosition() { 114 | let x = 0, y = 0; 115 | if (this.direction.x !== 0) { 116 | if (this.direction.x < 0) { 117 | x = -100; 118 | } 119 | else { 120 | x = cc.winSize.width + 100; 121 | } 122 | let ry = cc.misc.lerp(100, cc.winSize.height - 100, Math.random()); 123 | y = (this.pre_position + ry) % (cc.winSize.height + 60) - 30; 124 | 125 | this.pre_position = y; 126 | } 127 | else { 128 | let rx = cc.misc.lerp(100, cc.winSize.width - 100, Math.random()); 129 | x = (this.pre_position + rx) % (cc.winSize.width + 60) - 30; 130 | y = cc.winSize.height + 100; 131 | 132 | this.pre_position = x; 133 | } 134 | return cc.v2(x, y); 135 | }, 136 | 137 | create(params) { 138 | let cube = new cc.Node(); 139 | let sprite = cube.addComponent(cc.Sprite); 140 | sprite.type = cc.Sprite.Type.SLICED; 141 | sprite.sizeMode = cc.Sprite.SizeMode.CUSTOM; 142 | sprite.spriteFrame = this.sprite_frame; 143 | cube.color = params.color; 144 | cube.anchorX = params.ax; 145 | cube.anchorY = params.ay; 146 | cube.opacity = params.opacity; 147 | cube.setContentSize(params.size); 148 | return cube; 149 | }, 150 | 151 | createCube() { 152 | 153 | this.cur_cube_num++; 154 | 155 | if (this.cur_cube_num >= MAX_CUBE_NUM) { 156 | this.is_create_enabed = false; 157 | } 158 | 159 | return this.create({ 160 | ax: 0.5, ay: 0.5, 161 | opacity: 100, 162 | size: cc.size(100, 100), 163 | color: this.colors[Math.round(cc.misc.lerp(0, this.colors.length - 1, Math.random()))] 164 | }); 165 | }, 166 | 167 | createMaskLayer() { 168 | let cube = this.create({ 169 | ax: 0, ay: 0, 170 | opacity: 155, 171 | size: cc.size(cc.winSize.width, cc.winSize.height), 172 | color: cc.color(255, 255, 255) 173 | }); 174 | this.node.addChild(cube, 1); 175 | }, 176 | 177 | }); -------------------------------------------------------------------------------- /assets/scripts/widgets/CubeSnowAnimation.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "b3aab989-3ec4-4712-ac6f-d790968fcefc", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/widgets/Item.js: -------------------------------------------------------------------------------- 1 | 2 | cc.Class({ 3 | extends: cc.Node, 4 | 5 | ctor() { 6 | let sprite = this.addComponent(cc.Sprite); 7 | sprite.spriteFrame = ya.rm.getSpriteFrame(ya.tex.unity_circle_bg); 8 | this.color = cc.color(150, 150, 150); 9 | let button = this.addComponent(cc.Button); 10 | button.transition = cc.Button.Transition.SCALE; 11 | button.target = this; 12 | }, 13 | 14 | init(params) { 15 | params = params || {}; 16 | this.mode = params.mode || ya.const.ITEM_MODE.MIX; 17 | this.click_cb = params.click_cb; 18 | 19 | this.bubble_enabled = params.bubble || false; 20 | this.power_enabled = params.power || false; 21 | 22 | this.num = params.num || 0; 23 | 24 | let str = "", res = ""; 25 | if (this.mode === ya.const.ITEM_MODE.MIX) { 26 | str = ya.txt.item_mix; 27 | res = ya.tex.game_item_mix; 28 | } 29 | else if (this.mode === ya.const.ITEM_MODE.DYE) { 30 | str = ya.txt.item_dye; 31 | res = ya.tex.game_item_dye; 32 | } 33 | else if (this.mode === ya.const.ITEM_MODE.BOMB) { 34 | str = ya.txt.item_bomb; 35 | res = ya.tex.game_item_bomb; 36 | } 37 | this.mode_str = str; 38 | this.mode_res = res; 39 | 40 | this.initUI(); 41 | 42 | this.initClick(); 43 | }, 44 | 45 | initUI() { 46 | this.lbl_mode = null; 47 | this.img_power_bg = null; 48 | this.lbl_num = null; 49 | 50 | // let lbl_mode = new cc.Node(); 51 | // let lbl = lbl_mode.addComponent(cc.Label); 52 | // lbl.string = this.mode_str; 53 | // lbl.fontSize = 25; 54 | // lbl.lineHeight = 40; 55 | // this.addChild(lbl_mode); 56 | // this.lbl_mode = lbl_mode; 57 | 58 | this.setContentSize(cc.size(100, 100)); 59 | 60 | let icon_node = new cc.Node(); 61 | let icon_sprite = icon_node.addComponent(cc.Sprite); 62 | icon_sprite.spriteFrame = ya.rm.getSpriteFrame(this.mode_res); 63 | this.addChild(icon_node); 64 | 65 | if (this.power_enabled) { 66 | this.initPower(); 67 | } 68 | }, 69 | 70 | initClick() { 71 | let start_time = 0, end_time; 72 | ya.utils.addTouchEvent(this, 73 | (event) => { 74 | end_time = new Date().getTime(); 75 | if (end_time - start_time < 500) { 76 | this.click_cb && this.click_cb(this.mode); 77 | } 78 | else { 79 | this.bubble_enabled && (this.onLongPress()); 80 | } 81 | }, null, 82 | (event) => { 83 | start_time = new Date().getTime(); 84 | } 85 | ); 86 | }, 87 | 88 | onLongPress() { 89 | 90 | }, 91 | 92 | initPower() { 93 | let node = new cc.Node(); 94 | let sprite = node.addComponent(cc.Sprite); 95 | sprite.spriteFrame = ya.rm.getSpriteFrame(ya.tex.game_item_circle); 96 | // node.scale = 0.3; 97 | // node.color = cc.color(255, 0, 0); 98 | node.position = cc.v2(40, 40); 99 | this.addChild(node); 100 | this.img_power_bg = node; 101 | 102 | let lbl_num = new cc.Node(); 103 | let lbl = lbl_num.addComponent(cc.Label); 104 | lbl.string = (this.num || "+").toString(); 105 | lbl.fontSize = 20; 106 | lbl.lineHeight = 20; 107 | lbl_num.position = cc.v2(40, 40); 108 | this.addChild(lbl_num); 109 | this.lbl_num = lbl_num; 110 | }, 111 | 112 | setPower(num) { 113 | this.num = num; 114 | 115 | if (!this.img_power_bg) { 116 | this.initPower(); 117 | } 118 | else { 119 | this.lbl_num.getComponent(cc.Label).string = (this.num || "+").toString(); 120 | } 121 | }, 122 | }); 123 | -------------------------------------------------------------------------------- /assets/scripts/widgets/Item.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "2a7fe9a3-9d3a-4d1e-94f8-e3603956e36a", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/scripts/widgets/TouchHaloAnimation.js: -------------------------------------------------------------------------------- 1 | 2 | let MAX_NUM = 5; 3 | 4 | cc.Class({ 5 | 6 | extends: cc.Component, 7 | 8 | properties: { 9 | is_touching: false, 10 | is_moving: false, 11 | 12 | pre_halo_time: 0, 13 | }, 14 | 15 | ctor() { 16 | this.pool = new cc.NodePool(); 17 | 18 | this.cur_halo_pos = null; 19 | this.pre_halo_pos = null; 20 | 21 | this.halos = []; 22 | }, 23 | 24 | start() { 25 | this.initTouch(); 26 | }, 27 | 28 | initTouch() { 29 | ya.utils.addTouchEvent(this.node, 30 | (event) => { 31 | this.cur_halo_pos = event.touch.getLocation(); 32 | this.is_touching = false; 33 | this.runHaloAction(this.cur_halo_pos, 0.4); 34 | }, 35 | (event) => { 36 | this.cur_halo_pos = event.touch.getLocation(); 37 | let t = new Date().getTime(); 38 | if (t - this.pre_halo_time >= 50) { 39 | this.runHaloAction(this.cur_halo_pos); 40 | this.pre_halo_time = t; 41 | } 42 | this.is_moving = true; 43 | }, 44 | (event) => { 45 | this.pre_halo_time = new Date().getTime(); 46 | this.is_touching = true; 47 | this.cur_halo_pos = event.touch.getLocation(); 48 | this.runHaloAction(this.cur_halo_pos); 49 | }, 50 | (event)=>{ 51 | this.is_touching = false; 52 | }); 53 | }, 54 | 55 | update() { 56 | if (this.is_touching) { 57 | let t = new Date().getTime(); 58 | if (this.is_moving) { 59 | if (t - this.pre_halo_time >= 100 && 60 | (Math.abs(this.cur_halo_pos.x - this.pre_halo_pos.x) > 10 || 61 | Math.abs(this.cur_halo_pos.y - this.pre_halo_pos.y) > 10)) { 62 | this.runHaloAction(this.cur_halo_pos); 63 | this.pre_halo_time = t; 64 | this.is_moving = false; 65 | } 66 | else if (t - this.pre_halo_time >= 100) { 67 | this.is_moving = false; 68 | } 69 | } 70 | else if (t - this.pre_halo_time >= 1000) { 71 | this.runHaloAction(this.cur_halo_pos); 72 | this.pre_halo_time = t; 73 | } 74 | } 75 | }, 76 | 77 | getHalo() { 78 | let halo; 79 | if (this.pool.size() > 0) { 80 | halo = this.pool.get(); 81 | halo.opacity = 255; 82 | halo.scale = 1.0; 83 | } 84 | else { 85 | halo = new cc.Node(); 86 | let sprite = halo.addComponent(cc.Sprite); 87 | sprite.spriteFrame = ya.rm.getSpriteFrame(ya.tex.game_img_halo); 88 | } 89 | return halo; 90 | }, 91 | 92 | runHaloAction(p, scale) { 93 | let halo; 94 | if (this.halos.length > MAX_NUM) { 95 | while (this.halos.length > MAX_NUM) { 96 | halo = this.halos.shift(); 97 | halo.stopAllActions(); 98 | this.pool.put(halo); 99 | } 100 | } 101 | 102 | halo = this.getHalo(); 103 | 104 | halo.position = p; 105 | halo.scale = scale || 0.5; 106 | halo.runAction(cc.sequence( 107 | cc.spawn(cc.scaleTo(1, 1.5), cc.fadeOut(1)), 108 | cc.callFunc(() => { 109 | this.pool.put(this.halos.shift()); 110 | }) 111 | )); 112 | 113 | this.node.addChild(halo); 114 | this.halos.push(halo); 115 | 116 | this.pre_halo_pos = this.cur_halo_pos; 117 | }, 118 | }); -------------------------------------------------------------------------------- /assets/scripts/widgets/TouchHaloAnimation.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.8", 3 | "uuid": "b1b3e0c5-9af3-4b03-b948-6233f08c5050", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /build-templates/wechatgame/images/common_share_img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/build-templates/wechatgame/images/common_share_img.jpg -------------------------------------------------------------------------------- /build-templates/wechatgame/images/img_pure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/build-templates/wechatgame/images/img_pure.png -------------------------------------------------------------------------------- /build-templates/wechatgame/images/img_rank_item_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/build-templates/wechatgame/images/img_rank_item_bg.png -------------------------------------------------------------------------------- /build-templates/wechatgame/images/revive_share_img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/build-templates/wechatgame/images/revive_share_img.jpg -------------------------------------------------------------------------------- /build-templates/wechatgame/images/settle_share_img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/build-templates/wechatgame/images/settle_share_img.jpg -------------------------------------------------------------------------------- /build-templates/wechatgame/src/opendatacontext/config.js: -------------------------------------------------------------------------------- 1 | 2 | let C = {}; 3 | 4 | C.AC_INIT = 100; 5 | C.AC_TEST = 101; 6 | C.AC_STORAGE = 102; 7 | C.AC_SCROLL_V = 103; 8 | C.AC_SCROLL_H = 104; 9 | C.AC_F_STAR_FETCH = 121; 10 | C.AC_G_STAR_FETCH = 122; 11 | C.AC_F_STAR_SETTLE = 123; 12 | C.AC_F_RUSSIA_FETCH = 131; 13 | C.AC_G_RUSSIA_FETCH = 132; 14 | C.AC_F_RUSSIA_SETTLE = 133; 15 | C.AC_F_HAUL_FETCH = 141; 16 | C.AC_G_HAUL_FETCH = 142; 17 | C.AC_F_DIGIT_FETCH = 151; 18 | C.AC_G_DIGIT_FETCH = 152; 19 | C.AC_F_UNION_FETCH = 161; 20 | C.AC_G_UNION_FETCH = 162; 21 | C.AC_F_UNION_SETTLE = 163; 22 | C.AC_F_POP_FETCH = 171; 23 | C.AC_G_POP_FETCH = 172; 24 | 25 | C.GAP = 5; 26 | C.ITEM_NUM = 6; 27 | C.VIEW_WIDTH = 600; 28 | C.VIEW_HEIGHT = 790; 29 | C.ITEM_HEIGHT = 110; 30 | 31 | C.VITAL_KEY = {} 32 | C.VITAL_KEY.DEFAULT = "score"; 33 | C.VITAL_KEY.STAR = "star_score"; 34 | C.VITAL_KEY.RUSSIA = "russia_score"; 35 | C.VITAL_KEY.HAUL = "haul_score"; 36 | C.VITAL_KEY.UNION = "union_score"; 37 | 38 | C.VITAL_TIME = {}; 39 | C.VITAL_TIME.DEFAULT = "time"; 40 | C.VITAL_TIME.STAR = "star_time"; 41 | C.VITAL_TIME.RUSSIA = "russia_time"; 42 | C.VITAL_TIME.HAUL = "haul_time"; 43 | C.VITAL_TIME.UNION = "union_time"; 44 | 45 | C.IMG_ITEM_BG = "images/img_rank_item_bg.png"; 46 | // C.IMG_RANK_1 = "images/img_rank_1.png"; 47 | // C.IMG_RANK_2 = "images/img_rank_2.png"; 48 | // C.IMG_RANK_3 = "images/img_rank_3.png"; 49 | 50 | export default C; -------------------------------------------------------------------------------- /build-templates/wechatgame/src/opendatacontext/util.js: -------------------------------------------------------------------------------- 1 | 2 | import cfg from "./config"; 3 | 4 | let LOCAL_IMG_LIST = [ 5 | cfg.IMG_ITEM_BG, 6 | ]; 7 | 8 | class Util { 9 | 10 | constructor() { 11 | this.day_time = 1000 * 60 * 60 * 24; 12 | this.image_cache = {}; 13 | this.avatar_image_cache = {}; 14 | } 15 | 16 | initLocalImage() { 17 | for (let i = 0, url; i < LOCAL_IMG_LIST.length; i++) { 18 | url = LOCAL_IMG_LIST[i]; 19 | this.image_cache[url] = this.createImage(url); 20 | } 21 | } 22 | 23 | getImage(name) { 24 | return this.image_cache[name]; 25 | } 26 | 27 | createImage(url, onload) { 28 | let image = wx.createImage(); 29 | image.src = url; 30 | image.onload = ()=>{ 31 | onload && onload(image); 32 | }; 33 | return image; 34 | } 35 | 36 | getAvatarImage(name, cb) { 37 | if (this.avatar_image_cache[name]) { 38 | cb && cb(this.avatar_image_cache[name]); 39 | } 40 | else { 41 | this.createImage(name, (image)=>{ 42 | this.avatar_image_cache[name] = image; 43 | cb && cb(image); 44 | }) 45 | } 46 | } 47 | 48 | measureText(ctx, text) { 49 | let s = ctx.measureText(text); 50 | if (s) { 51 | return s.width; 52 | } 53 | return 0; 54 | } 55 | 56 | getFriendCloudStorage(klist, cb) { 57 | wx.getFriendCloudStorage({ 58 | keyList: klist, 59 | success: (res) => { 60 | cb && cb(res.data); 61 | }, 62 | fail: () => { 63 | setTimeout(() => { 64 | this.getFriendCloudStorage(klist); 65 | }, 100); 66 | } 67 | }); 68 | } 69 | 70 | getGroupCloudStorage(klist, ticket, cb) { 71 | wx.getGroupCloudStorage({ 72 | shareTicket: ticket, 73 | keyList: klist, 74 | success: (res) => { 75 | cb && cb(res.data); 76 | }, 77 | fail: () => { 78 | setTimeout(() => { 79 | this.getGroupCloudStorage(klist); 80 | }, 100); 81 | } 82 | }); 83 | } 84 | 85 | isSameWeek(old_time, now_time) { 86 | old_time = old_time || new Date().getTime(); 87 | now_time = now_time || new Date().getTime(); 88 | 89 | let old_day = ~~(old_time / this.day_time); 90 | let now_day = ~~(now_time / this.day_time); 91 | 92 | return (~~((old_day + 4) / 7)) === (~~((now_day + 4) / 7)); 93 | } 94 | 95 | test() { 96 | console.log(this.image_cache); 97 | } 98 | } 99 | 100 | export default new Util; -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "experimentalDecorators": true 6 | }, 7 | "exclude": [ 8 | "node_modules", 9 | ".vscode", 10 | "library", 11 | "local", 12 | "settings", 13 | "temp" 14 | ] 15 | } -------------------------------------------------------------------------------- /project.json: -------------------------------------------------------------------------------- 1 | { 2 | "engine": "cocos2d-html5", 3 | "packages": "packages", 4 | "version": "2.3.1", 5 | "id": "c901ee5f-bf1a-4bb5-8de1-20dfa2ca226b" 6 | } -------------------------------------------------------------------------------- /resources/textures/game/resources/game_bottom_mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/game/resources/game_bottom_mask.png -------------------------------------------------------------------------------- /resources/textures/game/resources/game_cube_fillet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/game/resources/game_cube_fillet.png -------------------------------------------------------------------------------- /resources/textures/game/resources/game_cube_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/game/resources/game_cube_square.png -------------------------------------------------------------------------------- /resources/textures/game/resources/game_img_halo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/game/resources/game_img_halo.png -------------------------------------------------------------------------------- /resources/textures/game/resources/game_item_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/game/resources/game_item_bg.png -------------------------------------------------------------------------------- /resources/textures/game/resources/game_item_bomb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/game/resources/game_item_bomb.png -------------------------------------------------------------------------------- /resources/textures/game/resources/game_item_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/game/resources/game_item_circle.png -------------------------------------------------------------------------------- /resources/textures/game/resources/game_item_dye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/game/resources/game_item_dye.png -------------------------------------------------------------------------------- /resources/textures/game/resources/game_item_mix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/game/resources/game_item_mix.png -------------------------------------------------------------------------------- /resources/textures/game/resources/game_star_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/game/resources/game_star_blue.png -------------------------------------------------------------------------------- /resources/textures/game/resources/game_star_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/game/resources/game_star_green.png -------------------------------------------------------------------------------- /resources/textures/game/resources/game_star_orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/game/resources/game_star_orange.png -------------------------------------------------------------------------------- /resources/textures/game/resources/game_star_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/game/resources/game_star_red.png -------------------------------------------------------------------------------- /resources/textures/game/resources/game_star_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/game/resources/game_star_select.png -------------------------------------------------------------------------------- /resources/textures/game/resources/game_star_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/game/resources/game_star_yellow.png -------------------------------------------------------------------------------- /resources/textures/unity/resources/unity_circle_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/unity/resources/unity_circle_bg.png -------------------------------------------------------------------------------- /resources/textures/unity/resources/unity_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/unity/resources/unity_close.png -------------------------------------------------------------------------------- /resources/textures/unity/resources/unity_game_club.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/unity/resources/unity_game_club.png -------------------------------------------------------------------------------- /resources/textures/unity/resources/unity_more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/unity/resources/unity_more.png -------------------------------------------------------------------------------- /resources/textures/unity/resources/unity_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/unity/resources/unity_pause.png -------------------------------------------------------------------------------- /resources/textures/unity/resources/unity_rank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/unity/resources/unity_rank.png -------------------------------------------------------------------------------- /resources/textures/unity/resources/unity_return.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/unity/resources/unity_return.png -------------------------------------------------------------------------------- /resources/textures/unity/resources/unity_service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/unity/resources/unity_service.png -------------------------------------------------------------------------------- /resources/textures/unity/resources/unity_share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/unity/resources/unity_share.png -------------------------------------------------------------------------------- /resources/textures/unity/resources/unity_sound_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/unity/resources/unity_sound_off.png -------------------------------------------------------------------------------- /resources/textures/unity/resources/unity_sound_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaszheng/ya-framework-creator/60a721bf7742b36f231ef1c8b879c0382f1cdd45/resources/textures/unity/resources/unity_sound_on.png -------------------------------------------------------------------------------- /settings/builder.json: -------------------------------------------------------------------------------- 1 | { 2 | "android-instant": { 3 | "REMOTE_SERVER_ROOT": "", 4 | "host": "", 5 | "pathPattern": "", 6 | "recordPath": "", 7 | "scheme": "https", 8 | "skipRecord": false 9 | }, 10 | "appKey": "", 11 | "appSecret": "", 12 | "encryptJs": true, 13 | "excludeScenes": [], 14 | "fb-instant-games": {}, 15 | "includeAnySDK": false, 16 | "includeSDKBox": false, 17 | "inlineSpriteFrames": true, 18 | "inlineSpriteFrames_native": true, 19 | "jailbreakPlatform": false, 20 | "md5Cache": false, 21 | "mergeStartScene": false, 22 | "oauthLoginServer": "", 23 | "optimizeHotUpdate": false, 24 | "orientation": { 25 | "landscapeLeft": true, 26 | "landscapeRight": true, 27 | "portrait": false, 28 | "upsideDown": false 29 | }, 30 | "packageName": "org.cocos2d.helloworld", 31 | "privateKey": "", 32 | "qqplay": { 33 | "REMOTE_SERVER_ROOT": "", 34 | "orientation": "portrait" 35 | }, 36 | "startScene": "2d2f792f-a40c-49bb-a189-ed176a246e49", 37 | "title": "test", 38 | "webOrientation": "auto", 39 | "wechatgame": { 40 | "REMOTE_SERVER_ROOT": "", 41 | "appid": "wx1dade06cafdc990f", 42 | "orientation": "portrait", 43 | "subContext": "src/opendatacontext" 44 | }, 45 | "xxteaKey": "5c8a4cc2-d63c-49", 46 | "zipCompressJs": true 47 | } -------------------------------------------------------------------------------- /settings/builder.panel.json: -------------------------------------------------------------------------------- 1 | { 2 | "excludeScenes": [], 3 | "packageName": "org.cocos2d.helloworld", 4 | "platform": "web-mobile", 5 | "startScene": "2d2f792f-a40c-49bb-a189-ed176a246e49", 6 | "title": "HelloWorld" 7 | } -------------------------------------------------------------------------------- /settings/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "assets-sort-type": "name", 3 | "collision-matrix": [ 4 | [ 5 | true 6 | ] 7 | ], 8 | "design-resolution-height": 1280, 9 | "design-resolution-width": 720, 10 | "excluded-modules": [ 11 | "Dynamic Atlas", 12 | "TiledMap", 13 | "Spine Skeleton", 14 | "DragonBones", 15 | "PageView", 16 | "PageViewIndicator", 17 | "VideoPlayer", 18 | "WebView", 19 | "Collider", 20 | "Physics", 21 | "StudioComponent", 22 | "Geom Utils", 23 | "3D", 24 | "3D Primitive", 25 | "3D Physics/cannon.js", 26 | "3D Physics/Builtin", 27 | "3D Particle" 28 | ], 29 | "facebook": { 30 | "appID": "", 31 | "audience": { 32 | "enable": false 33 | }, 34 | "enable": false, 35 | "live": { 36 | "enable": false 37 | } 38 | }, 39 | "fit-height": true, 40 | "fit-width": true, 41 | "group-list": [ 42 | "default" 43 | ], 44 | "last-module-event-record-time": 0, 45 | "simulator-orientation": false, 46 | "simulator-resolution": { 47 | "height": 1280, 48 | "width": 720 49 | }, 50 | "use-customize-simulator": true, 51 | "use-project-simulator-setting": true, 52 | "start-scene": "current" 53 | } 54 | -------------------------------------------------------------------------------- /settings/services.json: -------------------------------------------------------------------------------- 1 | { 2 | "services": [ 3 | { 4 | "service_id": "235", 5 | "service_name": "Cocos Analytics", 6 | "service_icon": "https://account.cocos.com/client/3f8f31ccf66995e183044f167c092395.png", 7 | "service_desc": "提供最核心最基本的数据、标准化界面功能简洁易用、数据准确性最好", 8 | "service_title": "精准了解游戏的新增、活跃、留存、付费等数据", 9 | "service_guide_url": "https://n-analytics.cocos.com/docs/", 10 | "service_sample_url": "https://github.com/cocos-creator/tutorial-dark-slash/tree/analytics", 11 | "service_dev_url": "http://analytics.cocos.com/realtime/jump_to/", 12 | "service_type": "3", 13 | "service_type_zh": "公司和个人游戏", 14 | "support_platform": [ 15 | "Android", 16 | "iOS", 17 | "HTML5" 18 | ], 19 | "package_download_url": "http://download.cocos.com/CocosServices/plugins/service-analytics/1.2.0_2.1.0.zip", 20 | "package_version_desc": "1、优化SDK,修复H5-SDK 与多个小游戏平台适配问题,删除和优化init事件无用接口
2、 如有相关问题咨询或者需求, 可以联系我们技术支持邮箱 support-cocos@cocos.com", 21 | "service_component_name": "service-analytics", 22 | "package_versions": [ 23 | "1.0.0_1.0.5", 24 | "1.1.2_2.0.0", 25 | "1.1.3_2.0.1", 26 | "1.1.4_2.0.1", 27 | "1.1.5_2.0.1", 28 | "1.1.6_2.0.1_2.0.2", 29 | "1.1.7_2.0.3", 30 | "1.1.8_2.0.4", 31 | "1.1.9_2.1.0", 32 | "1.2.0_2.1.0" 33 | ], 34 | "build_platform": [ 35 | "web-mobile", 36 | "web-desktop", 37 | "wechatgame", 38 | "android", 39 | "ios", 40 | "fb-instant-games", 41 | "android-instant", 42 | "baidugame", 43 | "quickgame", 44 | "qgame", 45 | "qqplay", 46 | "huawei" 47 | ], 48 | "require_verify": 0, 49 | "service_price": "", 50 | "packpage_version_desc": "", 51 | "service_protocol": "游戏首次开启该服务时,Cocos会后台通知服务方为游戏开通服务并初始化参数,服务方根据需要可能会获取您的Cocos账户信息,包括账户基本资料、游戏基本资料、账户余额等,点击确认开通按钮即视为您同意该服务访问您的账户信息,详见《Cocos用户服务协议》《Cocos隐私政策》" 52 | }, 53 | { 54 | "service_id": "241", 55 | "service_name": "Matchvs", 56 | "service_icon": "https://account.cocos.com/client/14406719a07eb3d714d36e5edc6e06fa.png", 57 | "service_desc": "通过SDK接入快速实现联网功能、帧同步、国内外多节点、服务器独立部署、gameServer自定义游戏服务端逻辑。\n技术支持群QQ群:822523258", 58 | "service_title": "专业成熟的移动游戏联网与服务端解决方案", 59 | "service_guide_url": "http://doc.matchvs.com/QuickStart/QuickStart-CocosCreator", 60 | "service_sample_url": "http://www.matchvs.com/serviceCourse", 61 | "service_dev_url": "http://www.matchvs.com/cocosLogin", 62 | "service_type": "3", 63 | "service_type_zh": "公司和个人游戏", 64 | "support_platform": [ 65 | "Android", 66 | "iOS", 67 | "HTML5" 68 | ], 69 | "package_download_url": "http://download.cocos.com/CocosServices/plugins/service-matchvs/1.0.9_3.7.9.9.zip", 70 | "package_version_desc": "更新日期:2019-07-18
更新内容:
1、修复多节点登录返回值错误
2、修复FaceBook平台受限安全策略的问题", 71 | "service_component_name": "service-matchvs", 72 | "package_versions": [ 73 | "1.0.3_3.7.6.4", 74 | "1.0.5_3.7.7.3", 75 | "1.0.6_3.7.9.2", 76 | "1.0.7_3.7.9.6", 77 | "1.0.9_3.7.9.9" 78 | ], 79 | "build_platform": [ 80 | "web-mobile", 81 | "web-desktop", 82 | "fb-instant-games", 83 | "wechatgame", 84 | "wechatgame-subcontext", 85 | "qqplay", 86 | "android", 87 | "android-instant", 88 | "ios", 89 | "mac", 90 | "quickgame", 91 | "qgame", 92 | "huawei" 93 | ], 94 | "require_verify": 0, 95 | "service_price": "该服务按使用量计费,计费规则,所产生的费用将由第三方从您的 Cocos 账户余额 中扣除。", 96 | "packpage_version_desc": "", 97 | "service_protocol": "游戏首次开启该服务时,Cocos会后台通知服务方为游戏开通服务并初始化参数,服务方根据需要可能会获取您的Cocos账户信息,包括账户基本资料、游戏基本资料、账户余额等,点击确认开通按钮即视为您同意该服务访问您的账户信息,详见《Cocos用户服务协议》《Cocos隐私政策》" 98 | }, 99 | { 100 | "service_id": "242", 101 | "service_name": "Agora Voice", 102 | "service_icon": "https://account.cocos.com/uploads/client_icon/2019-07-16/273952d155b4cdb72d2b1bc61de91ade.png", 103 | "service_desc": "稳定、低耗、76ms超低延时、全球200+数据中心覆盖;变声器、超高音质、听声辩位等丰富玩法极速接入;全平台支持:Android、iOS、Web。\n技术支持群QQ群:799099183\n", 104 | "service_title": "游戏内置实时语音", 105 | "service_guide_url": "https://docs.agora.io/cn/Interactive Gaming/game_c?platform=Cocos Creator", 106 | "service_sample_url": "https://github.com/AgoraIO/Voice-Call-for-Mobile-Gaming/tree/master/Basic-Voice-Call-for-Gaming/Hello-CocosCreator-Voice-Agora", 107 | "service_dev_url": "https://sso.agora.io/api/oauth/cocos/login", 108 | "service_type": "3", 109 | "service_type_zh": "公司和个人游戏", 110 | "support_platform": [ 111 | "Android", 112 | "iOS", 113 | "HTML5" 114 | ], 115 | "package_download_url": "http://download.cocos.com/CocosServices/plugins/service-agora/1.0.2_2.2.3.20_2.5.2.zip", 116 | "package_version_desc": "解决Bug:onAudioVolumeIndication 回调收不到.", 117 | "service_component_name": "service-agora", 118 | "package_versions": [ 119 | "1.0.1_2.2.3.20_2.5.2", 120 | "1.0.2_2.2.3.20_2.5.2" 121 | ], 122 | "build_platform": [ 123 | "web-mobile", 124 | "web-desktop", 125 | "android", 126 | "ios" 127 | ], 128 | "require_verify": 1, 129 | "service_price": "该服务按使用量计费,计费规则,所产生的费用将由第三方从您的 Cocos 账户余额 中扣除。", 130 | "packpage_version_desc": "", 131 | "service_protocol": "游戏首次开启该服务时,Cocos会后台通知服务方为游戏开通服务并初始化参数,服务方根据需要可能会获取您的Cocos账户信息,包括账户基本资料、游戏基本资料、账户余额等,点击确认开通按钮即视为您同意该服务访问您的账户信息,详见《Cocos用户服务协议》《Cocos隐私政策》" 132 | } 133 | ], 134 | "game": { 135 | "name": "未知游戏", 136 | "appid": "UNKNOW" 137 | } 138 | } --------------------------------------------------------------------------------