Commit 27192080 authored by rockyl's avatar rockyl

update

parent 0cd23568
Pipeline #70154 failed with stages
in 1 second
{"mc":{
"explosion":{
"frameRate":24,
"events":[
],
"frames":[
{
"res":"82633BC5",
"x":-48,
"y":-28
},
{
"res":"53B369C2",
"x":-106,
"y":-120
},
{
"res":"5435D1A0",
"x":-120,
"y":-134
},
{
"res":"A3A112F7",
"x":-134,
"y":-148
},
{
"res":"8B1CA0F9",
"x":-139,
"y":-153
},
{
"res":"A118E2A6",
"x":-144,
"y":-158
},
{
"res":"52BE5208",
"x":-146,
"y":-160
},
{
"res":"1AB4BC53",
"x":-149,
"y":-162
},
{
"res":"C69FF774",
"x":-155,
"y":-169
},
{
"res":"501E4EC2",
"x":-158,
"y":-170
},
{
"res":"3FC1A177",
"x":-162,
"y":-171
},
{
"res":"E86C0A15",
"x":-166,
"y":-173
},
{
"res":"2898BC52",
"x":-169,
"y":-177
},
{
"res":"B1983A4B",
"x":-171,
"y":-178
},
{
"res":"AD4D1B38",
"x":-173,
"y":-181
},
{
"res":"94342383",
"x":-174,
"y":-181
},
{
"res":"C3D80A66",
"x":-175,
"y":-182
},
{
"res":"D548BEDD",
"x":-177,
"y":-183
},
{
"res":"11EACF44",
"x":-177,
"y":-184
},
{
"res":"F852BB51",
"x":-178,
"y":-185
},
{
"res":"CB0154DF",
"x":-179,
"y":-186
},
{
"res":"2144DF1C",
"x":0,
"y":0
}
]
}},
"res":{
"94342383":{"x":1483,"y":362,"w":362,"h":358},
"C3D80A66":{"x":1483,"y":1,"w":364,"h":359},
"8B1CA0F9":{"x":1330,"y":1042,"w":293,"h":298},
"501E4EC2":{"x":1,"y":721,"w":331,"h":338},
"82633BC5":{"x":1849,"y":1,"w":77,"h":75},
"D548BEDD":{"x":1113,"y":1,"w":368,"h":362},
"A3A112F7":{"x":1625,"y":1042,"w":285,"h":290},
"C69FF774":{"x":700,"y":721,"w":323,"h":333},
"B1983A4B":{"x":742,"y":367,"w":357,"h":352},
"5435D1A0":{"x":1788,"y":722,"w":258,"h":264},
"1AB4BC53":{"x":1475,"y":722,"w":311,"h":318},
"2898BC52":{"x":1,"y":369,"w":354,"h":350},
"CB0154DF":{"x":373,"y":1,"w":367,"h":368},
"53B369C2":{"x":700,"y":1056,"w":232,"h":243},
"52BE5208":{"x":1025,"y":724,"w":306,"h":314},
"AD4D1B38":{"x":1113,"y":365,"w":360,"h":357},
"E86C0A15":{"x":357,"y":371,"w":347,"h":345},
"11EACF44":{"x":742,"y":1,"w":369,"h":364},
"F852BB51":{"x":1,"y":1,"w":370,"h":366},
"A118E2A6":{"x":1025,"y":1040,"w":303,"h":310},
"2144DF1C":{"x":1928,"y":1,"w":1,"h":1},
"3FC1A177":{"x":357,"y":718,"w":341,"h":341}
}}
\ No newline at end of file
{
"file": "sheet_body.png",
"frames": {
"body_head": {
"x": 1,
"y": 1,
"w": 126,
"h": 126,
"offX": 0,
"offY": 0,
"sourceW": 126,
"sourceH": 126
},
"body_leg": {
"x": 129,
"y": 1,
"w": 35,
"h": 43,
"offX": 0,
"offY": 0,
"sourceW": 35,
"sourceH": 43
},
"body_hand": {
"x": 129,
"y": 46,
"w": 26,
"h": 44,
"offX": 0,
"offY": 0,
"sourceW": 26,
"sourceH": 44
},
"body_body": {
"x": 1,
"y": 129,
"w": 81,
"h": 65,
"offX": 0,
"offY": 0,
"sourceW": 81,
"sourceH": 65
},
"body_ear": {
"x": 84,
"y": 129,
"w": 70,
"h": 65,
"offX": 0,
"offY": 0,
"sourceW": 70,
"sourceH": 65
}
}
}
\ No newline at end of file
{
"file": "sheet_common.png",
"frames": {
"common_high_light": {
"common_btn_confirm": {
"x": 1,
"y": 1,
"w": 656,
"h": 656,
"w": 260,
"h": 80,
"offX": 0,
"offY": 0,
"sourceW": 656,
"sourceH": 656
"sourceW": 260,
"sourceH": 80
},
"common_btn_back": {
"x": 263,
"y": 1,
"w": 61,
"h": 62,
"offX": 0,
"offY": 0,
"sourceW": 61,
"sourceH": 62
},
"common_btn_close": {
"x": 659,
"x": 326,
"y": 1,
"w": 50,
"h": 50,
"w": 40,
"h": 40,
"offX": 0,
"offY": 0,
"sourceW": 50,
"sourceH": 50
"sourceW": 40,
"sourceH": 40
},
"common_btn_confirm": {
"common_badge": {
"x": 326,
"y": 43,
"w": 22,
"h": 20,
"offX": 0,
"offY": 0,
"sourceW": 22,
"sourceH": 20
},
"common_progress_track": {
"x": 1,
"y": 659,
"w": 391,
"h": 106,
"y": 83,
"w": 260,
"h": 20,
"offX": 0,
"offY": 0,
"sourceW": 391,
"sourceH": 106
"sourceW": 260,
"sourceH": 20
},
"common_progress_thumb": {
"x": 1,
"y": 105,
"w": 258,
"h": 20,
"offX": 0,
"offY": 0,
"sourceW": 258,
"sourceH": 20
},
"common_panel_bg": {
"x": 394,
"y": 659,
"w": 174,
"h": 224,
"x": 1,
"y": 127,
"w": 120,
"h": 825,
"offX": 0,
"offY": 0,
"sourceW": 174,
"sourceH": 224
"sourceW": 120,
"sourceH": 825
}
}
}
\ No newline at end of file
resource/assets/sheets/sheet_common.png

79.6 KB | W: | H:

resource/assets/sheets/sheet_common.png

18.4 KB | W: | H:

resource/assets/sheets/sheet_common.png
resource/assets/sheets/sheet_common.png
resource/assets/sheets/sheet_common.png
resource/assets/sheets/sheet_common.png
  • 2-up
  • Swipe
  • Onion skin
{
"file": "sheet_draw_reward.png",
"frames": {
"draw_reward_treasure_close": {
"x": 1,
"y": 1,
"w": 750,
"h": 558,
"offX": 0,
"offY": 0,
"sourceW": 750,
"sourceH": 558
},
"draw_reward_treasure_open": {
"x": 753,
"y": 1,
"w": 625,
"h": 753,
"offX": 0,
"offY": 0,
"sourceW": 625,
"sourceH": 753
},
"draw_reward_sunshine": {
"x": 1,
"y": 561,
"w": 749,
"h": 792,
"offX": 0,
"offY": 0,
"sourceW": 749,
"sourceH": 792
},
"draw_reward_treasure_shadow": {
"x": 752,
"y": 756,
"w": 600,
"h": 188,
"offX": 0,
"offY": 0,
"sourceW": 600,
"sourceH": 188
},
"draw_reward_reward_0": {
"x": 752,
"y": 946,
"w": 244,
"h": 279,
"offX": 0,
"offY": 0,
"sourceW": 244,
"sourceH": 279
},
"draw_reward_reward_1": {
"x": 998,
"y": 946,
"w": 233,
"h": 261,
"offX": 0,
"offY": 0,
"sourceW": 233,
"sourceH": 261
},
"draw_reward_reward_2": {
"x": 998,
"y": 1209,
"w": 232,
"h": 261,
"offX": 0,
"offY": 0,
"sourceW": 232,
"sourceH": 261
},
"draw_reward_reward_3": {
"x": 752,
"y": 1227,
"w": 216,
"h": 242,
"offX": 0,
"offY": 0,
"sourceW": 216,
"sourceH": 242
},
"draw_reward_reward_4": {
"x": 1,
"y": 1472,
"w": 206,
"h": 208,
"offX": 0,
"offY": 0,
"sourceW": 206,
"sourceH": 208
},
"draw_reward_reward_6": {
"x": 1,
"y": 1682,
"w": 191,
"h": 206,
"offX": 0,
"offY": 0,
"sourceW": 191,
"sourceH": 206
},
"draw_reward_reward_5": {
"x": 194,
"y": 1682,
"w": 185,
"h": 198,
"offX": 0,
"offY": 0,
"sourceW": 185,
"sourceH": 198
}
}
}
\ No newline at end of file
{
"file": "sheet_loading.png",
"frames": {
"loading_logo": {
"x": 1,
"y": 1,
"w": 589,
"h": 228,
"offX": 0,
"offY": 0,
"sourceW": 589,
"sourceH": 228
}
}
}
\ No newline at end of file
{
"file": "sheet_menu.png",
"frames": {
"menu_bg_part_top": {
"x": 1,
"y": 1,
"w": 750,
"h": 192,
"offX": 0,
"offY": 0,
"sourceW": 750,
"sourceH": 192
},
"menu_bg_part_logo": {
"x": 753,
"y": 1,
"w": 554,
"h": 232,
"offX": 0,
"offY": 0,
"sourceW": 554,
"sourceH": 232
},
"menu_bg": {
"x": 1,
"y": 195,
"w": 728,
"h": 897,
"offX": 0,
"offY": 0,
"sourceW": 728,
"sourceH": 897
},
"menu_bg_part_right": {
"x": 1,
"y": 1094,
"w": 171,
"h": 843,
"offX": 0,
"offY": 0,
"sourceW": 171,
"sourceH": 843
},
"menu_btn_rank": {
"x": 1,
"y": 1939,
"w": 100,
"h": 99,
"offX": 0,
"offY": 0,
"sourceW": 100,
"sourceH": 99
},
"menu_btn_rule": {
"x": 103,
"y": 1939,
"w": 91,
"h": 92,
"offX": 0,
"offY": 0,
"sourceW": 91,
"sourceH": 92
},
"menu_bg_part_left": {
"x": 174,
"y": 1094,
"w": 188,
"h": 841,
"offX": 0,
"offY": 0,
"sourceW": 188,
"sourceH": 841
},
"menu_moon": {
"x": 364,
"y": 1094,
"w": 657,
"h": 657,
"offX": 0,
"offY": 0,
"sourceW": 657,
"sourceH": 657
},
"menu_btn_start": {
"x": 731,
"y": 1753,
"w": 277,
"h": 280,
"offX": 0,
"offY": 0,
"sourceW": 277,
"sourceH": 280
},
"menu_sprite": {
"x": 1023,
"y": 235,
"w": 154,
"h": 130,
"offX": 0,
"offY": 0,
"sourceW": 154,
"sourceH": 130
}
}
}
\ No newline at end of file
{
"file": "sheet_mission.png",
"frames": {
"mission_share_tips": {
"x": 1,
"y": 1,
"w": 506,
"h": 406,
"offX": 0,
"offY": 0,
"sourceW": 506,
"sourceH": 406
},
"mission_btn_done": {
"x": 1,
"y": 409,
"w": 222,
"h": 82,
"offX": 0,
"offY": 0,
"sourceW": 222,
"sourceH": 82
},
"mission_btn_share": {
"x": 225,
"y": 409,
"w": 222,
"h": 82,
"offX": 0,
"offY": 0,
"sourceW": 222,
"sourceH": 82
},
"mission_btn_watch": {
"x": 1,
"y": 493,
"w": 222,
"h": 82,
"offX": 0,
"offY": 0,
"sourceW": 222,
"sourceH": 82
},
"mission_btn_download": {
"x": 225,
"y": 493,
"w": 222,
"h": 82,
"offX": 0,
"offY": 0,
"sourceW": 222,
"sourceH": 82
},
"mission_btn_login": {
"x": 1,
"y": 577,
"w": 222,
"h": 82,
"offX": 0,
"offY": 0,
"sourceW": 222,
"sourceH": 82
}
}
}
\ No newline at end of file
{
"file": "sheet_result.png",
"file": "sheet_panels.png",
"frames": {
"result_btn_revive": {
"panels_btn_get_reward": {
"x": 1,
"y": 1,
"w": 391,
"h": 106,
"w": 260,
"h": 80,
"offX": 0,
"offY": 0,
"sourceW": 391,
"sourceH": 106
"sourceW": 260,
"sourceH": 80
},
"result_title": {
"panels_btn_go_mission": {
"x": 1,
"y": 109,
"w": 382,
"h": 105,
"y": 83,
"w": 260,
"h": 80,
"offX": 0,
"offY": 0,
"sourceW": 382,
"sourceH": 105
"sourceW": 260,
"sourceH": 80
},
"result_btn_get_reward": {
"panels_btn_retry": {
"x": 1,
"y": 216,
"w": 257,
"h": 91,
"y": 165,
"w": 260,
"h": 80,
"offX": 0,
"offY": 0,
"sourceW": 257,
"sourceH": 91
"sourceW": 260,
"sourceH": 80
},
"result_btn_retry": {
"panels_btn_goon": {
"x": 1,
"y": 309,
"w": 257,
"h": 91,
"y": 247,
"w": 260,
"h": 80,
"offX": 0,
"offY": 0,
"sourceW": 257,
"sourceH": 91
"sourceW": 260,
"sourceH": 80
}
}
}
\ No newline at end of file
{
"file": "sheet_play.png",
"frames": {
"play_bg_ground": {
"play_wave": {
"x": 1,
"y": 1,
"w": 750,
"h": 954,
"w": 427,
"h": 73,
"offX": 0,
"offY": 0,
"sourceW": 750,
"sourceH": 954
"sourceW": 427,
"sourceH": 73
},
"play_go": {
"x": 753,
"play_btn_send": {
"x": 430,
"y": 1,
"w": 211,
"h": 116,
"w": 332,
"h": 189,
"offX": 0,
"offY": 0,
"sourceW": 211,
"sourceH": 116
"sourceW": 332,
"sourceH": 189
},
"play_block_0": {
"x": 753,
"y": 119,
"w": 208,
"h": 134,
"play_slogan": {
"x": 1,
"y": 76,
"w": 397,
"h": 171,
"offX": 0,
"offY": 0,
"sourceW": 208,
"sourceH": 134
"sourceW": 397,
"sourceH": 171
},
"play_block_2": {
"x": 753,
"y": 255,
"w": 208,
"h": 134,
"play_boss_4": {
"x": 400,
"y": 192,
"w": 362,
"h": 254,
"offX": 0,
"offY": 0,
"sourceW": 208,
"sourceH": 134
"sourceW": 362,
"sourceH": 254
},
"play_block_3": {
"x": 753,
"y": 391,
"w": 208,
"h": 134,
"play_boss_7": {
"x": 1,
"y": 249,
"w": 376,
"h": 319,
"offX": 0,
"offY": 0,
"sourceW": 208,
"sourceH": 134
"sourceW": 376,
"sourceH": 319
},
"play_block_4": {
"x": 753,
"y": 527,
"w": 208,
"h": 134,
"play_sender_top": {
"x": 379,
"y": 448,
"w": 238,
"h": 133,
"offX": 0,
"offY": 0,
"sourceW": 208,
"sourceH": 134
"sourceW": 238,
"sourceH": 133
},
"play_block_1": {
"x": 753,
"y": 663,
"w": 208,
"h": 134,
"play_logo": {
"x": 619,
"y": 448,
"w": 142,
"h": 98,
"offX": 0,
"offY": 0,
"sourceW": 208,
"sourceH": 134
"sourceW": 142,
"sourceH": 98
},
"play_ready": {
"play_boss_0": {
"x": 619,
"y": 548,
"w": 131,
"h": 133,
"offX": 0,
"offY": 0,
"sourceW": 131,
"sourceH": 133
},
"play_boss_1": {
"x": 1,
"y": 957,
"w": 333,
"y": 570,
"w": 196,
"h": 139,
"offX": 0,
"offY": 0,
"sourceW": 196,
"sourceH": 139
},
"play_score_add_100": {
"x": 199,
"y": 570,
"w": 160,
"h": 58,
"offX": 0,
"offY": 0,
"sourceW": 160,
"sourceH": 58
},
"play_boss_2": {
"x": 361,
"y": 583,
"w": 131,
"h": 104,
"offX": 0,
"offY": 0,
"sourceW": 131,
"sourceH": 104
},
"play_sender_bottom": {
"x": 494,
"y": 583,
"w": 112,
"h": 46,
"offX": 0,
"offY": 0,
"sourceW": 112,
"sourceH": 46
},
"play_btn_download": {
"x": 494,
"y": 631,
"w": 105,
"h": 105,
"offX": 0,
"offY": 0,
"sourceW": 105,
"sourceH": 105
},
"play_boss_5": {
"x": 199,
"y": 630,
"w": 102,
"h": 99,
"offX": 0,
"offY": 0,
"sourceW": 102,
"sourceH": 99
},
"play_boss_3": {
"x": 303,
"y": 630,
"w": 41,
"h": 13,
"offX": 0,
"offY": 0,
"sourceW": 41,
"sourceH": 13
},
"play_sender_right": {
"x": 303,
"y": 645,
"w": 38,
"h": 107,
"offX": 0,
"offY": 0,
"sourceW": 38,
"sourceH": 107
},
"play_boss_6": {
"x": 343,
"y": 689,
"w": 96,
"h": 100,
"offX": 0,
"offY": 0,
"sourceW": 96,
"sourceH": 100
},
"play_sender_left": {
"x": 441,
"y": 689,
"w": 38,
"h": 107,
"offX": 0,
"offY": 0,
"sourceW": 38,
"sourceH": 107
},
"play_btn_treasure": {
"x": 601,
"y": 683,
"w": 91,
"h": 106,
"offX": 0,
"offY": 0,
"sourceW": 91,
"sourceH": 106
},
"play_txt_launch_game": {
"x": 481,
"y": 738,
"w": 89,
"h": 26,
"offX": 0,
"offY": 0,
"sourceW": 89,
"sourceH": 26
},
"play_txt_install_game": {
"x": 481,
"y": 766,
"w": 88,
"h": 26,
"offX": 0,
"offY": 0,
"sourceW": 88,
"sourceH": 26
},
"play_btn_item": {
"x": 571,
"y": 791,
"w": 86,
"h": 122,
"offX": 0,
"offY": 0,
"sourceW": 86,
"sourceH": 122
},
"play_btn_gift": {
"x": 481,
"y": 794,
"w": 85,
"h": 106,
"offX": 0,
"offY": 0,
"sourceW": 85,
"sourceH": 106
},
"play_sender_bullet_body": {
"x": 659,
"y": 791,
"w": 79,
"h": 92,
"offX": 0,
"offY": 0,
"sourceW": 333,
"sourceW": 79,
"sourceH": 92
},
"play_block_5": {
"x": 336,
"y": 957,
"w": 218,
"h": 144,
"play_sender_base": {
"x": 659,
"y": 885,
"w": 72,
"h": 110,
"offX": 0,
"offY": 0,
"sourceW": 72,
"sourceH": 110
},
"play_sender_bullet_shadow": {
"x": 1,
"y": 711,
"w": 72,
"h": 98,
"offX": 0,
"offY": 0,
"sourceW": 218,
"sourceH": 144
"sourceW": 72,
"sourceH": 98
}
}
}
\ No newline at end of file
{
"file": "sheet_rank.png",
"frames": {
"rank_bg": {
"x": 1,
"y": 1,
"w": 453,
"h": 138,
"offX": 0,
"offY": 0,
"sourceW": 453,
"sourceH": 138
},
"rank_title": {
"x": 1,
"y": 141,
"w": 382,
"h": 105,
"offX": 0,
"offY": 0,
"sourceW": 382,
"sourceH": 105
}
}
}
\ No newline at end of file
......@@ -16,5 +16,13 @@
"rank_out": "未上榜",
"me": "我",
"rank_max_score": "我的历史最高分: {0}分",
"rank_reward_content": "您的排名: {0}\n您的奖品: {1}\n您的ID: {2}"
"rank_reward_content": "您的排名: {0}\n您的奖品: {1}\n您的ID: {2}",
"no_more_items":"没有炮弹了",
"need_install_app":"请先安装游戏",
"share_result": {
"success": "分享成功",
"fail": "分享失败",
"cancel": "分享被取消"
}
}
{
"groups": [
{
"keys": "lang,sheet_loading",
"name": "loading"
"keys": "sheet_panels",
"name": "panels"
},
{
"keys": "sheet_menu,bg",
"name": "menu"
},
{
"keys": "sheet_rank",
"name": "panel_rank"
},
{
"keys": "sheet_result",
"name": "panel_result"
},
{
"keys": "sheet_common",
"keys": "sheet_common,lang",
"name": "common"
},
{
"keys": "bg_ground,bg_loop",
"keys": "sheet_play,bg_play,effects_json,effects_png",
"name": "play"
},
{
"keys": "bg",
"name": "preload"
"keys": "bg_mission,sheet_mission",
"name": "mission"
},
{
"keys": "sheet_draw_reward,bg_draw_reward",
"name": "draw_reward"
}
],
"resources": [
......@@ -40,62 +32,80 @@
"type": "font",
"name": "font_yellow"
},
{
"url": "assets/sheets/sheet_body.json",
"type": "sheet",
"name": "sheet_body",
"subkeys": "body_body,body_ear,body_hand,body_head,body_leg"
},
{
"url": "assets/sheets/sheet_common.json",
"type": "sheet",
"name": "sheet_common",
"subkeys": "common_btn_close,common_btn_confirm,common_high_light,common_panel_bg"
"subkeys": "common_badge,common_btn_back,common_btn_close,common_btn_confirm,common_panel_bg,common_progress_thumb,common_progress_track"
},
{
"url": "assets/sheets/sheet_loading.json",
"url": "assets/sheets/sheet_play.json",
"type": "sheet",
"name": "sheet_loading",
"subkeys": "loading_logo"
"name": "sheet_play",
"subkeys": "play_boss_0,play_boss_1,play_boss_2,play_boss_3,play_boss_4,play_boss_5,play_boss_6,play_boss_7,play_btn_download,play_btn_gift,play_btn_item,play_btn_send,play_btn_treasure,play_logo,play_score_add_100,play_sender_base,play_sender_bottom,play_sender_bullet_body,play_sender_bullet_shadow,play_sender_left,play_sender_right,play_sender_top,play_slogan,play_txt_install_game,play_txt_launch_game,play_wave"
},
{
"url": "assets/sheets/sheet_menu.json",
"type": "sheet",
"name": "sheet_menu",
"subkeys": "menu_bg,menu_bg_part_left,menu_bg_part_logo,menu_bg_part_right,menu_bg_part_top,menu_btn_rank,menu_btn_rule,menu_btn_start,menu_moon,menu_sprite"
"url": "assets/singles/bg_play.jpg",
"type": "image",
"name": "bg_play"
},
{
"url": "assets/sheets/sheet_play.json",
"type": "sheet",
"name": "sheet_play",
"subkeys": "play_bg_ground,play_block_0,play_block_1,play_block_2,play_block_3,play_block_4,play_block_5,play_go,play_ready"
"url": "assets/singles/part_1.png",
"type": "image",
"name": "part_1"
},
{
"url": "assets/sheets/sheet_rank.json",
"type": "sheet",
"name": "sheet_rank",
"subkeys": "rank_bg,rank_title"
"url": "assets/singles/part_2.png",
"type": "image",
"name": "part_2"
},
{
"url": "assets/singles/part_3.png",
"type": "image",
"name": "part_3"
},
{
"url": "assets/singles/part_0.png",
"type": "image",
"name": "part_0"
},
{
"url": "assets/sheets/sheet_result.json",
"url": "assets/sheets/sheet_panels.json",
"type": "sheet",
"name": "sheet_result",
"subkeys": "result_btn_get_reward,result_btn_retry,result_btn_revive,result_title"
"name": "sheet_panels",
"subkeys": "panels_btn_get_reward,panels_btn_go_mission,panels_btn_goon,panels_btn_retry"
},
{
"url": "assets/singles/bg_loop.png",
"url": "assets/effects/effects.json",
"type": "json",
"name": "effects_json"
},
{
"url": "assets/effects/effects.png",
"type": "image",
"name": "bg_loop"
"name": "effects_png"
},
{
"url": "assets/singles/bg_ground.png",
"url": "assets/singles/bg_mission.jpg",
"type": "image",
"name": "bg_ground"
"name": "bg_mission"
},
{
"url": "assets/sheets/sheet_mission.json",
"type": "sheet",
"name": "sheet_mission",
"subkeys": "mission_btn_done,mission_btn_download,mission_btn_login,mission_btn_share,mission_btn_watch,mission_share_tips"
},
{
"url": "assets/sheets/sheet_draw_reward.json",
"type": "sheet",
"name": "sheet_draw_reward",
"subkeys": "draw_reward_reward_0,draw_reward_reward_1,draw_reward_reward_2,draw_reward_reward_3,draw_reward_reward_4,draw_reward_reward_5,draw_reward_reward_6,draw_reward_sunshine,draw_reward_treasure_close,draw_reward_treasure_open,draw_reward_treasure_shadow"
},
{
"url": "assets/singles/bg.png",
"url": "assets/singles/bg_draw_reward.jpg",
"type": "image",
"name": "bg"
"name": "bg_draw_reward"
}
]
}
\ No newline at end of file
......@@ -2,20 +2,22 @@
"skins": {},
"autoGenerateExmlsList": true,
"exmls": [
"resource/skins/components/BadgeSkin.exml",
"resource/skins/ui/IconButtonSkin.exml",
"resource/skins/components/GameViewSkin.exml",
"resource/skins/components/RankItemSkin.exml",
"resource/skins/components/ReadyGoSkin.exml",
"resource/skins/components/ToastSkin.exml",
"resource/skins/components/TreasureSkin.exml",
"resource/skins/ui/ProgressSkin.exml",
"resource/skins/LoadingViewSkin.exml",
"resource/skins/MainStageSkin.exml",
"resource/skins/ui/IconButtonSkin.exml",
"resource/skins/panels/PanelAlertSkin.exml",
"resource/skins/panels/PanelRankRewardSkin.exml",
"resource/skins/panels/PanelRankSkin.exml",
"resource/skins/panels/PanelContainerSkin.exml",
"resource/skins/panels/PanelResultSkin.exml",
"resource/skins/panels/PanelReviveSkin.exml",
"resource/skins/panels/PanelRuleSkin.exml",
"resource/skins/scenes/SceneDrawRewardSkin.exml",
"resource/skins/scenes/SceneFinalRewardSkin.exml",
"resource/skins/scenes/SceneMenuSkin.exml",
"resource/skins/scenes/SceneMissionSkin.exml",
"resource/skins/scenes/ScenePlaySkin.exml"
],
"path": "resource/default.thm.json"
......
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="LoadingViewSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing" states="loading,blank" >
<e:Rect width="100%" height="100%" fillColor="0x0a0047"/>
<e:Group verticalCenter="0" includeIn="loading" horizontalCenter="0">
<e:Image id="sp" source="loading_logo"/>
<e:Rect width="100%" height="100%" fillColor="0x44dff5"/>
<e:Group x="245" includeIn="loading" bottom="607">
<e:ProgressBar id="progressBar" skinName="ui.ProgressSkin"/>
<e:Label text="loading..." y="-40" horizontalCenter="0"/>
</e:Group>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="component.BadgeSkin" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image source="common_badge" scale9Grid="10,9,2,2" width="100%" height="100%"/>
<e:Label id="lab" text="0" left="6" right="6" size="16" verticalCenter="1"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="component.GameViewSkin" width="750" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing" height="830">
<e:Group id="grpBoss" y="8" x="157" width="436" height="411">
<e:Group x="239.4" y="286" anchorOffsetX="216" anchorOffsetY="286">
<e:Image y="92" x="9.6" source="play_boss_7"/>
<e:Image id="leftEye" y="151.5" x="113" source="play_boss_6"/>
<e:Image id="rightEye" y="142" x="212" source="play_boss_5"/>
<e:Image y="168.5" x="189.6" source="play_boss_3" locked="true"/>
<e:Image y="0" x="0" source="play_boss_4" locked="true"/>
</e:Group>
<e:Image y="217.5" x="0" source="play_boss_0"/>
<e:Image y="231" x="304.4" source="play_boss_2"/>
<e:Image y="254" x="138.4" source="play_boss_1"/>
</e:Group>
<e:Group id="grpHitOn" x="171" y="239.5" visible="false">
<e:Rect width="80" height="80" x="0" y="27.5" fillAlpha="0.5"/>
<e:Rect width="80" height="80" x="191" y="62" fillAlpha="0.5"/>
<e:Rect width="80" height="80" x="303" y="10" fillAlpha="0.5"/>
</e:Group>
<e:Group id="grpOther" x="157" y="9" visible="false">
<e:Rect width="76" height="92" x="103.6" y="272" fillColor="0xabf765" anchorOffsetY="0" anchorOffsetX="0" fillAlpha="0.5"/>
<e:Rect width="396" height="112" x="0" fillColor="0xABF765" anchorOffsetY="0" anchorOffsetX="0" y="114" fillAlpha="0.5"/>
<e:Rect width="278" height="45" x="99" fillColor="0xABF765" anchorOffsetY="0" anchorOffsetX="0" y="69" fillAlpha="0.5"/>
<e:Rect width="154" height="69" x="137" fillColor="0xABF765" anchorOffsetY="0" anchorOffsetX="0" y="0" fillAlpha="0.5"/>
<e:Rect width="202" height="40" x="102" y="232" fillColor="0xABF765" anchorOffsetY="0" anchorOffsetX="0" fillAlpha="0.5"/>
</e:Group>
<e:Group id="grpSender" x="256" y="453" width="238" height="233">
<e:Image source="play_sender_base" y="123" x="83" locked="true"/>
<e:Image x="0" source="play_sender_top" y="0" locked="true"/>
<e:Image id="leftPart" x="30" source="play_sender_left" y="54"/>
<e:Image id="rightPart" x="165" source="play_sender_right" y="54"/>
<e:Image id="bottomPart" source="play_sender_bottom" y="140" x="61.6"/>
</e:Group>
<e:Button id="btnSend" x="240" y="639" skinName="ui.IconButtonSkin" icon="play_btn_send" width="332" height="189"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="component.TreasureSkin" xmlns:e="http://ns.egret.com/eui" states="close,open" width="750">
<e:Image x="79" source="draw_reward_treasure_shadow" y="440"/>
<e:Image id="imgTreasure" source="draw_reward_treasure_close" source.open="draw_reward_treasure_open" x.open="62" y.open="-195"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="panel.PanelAlertSkin" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing" width="585">
<e:Image source="common_panel_bg" scale9Grid="89,111,3,14" width="100%" height="100%" locked="true"/>
<e:Label id="labContent" text="Label" textAlign="center" lineSpacing="10" size="45" multiline="true" stroke="3" strokeColor="0x000000" textColor="0xffffff" top="150" bottom="270" width="485" x="50"/>
<e:Button id="btnOk" skinName="ui.IconButtonSkin" icon="common_btn_confirm" bottom="39" width="391" height="106" x="97"/>
<e:Skin class="panel.PanelAlertSkin" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing" width="585" height="460">
<e:Image source="common_panel_bg" anchorOffsetX="0" width="100%" scale9Grid="58,48,6,727" height="100%"/>
<e:Label id="labContent" text="Label" textAlign="center" lineSpacing="10" size="45" multiline="true" stroke="3" strokeColor="0x006600" textColor="0xffffff" width="485" x="50" verticalCenter="-50"/>
<e:Button id="btnOk" skinName="ui.IconButtonSkin" icon="common_btn_confirm" bottom="39" width="260" height="80" x="163"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="panel.PanelContainerSkin" width="580" height="825" xmlns:e="http://ns.egret.com/eui">
<e:Image source="common_panel_bg" anchorOffsetX="0" width="100%" scale9Grid="58,48,6,727" height="100%"/>
<e:Button y="20" skinName="ui.IconButtonSkin" icon="common_btn_close" width="40" height="40" right="20"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="panel.PanelRankRewardSkin" width="500" height="350" xmlns:e="http://ns.egret.com/eui">
<e:Label id="labContent" text="Label" textColor="0x8e481a" lineSpacing="20" size="45" multiline="true" stroke="2"
strokeColor="0xffffff" x="46" y="20" />
<e:Button id="btnShowRank" skinName="ui.IconButtonSkin" icon="result_btn_show_rank" width="401" height="122" horizontalCenter="0.5" bottom="0"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="panel.PanelRankSkin" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing" xmlns:ns1="*" width="545" height="655">
<e:Image source="common_panel_bg" scale9Grid="89,111,3,14" width="100%" height="100%"/>
<e:Image y="-51" source="rank_title" x="82"/>
<e:Button id="btnClose" skinName="ui.IconButtonSkin" icon="common_btn_close" y="-10" width="50" height="50" x="505"/>
<e:Image y="65" source="rank_bg" x="46" anchorOffsetY="0" height="545" scale9Grid="73,66,324,3"/>
<e:Label text="排名" textColor="0xA9572C" x="103" y="86"/>
<e:Label text="用户名" textColor="0xA9572C" x="200" y="86"/>
<e:Label text="分数" textColor="0xA9572C" x="384" y="86"/>
<e:Scroller width="415" height="385" y="145" anchorOffsetY="0" anchorOffsetX="0" x="65">
<e:List id="list" x="-3" y="-13" locked="true">
<e:itemRendererSkinName>
<e:Skin states="up,down,disabled" xmlns:w="http://ns.egret.com/wing">
<ns1:RankItem id="rankItem" skinName="component.RankItemSkin"/>
</e:Skin>
</e:itemRendererSkinName>
<e:ArrayCollection>
<e:Array>
<e:Object a="null"/>
<e:Object a="null"/>
<e:Object a="null"/>
<e:Object a="null"/>
</e:Array>
</e:ArrayCollection>
<e:layout>
<e:VerticalLayout gap="10"/>
</e:layout>
</e:List>
</e:Scroller>
<ns1:RankItem id="rankSelf" skinName="component.RankItemSkin" x="65" y="560.33"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="panel.PanelResultSkin" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing"
states="normal,reward" width="600">
<e:Image source="common_panel_bg" scale9Grid="89,111,3,14" width="100%" height="100%" locked="true"/>
<e:Button id="btnClose" skinName="ui.IconButtonSkin" icon="common_btn_close" width="50" height="50" y="-10" x="560"/>
<e:Group top="78" bottom="50" horizontalCenter="0">
<e:Group x="126" y="20">
<e:Label id="labScore" text="本局分数\n0分" y="0" size="50" textAlign="center" lineSpacing="10" textColor="0xFEF191" x="0"/>
<e:Label id="labMaxScore" text="历史最佳\n0分" y="61" size="50" textAlign="center" lineSpacing="10" x="0" textColor="0xfcce3a"/>
<e:layout>
<e:HorizontalLayout gap="67"/>
</e:layout>
</e:Group>
<e:Group y="430" includeIn="reward" horizontalCenter="0">
<e:Rect fillColor="0xffffff" left="-4" right="-4" top="-4" bottom="-4" ellipseWidth="10" ellipseHeight="10" />
<e:Image id="imgReward" scaleX="0.6" scaleY="0.6" width="640" height="300"/>
</e:Group>
<e:Label id="labRewardIntro" includeIn="reward" text="..." y="675" size="30" textAlign="center" horizontalCenter="0.5" />
<e:Group id="grpButtons" x="35" bottom="60">
<e:Button id="btnRetry" x.reward="264" icon="result_btn_retry" skinName="ui.IconButtonSkin" width="275" height="103" name="retry" x.normal="0"/>
<e:Button x="0" icon="result_btn_get_reward" skinName="ui.IconButtonSkin" width="275" height="103"
name="get_reward" includeIn="reward"/>
<e:Label id="labCost" text="1/1" y="108" size="30" textAlign="center" lineSpacing="20" horizontalCenter="150.5" horizontalCenter.normal="0" horizontalCenter.reward="135.5"/>
</e:Group>
<e:layout>
<e:VerticalLayout gap="20" horizontalAlign="center" gap.normal="50"/>
</e:layout>
</e:Group>
<e:Image source="result_title" x="102" y="-45.45"/>
<e:Skin class="panel.PanelResultSkin" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing" width="600" height="585" states="object_reward,coupon_reward,no_more_items,no_reward,need_more_power" height.object_reward="775" height.coupon_reward="775" height.need_more_power="775">
<e:Image source="common_panel_bg" anchorOffsetX="0" width="100%" scale9Grid="58,48,6,727" height="100%"/>
<e:Button id="btnClose" y="20" skinName="ui.IconButtonSkin" icon="common_btn_close" width="40" height="40"
right="20"/>
<e:Label id="labTitle" text="" y="70" textColor="0xcc6600" size="35" text.object_reward="恭喜您获得:" horizontalCenter="0" text.coupon_reward="恭喜您获得:" includeIn="object_reward,coupon_reward"/>
<e:Image id="imgReward" horizontalCenter="0" scaleX="0.55" scaleY="0.55" verticalCenter="-200" includeIn="object_reward,coupon_reward" source=""/>
<e:Label id="labRewardName" text="" y="270" textColor="0xCC6600" horizontalCenter="0.5" includeIn="object_reward,coupon_reward" size="25"/>
<e:Image id="imgContent" source.object_reward="part_0" source.coupon_reward="part_0" bottom.coupon_reward="13" source.no_more_items="part_1" x.no_more_items="88" y.no_more_items="40" x.no_reward="206" y.no_reward="76.5" source.no_reward="part_3" y.need_more_power="210" source.need_more_power="part_2" x.object_reward="10" bottom.object_reward="13" x.coupon_reward="10" x.need_more_power="53"/>
<e:Label id="labContent" text="" textColor="0xcc6600" lineSpacing="10" text.object_reward="*请务必及时填写收货信息,奖励将在活动结束7个工作日内发放。" y.object_reward="330" size="28" text.coupon_reward="*兑换方式:复制兑换码&gt;打开游戏主界面&gt;点击右下角加号&gt;选择兑换中心&gt;输入兑换码即可。" y.coupon_reward="310" text.no_more_items="今日免费炮弹已用完,完成任务即可获得额外免费炮弹哦!" textAlign.no_more_items="center" y.no_more_items="350" text.no_reward="您此次未有抽到任何奖励哦,\n离奖品还差一点点啦!" textAlign.no_reward="center" y.no_reward="350" text.need_more_power="您当前能量值不足。继续攻打章鱼,获得能量值,每满1000能量值即可抽奖一次哦,100%有奖!" y.need_more_power="82" left="60" right="60" left.need_more_power="50" right.need_more_power="50" left.object_reward="60" right.object_reward="60" left.coupon_reward="60" right.coupon_reward="60"/>
<e:Button id="btnConfirm" y="459" skinName="ui.IconButtonSkin" width="260" height="80" icon.object_reward="panels_btn_get_reward" y.object_reward="420" icon.coupon_reward="panels_btn_get_reward" y.coupon_reward="420" icon.no_more_items="panels_btn_go_mission" y.no_more_items="450" icon.no_reward="panels_btn_retry" y.no_reward="450" icon.need_more_power="panels_btn_goon" y.need_more_power="650" horizontalCenter="0" horizontalCenter.coupon_reward="0" horizontalCenter.object_reward="0" horizontalCenter.need_more_power="0"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="panel.PanelReviveSkin" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing" width="585" height="388">
<e:Image source="common_panel_bg" scale9Grid="89,111,3,14" width="100%" height="100%"/>
<e:Button id="btnClose" skinName="ui.IconButtonSkin" icon="common_btn_close" width="50" height="50" y="-10" x="545"/>
<e:Button id="btnConfirm" y="220.5" icon="result_btn_revive" skinName="ui.IconButtonSkin" width="413" height="114" x="86"/>
<e:Label id="labContent" text="是否愿意花费20积分在当前游戏复活一次?" y="73" stroke="2" width="416" size="41" textAlign="center" lineSpacing="20" x="85"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="panel.PanelRuleSkin" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing" width="585" height="555">
<e:Image source="common_panel_bg" scale9Grid="89,111,3,14" width="100%" height="100%"/>
<e:Label text="游戏说明" x="212.5" y="51" size="40" textColor="0xfbe193"/>
<e:Scroller id="scroller" height="396" y="110" width="485" x="50">
<e:Group width="100%">
<e:Label id="labContent" width="100%" text="" lineSpacing="10" size="30" multiline="true" textColor="0xfbe193"/>
</e:Group>
</e:Scroller>
<e:Button id="btnClose" skinName="ui.IconButtonSkin" icon="common_btn_close"
width="50" height="50" y="-10" x="545"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="scene.SceneDrawRewardSkin" width="750" height="1334" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing" xmlns:ns1="*" xmlns:tween="egret.tween.*">
<w:Declarations>
<tween:TweenGroup id="enter">
<tween:TweenItem target="{grpRewards}">
<tween:To duration="750">
<tween:props>
<e:Object alpha="{1}"/>
</tween:props>
</tween:To>
</tween:TweenItem>
</tween:TweenGroup>
<tween:TweenGroup id="leave">
<tween:TweenItem target="{grpRewards}">
<tween:To duration="200">
<tween:props>
<e:Object alpha="{0}"/>
</tween:props>
</tween:To>
</tween:TweenItem>
</tween:TweenGroup>
</w:Declarations>
<e:Rect width="100%" height="100%" fillColor="0x0d9efa" locked="true"/>
<e:Image source="bg_draw_reward" bottom="0" locked="true"/>
<e:Image y="0" source="draw_reward_sunshine" x="1" locked="true"/>
<e:Group id="grpRewards" height="700" alpha="0" y="0" horizontalCenter="0">
<e:Image x="24" y="50" source="draw_reward_reward_0"/>
<e:Image x="318" y="15.15" source="draw_reward_reward_1"/>
<e:Image x="490" y="189.5" source="draw_reward_reward_3"/>
<e:Image x="218.85" y="249" source="draw_reward_reward_2"/>
<e:Image x="0" y="401.5" source="draw_reward_reward_4"/>
<e:Image x="225.5" y="502" source="draw_reward_reward_5"/>
<e:Image x="455.5" y="438" source="draw_reward_reward_6"/>
</e:Group>
<ns1:Treasure id="treasure" x="375" skinName="component.TreasureSkin" bottom="10" anchorOffsetX="375" anchorOffsetY="522"/>
<e:Button id="btnBack" skinName="ui.IconButtonSkin" icon="common_btn_back" width="61" height="62" y="10" x="679"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="scene.SceneMenuSkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui"
xmlns:w="http://ns.egret.com/wing" xmlns:tween="egret.tween.*">
<w:Declarations>
<tween:TweenGroup id="enter">
<tween:TweenItem target="{grpButtons}">
<tween:To duration="500" ease="cubicOut">
<tween:props>
<e:Object bottom="{300}"/>
</tween:props>
</tween:To>
</tween:TweenItem>
<tween:TweenItem target="{imgPartLeft}">
<tween:To duration="300" ease="cubicOut">
<tween:props>
<e:Object x="{0}"/>
</tween:props>
</tween:To>
</tween:TweenItem>
<tween:TweenItem target="{imgPartRight}">
<tween:To duration="300" ease="cubicOut">
<tween:props>
<e:Object right="{0}"/>
</tween:props>
</tween:To>
</tween:TweenItem>
<tween:TweenItem target="{imgPartTop}">
<tween:Wait duration="100"/>
<tween:To duration="300" ease="cubicOut">
<tween:props>
<e:Object y="{0}"/>
</tween:props>
</tween:To>
</tween:TweenItem>
<tween:TweenItem target="{imgLogo}">
<tween:Wait duration="200"/>
<tween:To duration="400" ease="backOut">
<tween:props>
<e:Object y="{-20}"/>
</tween:props>
</tween:To>
</tween:TweenItem>
</tween:TweenGroup>
<tween:TweenGroup id="leave">
<tween:TweenItem target="{grpButtons}">
<tween:Wait duration="150"/>
<tween:To duration="250" ease="cubicIn">
<tween:props>
<e:Object bottom="{-438}"/>
</tween:props>
</tween:To>
</tween:TweenItem>
<tween:TweenItem target="{imgPartLeft}">
<tween:Wait duration="100"/>
<tween:To duration="250" ease="cubicIn">
<tween:props>
<e:Object x="{-188}"/>
</tween:props>
</tween:To>
</tween:TweenItem>
<tween:TweenItem target="{imgPartRight}">
<tween:Wait duration="100"/>
<tween:To duration="250" ease="cubicIn">
<tween:props>
<e:Object right="{-171}"/>
</tween:props>
</tween:To>
</tween:TweenItem>
<tween:TweenItem target="{imgPartTop}">
<tween:Wait duration="200"/>
<tween:To duration="250" ease="cubicIn">
<tween:props>
<e:Object y="{-192}"/>
</tween:props>
</tween:To>
</tween:TweenItem>
<tween:TweenItem target="{imgLogo}">
<tween:To duration="250" ease="cubicIn">
<tween:props>
<e:Object y="{-232}"/>
</tween:props>
</tween:To>
</tween:TweenItem>
</tween:TweenGroup>
</w:Declarations>
<e:Group id="grpBg" width="100%">
<e:Image id="imgPartLeft" source="menu_bg_part_left" x="-188"/>
<e:Image id="imgPartRight" source="menu_bg_part_right" right="-171"/>
<e:Image id="imgPartTop" source="menu_bg_part_top" y="-192"/>
<e:Image id="imgLogo" source="menu_bg_part_logo" x="109" y="-232"/>
</e:Group>
<e:Group id="grpButtons" bottom="-438" x="180">
<e:Button id="btnStart" skinName="ui.IconButtonSkin" icon="menu_btn_start" width="277" height="280" y="59" x="57" name="start"/>
<e:Button id="btnRank" skinName="ui.IconButtonSkin" icon="menu_btn_rank" width="100" height="99" name="rank"/>
<e:Button id="btnRule" skinName="ui.IconButtonSkin" icon="menu_btn_rule" x="300" width="91" height="92" name="rule"/>
<e:Image x="237" y="205.96" source="menu_sprite" touchEnabled="false"/>
<e:Label id="labCost" text="Label" y="362" horizontalCenter="0" touchEnabled="false"/>
<e:Label id="labCredit" text="Label" y="407.45" horizontalCenter="0.5" touchEnabled="false"/>
</e:Group>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="scene.SceneMissionSkin" width="750" height="1334" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Rect width="100%" height="100%" fillColor="0x4df5fe"/>
<e:Image source="bg_mission" bottom="0"/>
<e:Group id="grpButtons" x="424.12" touchEnabled="false" bottom="144">
<e:Button name="download" width="222" height="82">
<e:skinName>
<e:Skin states="up,down,disabled">
<e:Image source="mission_btn_download" source.disabled="mission_btn_done" horizontalCenter="0" verticalCenter="0" scaleX.down="0.95" scaleY.down="0.95"/>
</e:Skin>
</e:skinName>
</e:Button>
<e:Button skinName="ui.IconButtonSkin" icon="mission_btn_login" name="login" width="222" height="82"/>
<e:Button skinName="ui.IconButtonSkin" icon="mission_btn_share" name="share" width="222" height="82"/>
<e:Button skinName="ui.IconButtonSkin" icon="mission_btn_watch" name="watch" width="222" height="82"/>
<e:layout>
<e:VerticalLayout gap="157"/>
</e:layout>
</e:Group>
<e:Button id="btnBack" skinName="ui.IconButtonSkin" icon="common_btn_back" width="61" height="62" y="10" right="10"/>
<e:Group id="grpShareTips" width="100%" height="100%" visible="false">
<e:Rect width="100%" height="100%" fillAlpha="0.7" x="0" y="0"/>
<e:Image source="mission_share_tips" x="244" y="0"/>
</e:Group>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="scene.ScenePlaySkin" width="750" height="1206" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing" xmlns:tween="egret.tween.*" xmlns:ns1="*">
<e:Skin class="scene.ScenePlaySkin" width="750" height="1334" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing" xmlns:tween="egret.tween.*" xmlns:ns1="*">
<w:Declarations>
<tween:TweenGroup id="enter">
<tween:TweenItem target="{labScore}">
<tween:To duration="200" ease="cubicOut">
<tween:TweenItem target="{image}">
<tween:To duration="250" ease="backOut">
<tween:props>
<e:Object y="{20}"/>
<e:Object scaleX="{1}" scaleY="{1}"/>
</tween:props>
</tween:To>
</tween:TweenItem>
<tween:TweenItem target="{grpNav}">
<tween:To duration="250" ease="cubicOut">
<tween:props>
<e:Object x="{20}"/>
</tween:props>
</tween:To>
</tween:TweenItem>
<tween:TweenItem target="{grpRight}">
<tween:To duration="250" ease="cubicOut">
<tween:props>
<e:Object x="{625}"/>
</tween:props>
</tween:To>
</tween:TweenItem>
<tween:TweenItem target="{grpRule}">
<tween:To duration="250" ease="cubicOut">
<tween:props>
<e:Object bottom="{10}"/>
</tween:props>
</tween:To>
</tween:TweenItem>
</tween:TweenGroup>
<tween:TweenGroup id="leave">
<tween:TweenItem target="{labScore}">
<tween:TweenItem target="{image}">
<tween:To duration="200" ease="cubicIn">
<tween:props>
<e:Object scaleX="{0}" scaleY="{0}"/>
</tween:props>
</tween:To>
</tween:TweenItem>
<tween:TweenItem target="{grpNav}">
<tween:To duration="200" ease="cubicIn">
<tween:props>
<e:Object x="{-91}"/>
</tween:props>
</tween:To>
</tween:TweenItem>
<tween:TweenItem target="{grpRight}">
<tween:To duration="200" ease="cubicIn">
<tween:props>
<e:Object x="{750}"/>
</tween:props>
</tween:To>
</tween:TweenItem>
<tween:TweenItem target="{grpRule}">
<tween:To duration="200" ease="cubicIn">
<tween:props>
<e:Object y="{-61}"/>
<e:Object bottom="{-187}"/>
</tween:props>
</tween:To>
</tween:TweenItem>
</tween:TweenGroup>
</w:Declarations>
<e:Rect id="touchLayer" width="100%" height="100%" fillAlpha="0.01" fillColor="0xffffff"/>
<ns1:ScoreLabel id="labScore" text="0" font="font_yellow" touchEnabled="false" y="-61" horizontalCenter="0"/>
<e:BitmapLabel id="labScoreAdd" text="+0" font="font_yellow" touchEnabled="false" horizontalCenter="0" verticalCenter="-300" scaleX="2" scaleY="2"/>
<ns1:ReadyGo id="readyGo" skinName="component.ReadyGoSkin" verticalCenter="0"/>
<e:Image source="bg_play" bottom="0" locked="true"/>
<e:Image source="play_wave" x="162" bottom="570"/>
<e:ProgressBar id="prgProgress" skinName="ui.ProgressSkin" x="245" maximum="1000" bottom="607"/>
<ns1:GameView id="gameView" skinName="component.GameViewSkin" horizontalCenter="0" bottom="208" locked="true"/>
<e:Image id="imgAddScore" source="play_score_add_100" x="295" bottom="600" visible="false"/>
<e:Group id="grpNav" x="-91" verticalCenter="0" touchEnabled="false" locked="true">
<e:Button skinName="ui.IconButtonSkin" icon="play_btn_item" width="86" height="122" name="free_item" x="3"/>
<e:Button skinName="ui.IconButtonSkin" icon="play_btn_treasure" width="91" height="106" name="draw_reward" y="149" x="0"/>
<e:Button skinName="ui.IconButtonSkin" icon="play_btn_gift" width="85" height="106" name="rewards" y="280" x="3"/>
<ns1:Badge x="66" y="0" skinName="component.BadgeSkin" badgeName="BADGE_ITEM_COUNT"/>
<ns1:Badge x="67" y="139" skinName="component.BadgeSkin" badgeName="BADGE_DRAW_REWARD_COUNT"/>
</e:Group>
<e:Group id="grpRight" x="750" verticalCenter="-149" width="105" height="136">
<e:Button id="btnDownload" skinName="ui.IconButtonSkin" icon="play_btn_download" width="105" height="105"/>
<e:Image id="imgDownloadLabel" y="110" source="play_txt_install_game" horizontalCenter="0"/>
</e:Group>
<e:Group id="grpRule" left="50" right="50" bottom="-187" locked="true">
<e:Rect width="100%" height="100%" fillColor="0xffffff" ellipseWidth="50" ellipseHeight="50" fillAlpha="0.8"/>
<e:Label text="活动规则" y="20" textColor="0xae262f" x="265" bold="true"/>
<e:Label text="1,即日起—10月7号,用炮弹攻打章鱼身上的能量球,每满1000能量,即可进行一次抽奖,100%有奖。\n2,每天每个用户可获得免费10个炮弹,完成任务可获得更多炮弹哦" anchorOffsetX="0" textColor="0xae262f" left="30" right="30" top="60" bottom="20" size="23" lineSpacing="5"/>
</e:Group>
<e:Image id="image" source="play_slogan" x="376" y="220" anchorOffsetX="199" anchorOffsetY="171" locked="true"/>
<e:Image id="imgLogo" source="play_logo" x="10" y="10"/>
</e:Skin>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="ui.ProgressSkin" xmlns:e="http://ns.egret.com/eui" xmlns:w="http://ns.egret.com/wing">
<e:Image x="0" y="0" source="common_progress_track"/>
<e:Image id="thumb" source="common_progress_thumb" x="1"/>
<e:Label id="labelDisplay" text="0/0" y="2" textColor="0x6f3285" size="18" horizontalCenter="0"/>
</e:Skin>
\ No newline at end of file
......@@ -3,7 +3,9 @@ import ThemeAdapter from "./views/adapters/ThemeAdapter";
import LoadingView from "./views/LoadingView";
import GameConfig from "./model/GameConfig";
import MainStage from "./views/MainStage";
import {Dispatcher, LocalStorage, StageProxy} from "./alienlib-cjs/support";
import {Dispatcher} from "@alienlib/supp";
import {init as initStageProxy} from "@alienlib/support/StageProxy";
import {init as initLocalStorage} from "@alienlib/support/LocalStorage";
class Main extends eui.UILayer {
constructor() {
......@@ -14,7 +16,8 @@ class Main extends eui.UILayer {
private onAddedToStage() {
Dispatcher.init();
StageProxy.init(this.stage, this);
initStageProxy(this.stage, this);
initLocalStorage(GameConfig.gameName);
this.stage.scaleMode = egret.Capabilities.isMobile ? egret.StageScaleMode.FIXED_WIDTH : egret.StageScaleMode.SHOW_ALL;
this.stage.orientation = egret.Capabilities.isMobile ? egret.OrientationMode.PORTRAIT : egret.OrientationMode.AUTO;
......@@ -44,7 +47,7 @@ class Main extends eui.UILayer {
await this.loadTheme();
let loadingView = LoadingView.instance;
this.addChild(loadingView);
await RES.loadGroup("loading", 0, loadingView);
await RES.loadGroup("common", 0, loadingView);
}
catch (e) {
console.error(e);
......@@ -65,8 +68,6 @@ class Main extends eui.UILayer {
* Create scene interface
*/
protected createGameScene(): void {
LocalStorage.init(GameConfig.gameName);
let mainStage:MainStage = MainStage.instance;
this.addChildAt(mainStage, 0);
}
......
......@@ -4,27 +4,35 @@
import Alert from "./views/panels/PanelAlert";
import Toast from "./views/components/Toast";
import lang from "./lang";
import {gameInfo} from "./model/DataCenter";
import {gameInfo} from "./model/data-center";
export default class Utils{
static showErrorAlert(e = null, callback = null){
let text = e || lang.net_error;
Alert.show(text, function(){
if(callback){
callback();
}
})
}
static showNoMoreCredits(){
Toast.show({text: gameInfo.creditUnit + lang.no_more_credits});
}
export function showErrorAlert(e = null, callback?){
let text = !e || e instanceof Error ? lang.net_error : e;
Alert.show(text, function(){
if(callback){
callback();
}else{
location.reload();
}
})
}
export function catchError(p, callback?){
p.catch(e=>{
if(e instanceof Error){
console.log(e.message);
console.log(e.stack);
}
showErrorAlert(e, callback);
})
}
export function showNoMoreCredits(){
Toast.show({text: gameInfo.creditUnit + lang.no_more_credits});
}
static delayLoad(){
RES.loadGroup('menu');
RES.loadGroup('common');
RES.loadGroup('play');
RES.loadGroup('panel_rank');
RES.loadGroup('panel_result');
}
export function delayLoad(){
RES.loadGroup('mission');
RES.loadGroup('draw_reward');
RES.loadGroup('panels');
}
......@@ -2,7 +2,119 @@
* Created by rockyl on 2017/12/21.
*/
declare const resPath:string;
declare const revivePluginId:number;
declare const recordUrl: string;
declare const resPath: string;
declare const revivePluginId: number;
declare const drawPluginId: number;
declare function getDuibaToken(success: Function, failed: Function);
declare function devil(t);
declare const shareCfg: any;
declare module AS{
export function ready();
/**
* 用户相关接口,如登录,退出等
*
* @namespace AS.account
*/
namespace account{
function getInfo();
function logout();
function receiveAward();
function softFavorites();
function toLogin(success?, fail?);
function preferenceChannelSign();
}
/**
* APP能力相关接口,如app下载,安装等
*
* @namespace AS.app
*/
namespace app{
function appCallbackRegister();
function cancelDownload();
function downloadApp(option, callback?: Function);
function downloadFile();
function getAppInfo();
function getAppState(packageName, versionCode):string;
function installApp();
function launchApp(packageName);
function linkTo();
function pauseAppDownload();
function updateApp();
function uninstallApp();
function showGuidePopup();
function upgradeToMainAppSearch();
function getInstalledAppList();
}
/**
* 分享到其他社交平台接口,如微博,微信等
*
* @namespace AS.share
*/
namespace share{
function setData(data, callback, type?);
function showTitleBarShare();
function showTitleBarDownload();
}
/**
* 手机系统能力调用接口,如相册、摄像头、电话短信等
*
* @namespace AS.sys
*/
namespace sys{
function openAlbum();
function openCamera();
function openMap();
function openSendMail();
function openSendSMS();
function sendSMS();
function openCallTel();
function callTel();
function checkCreateShortcut();
function addShortcut();
function deleteShortcut();
function isSupportGyroscopeSensor();
function detectGyroscopeSensor();
function cancelDetectGyroscopeSensor();
function getMaxVolume();
function getVolume();
function setVolume();
function detectVoiceLevel();
function cancelVoiceLevel();
function addCalendarRemind();
function copy();
function isAndroidEmulator();
function finishActivity();
function quitDialogRegister();
}
/**
* 高级功能接口,intent相关
*
* @namespace AS.bridge
*/
namespace bridge{
function startActivityIntent();
function startBroadcastIntent();
function startServiceIntent();
}
/**
* 支付功能接口,如发起支付、获取支付用户信息
*
* @namespace AS.pay
*/
namespace pay{
function getPaymentUser();
function sendPayment();
}
}
\ No newline at end of file
/**
* Created by admin on 2017/5/23.
*
* 常量名词
*/
export default class ConstantNames{
static SCENE_STORY:string = 'SCENE_STORY';
static SCENE_MENU:string = 'SCENE_MENU';
static SCENE_PLAY:string = 'SCENE_PLAY';
static SCENE_FINAL_REWARD:string = 'SCENE_FINAL_REWARD';
}
/**
* Created by rocky.l on 2017/2/8.
*/
export default class EventNames{
public static SETTING_CHANGED: string = 'SETTING_CHANGED';
public static SHOW_WAITING:string = 'SHOW_WAITING';
public static HIDE_WAITING:string = 'HIDE_WAITING';
public static SHOW_TOAST:string = 'SHOW_TOAST';
public static HIDE_TOAST:string = 'HIDE_TOAST';
}
......@@ -31,4 +31,12 @@ export default class GameInfo{
get status(){
return this.data.status;
}
get gameId(){
return this.data.gameId;
}
get consumerId(){
return this.data.consumerId;
}
}
/**
* Created by admin on 2017/6/30.
*/
import {StringUtils, Utils} from "../alienlib-cjs/tools";
import {StringUtils, Utils} from "@alienlib/tools";
import {LanguageIds, LanguagePack} from "./LanguagePack";
export default class Language extends LanguagePack{
......
......@@ -17,6 +17,9 @@ export class LanguagePack{
me:string;
rank_max_score:string;
rank_reward_content:string;
no_more_items:string;
need_install_app:string;
share_result:any;
}
export class LanguageIds{
need_login:string = 'need_login';
......@@ -37,4 +40,7 @@ export class LanguageIds{
me:string = 'me';
rank_max_score:string = 'rank_max_score';
rank_reward_content:string = 'rank_reward_content';
no_more_items:string = 'no_more_items';
need_install_app:string = 'need_install_app';
share_result:string = 'share_result';
}
\ No newline at end of file
/**
* Created by admin on 2017/5/23.
*
* 常量名词
*/
export const SCENE_STORY:string = 'SCENE_STORY';
export const SCENE_MENU:string = 'SCENE_MENU';
export const SCENE_PLAY:string = 'SCENE_PLAY';
export const SCENE_MISSION:string = 'SCENE_MISSION';
export const SCENE_DRAW_REWARD:string = 'SCENE_DRAW_REWARD';
export const SCENE_FINAL_REWARD:string = 'SCENE_FINAL_REWARD';
export const BADGE_ITEM_COUNT:string = 'BADGE_ITEM_COUNT';
export const BADGE_DRAW_REWARD_COUNT:string = 'BADGE_DRAW_REWARD_COUNT';
\ No newline at end of file
/**
* Created by rockyl on 2018/9/12.
*
* 数据中心
*/
import GameInfo from "./GameInfo";
export const gameInfo: GameInfo = new GameInfo();
......
/**
* Created by rocky.l on 2017/2/8.
*
* 事件名
*/
export const SETTING_CHANGED: string = 'SETTING_CHANGED';
export const SHOW_WAITING: string = 'SHOW_WAITING';
export const HIDE_WAITING: string = 'HIDE_WAITING';
export const SHOW_TOAST: string = 'SHOW_TOAST';
export const HIDE_TOAST: string = 'HIDE_TOAST';
export const SCORE_CHANGE: string = 'SCORE_CHANGE';
export const BADGE_CHANGED: string = 'BADGE_CHANGED';
\ No newline at end of file
/**
* Created by rockyl on 2018/7/24.
*
* 埋点
*/
export default class BuriedPoint {
dpm: string;
dcm: string;
constructor(dpm, dcm, env){
this.dpm = this.fill(dpm, env);
this.dcm = this.fill(dcm, env);
}
fill(src, env){
let result = src;
for(let key in env){
result = result.replace(key, env[key]);
}
return result;
}
}
......@@ -4,7 +4,7 @@
* 网络服务
*/
import GameConfig from "../model/GameConfig";
import {Ajax, EgretUtils} from "../alienlib-cjs/tools";
import {Ajax, EgretUtils} from "@alienlib/tools";
class WebService {
/**
......@@ -31,7 +31,7 @@ class WebService {
try {
data = JSON.parse(response);
} catch (e) {
console.log('decode json failed: ' + url);
if(DEBUG) console.log('decode json failed: ' + url);
return Promise.reject(e);
}
......@@ -53,7 +53,7 @@ class WebService {
);
}
polling(successFunc, uri, params, maxTimes = 5, delay = 200, method = 'POST', responseType = 'json'): Promise<any> {
polling(successFunc, uri, params, maxTimes = 5, delay = 400, method = 'POST', responseType = 'json'): Promise<any> {
let p = Promise.resolve();
for (let i = 0; i < maxTimes; i++) {
......
/**
* Created by rockyl on 2018/8/21.
*
* api
*/
import webService from "./WebService";
import GameConfig from "../model/GameConfig";
import {authData, gameInfo, pluginInfos} from "../model/DataCenter";
import {injectProp} from "../alienlib-cjs/tools/Utils";
import {md5} from "../alienlib-cjs/tools/md5";
import {authData, gameInfo, pluginInfos} from "../model/data-center";
import {injectProp} from "@alienlib/tools/Utils";
import {md5} from "@alienlib/tools/md5";
export async function getToken() {
return new Promise((resolve, reject) => {
......@@ -116,12 +119,22 @@ export async function getStartStatus(ticketId, customizedType = null) {
}
export async function getPrizeInfo(activityId) {
pluginInfos[revivePluginId] = await webService.callApi(
pluginInfos[activityId] = await webService.callApi(
'/activityPlugDrawInfo/getPrizeInfo',
{activityId}
{activityId},
'get'
);
}
export async function plugDrawInfo(activityId) {
const {plugin} = await webService.callApi(
'/plugin/plugDrawInfo',
{id: activityId},
'get'
);
}
export async function datapash(collection) {
await webService.callApi(
'/ngame/new/datapash',
......@@ -145,7 +158,7 @@ export async function getRankRewardList(showName = false) {
export async function draw(activityId, deductCredits = false) {
const {orderId} = await doJoinPlugDraw(activityId, deductCredits);
await getPlugOrderStatus(orderId);
return getPlugOrderStatus(orderId);
}
export async function doJoinPlugDraw(activityId, deductCredits = false) {
......@@ -161,7 +174,8 @@ export async function getPlugOrderStatus(orderId) {
return data.result != 0;
},
'/plugin/getOrderStatus',
{orderId}
{orderId},
10,
);
}
......@@ -207,3 +221,33 @@ export async function getSubmitResult(orderId) {
params
);
}
export async function getBaiduGameInfo() {
updateBaiduGameInfo(await webService.callApi(
'/aaw/baidu/api/getInfo',
{
activityId: GameConfig.gameConfig.gameId,
},
'get'
));
}
export async function addTimes(type) {
return webService.callApi(
'/aaw/baidu/api/addTimes',
{
activityId: GameConfig.gameConfig.gameId,
type,
},
'get'
);
}
export async function doPlay() {
return webService.callApi(
'/aaw/baidu/api/doPlay',
{
activityId: GameConfig.gameConfig.gameId,
}
);
}
/**
* Created by rockyl on 2018/8/23.
*
* 任务服务
*/
import Service from "./Service";
import {BADGE_CHANGED} from "../model/events";
class BadgeService extends Service {
items: any;
async start(): Promise<void> {
await super.start();
this.items = {};
}
private getItem(name){
let item = this.items[name];
if(!item){
item = this.items[name] = {
number: 0,
};
}
return item;
}
private updateItem(name, item, number){
item.number = number;
this.dispatchEventWith(BADGE_CHANGED, false, {name, number})
}
update(name, number){
const item = this.getItem(name);
this.updateItem(name, item, number);
}
change(name, number){
const item = this.getItem(name);
this.updateItem(name, item, item.number + number);
}
getNumber(name){
const item = this.getItem(name);
return item.number;
}
}
const badgeService: BadgeService = new BadgeService();
export default badgeService;
/**
* Created by rockyl on 2018/9/29.
*
* 埋点服务
*/
import Service from "./Service";
import GameConfig from "../model/GameConfig";
import {JSONP} from "@alienlib/tools/Ajax";
import webService from "../net/WebService";
import BuriedPoint from "../net/BuriedPoint";
import {gameInfo} from "../model/data-center";
const buriedPointConfigs = {
btn_send: {dpm: 'app_id.202.7.1', dcm: '213.oaid.0.0',},// 攻击
btn_free_item: {dpm: 'app_id.202.7.2', dcm: '213.oaid.0.0',},// 免费炮弹icon
btn_treasure: {dpm: 'app_id.202.7.3', dcm: '213.oaid.0.0',},// 首页宝箱icon
btn_download_out: {dpm: 'app_id.202.7.4', dcm: '213.oaid.0.0',},// 下载游戏icon
scene_treasure: {dpm: 'app_id.202.7.5', dcm: '213.oaid.0.0',},// 抽奖页宝箱
btn_download: {dpm: 'app_id.202.7.6', dcm: '213.oaid.0.0',},// 下载任务
btn_login: {dpm: 'app_id.202.7.7', dcm: '213.oaid.0.0',},// 登录游戏任务
btn_share: {dpm: 'app_id.202.4.1', dcm: '213.oaid.0.0',},// 分享任务
btn_watch_video: {dpm: 'app_id.202.7.8', dcm: '213.oaid.0.0',},// 观看视频任务
};
class BuriedPointService extends Service {
private _buriedPoints: any = {};
env: any;
async start(): Promise<void> {
await super.start();
this.initEnv();
this.addBuriedPointConfigs(buriedPointConfigs);
}
initEnv(){
this.env = {
app_id: GameConfig.appConfig.appId,
oaid: GameConfig.gameConfig.oaId,
}
}
addBuriedPoints(buriedPoints) {
for (let name in buriedPoints) {
this._buriedPoints[name] = buriedPoints[name];
}
}
addBuriedPointConfigs(configs) {
for (let name in configs) {
const {dpm, dcm} = configs[name];
this._buriedPoints[name] = new BuriedPoint(dpm, dcm, this.env);
}
}
logExposure(name) {
return this.log(name, 'exposure');
}
logClick(name) {
return this.log(name, 'click');
}
log(name, type) {
let logPoint = this._buriedPoints[name];
let {consumerId} = gameInfo;
let {appId} = GameConfig.appConfig;
let {dpm, dcm} = logPoint;
if (type == 'exposure') {
return JSONP('//embedlog.duiba.com.cn/exposure/standard', {
dpm, dcm, consumerId, appId,
}, 'get').catch(e => {
//console.log(e);
});
} else {
return webService.callApi(
'/log/click',
{
dpm, dcm, consumerId, appId
},
'get'
).catch(e => {
//console.log(e);
});
}
}
}
const buriedPointService: BuriedPointService = new BuriedPointService();
export default buriedPointService;
/**
* Created by admin on 2017/6/26.
*
* 主服务
*/
import GameConfig from "../model/GameConfig";
import Service from "./Service";
import * as api from '../net/proxy'
import {gameInfo, pluginInfos} from "../model/DataCenter";
class MainService extends Service {
......@@ -15,22 +17,11 @@ class MainService extends Service {
await Promise.all([
api.getInfo(),
api.getCredits(),
api.getPrizeInfo(revivePluginId),
//api.getCredits(),
//api.getPrizeInfo(drawPluginId),
api.plugDrawInfo(drawPluginId),
])
}
async stop() {
await super.stop();
}
get reviveCost() {
return pluginInfos[revivePluginId].creditsPrice;
}
get noMoreCredits() {
return pluginInfos[revivePluginId].creditsPrice > gameInfo.credits;
}
}
const mainService: MainService = new MainService();
......
/**
* Created by admin on 2017/6/26.
*
* 事件管理器
*/
import eventManager from "../alienlib-cjs/support/EventManager";
import eventManager from "@alienlib/support/EventManager";
export default class Service extends egret.EventDispatcher{
constructor(){
......
......@@ -4,8 +4,8 @@
* 存储数据服务
*/
import Service from "./Service";
import {LocalStorage} from "../alienlib-cjs/support";
import EventNames from "../model/EventNames";
import {LocalStorage} from "@alienlib/support";
import {SETTING_CHANGED} from "../model/events";
class StorageService extends Service{
protected store:any;
......@@ -61,7 +61,7 @@ class StorageService extends Service{
this.save();
if(dispatch){
this.dispatchEventWith(EventNames.SETTING_CHANGED, false, {field, value});
this.dispatchEventWith(SETTING_CHANGED, false, {field, value});
}
}
......
......@@ -3,6 +3,7 @@
*
* 加载视图
*/
import {Dispatcher} from "@alienlib/support";
export default class LoadingView extends eui.Component implements RES.PromiseTaskReporter {
private static _instance:LoadingView;
......@@ -14,17 +15,35 @@ export default class LoadingView extends eui.Component implements RES.PromiseTas
}
public progressBar: eui.ProgressBar;
public sp: eui.Image;
constructor() {
super();
this.percentWidth = this.percentHeight = 100;
this.skinName = LoadingViewSkin;
this.onProgress(0, 100);
Dispatcher.addEventListener('RES_LOAD_PROGRESS', function(e){
const {current, total} = e.data;
this.setProgress(current/total);
}, this)
}
public onProgress(current: number, total: number): void {
public setProgress(process, immediately: boolean = false){
let d = this.progressBar.slideDuration;
if(immediately){
this.progressBar.slideDuration = 0;
}
this.progressBar.value = Math.floor(process * 100);
if(immediately){
this.progressBar.slideDuration = d;
}
}
public onProgress(current: number, total: number): void {
this.setProgress(current/total);
}
setState(state){
......
/**
* Created by rockyl on 2018/8/15.
*
* 主舞台
*/
import Service from "../services/Service";
import Toast from "./components/Toast";
import LoadingView from "./LoadingView";
import GameView from "./components/GameView";
import GameConfig from "../model/GameConfig";
import SceneController from "./scenes/SceneController";
import {PopUpManager} from "../alienlib-cjs/popup";
import ConstantNames from "../model/ConstsNames";
import {PopUpManager} from "@alienlib/popup";
import mainService from "../services/MainService";
import storageService from "../services/StorageService";
import defenseService from "../services/DefenseService";
import {init as initPopUpManager} from "../alienlib-cjs/popup/PopUpManager";
import {init as initPopUpManager} from "@alienlib/popup/PopUpManager";
import lang from "../lang";
import {gameInfo} from "../model/DataCenter";
import {Dispatcher} from "../alienlib-cjs/support";
import {gameInfo} from "../model/data-center";
import {Dispatcher} from "@alienlib/support";
import missionService from "../services/MissionService";
import {SCENE_FINAL_REWARD, SCENE_PLAY} from "../model/constants";
import badgeService from "../services/BadgeService";
import {catchError} from "../Utils";
import buriedPointService from "../services/BuriedPointService";
export default class MainStage extends eui.Component {
private static _instance: MainStage;
......@@ -33,7 +38,6 @@ export default class MainStage extends eui.Component {
toast: Toast;
loadingView: LoadingView;
gameView: GameView;
constructor() {
super();
......@@ -53,7 +57,10 @@ export default class MainStage extends eui.Component {
this.services = [
storageService,
mainService,
defenseService,
//defenseService,
missionService,
badgeService,
buriedPointService,
];
}
......@@ -62,26 +69,22 @@ export default class MainStage extends eui.Component {
initPopUpManager(this.popLayer);
this.addChildAt(this.gameView = new GameView(), 0);
this.addChildAt(this.loadingView = LoadingView.instance, 3);
this.addChildAt(this.loadingView = LoadingView.instance, 1);
SceneController.instance.configure(this.sceneContainer, {gameView: this.gameView});
SceneController.instance.configure(this.sceneContainer);
Dispatcher.addEventListener('show_loading', this.showLoading, this);
Dispatcher.addEventListener('show_black_layer', this.showBlackLayer, this);
Dispatcher.addEventListener('hide_black_layer', this.hideBlackLayer, this);
this.start()
.catch(e => {
console.log(e);
});
catchError(this.start());
}
showLoading(event) {
const {needLoad} = event.data;
this.loadingView.setState(needLoad ? 'loading' : 'blank');
if (needLoad) {
//this.loadingView.setProgress(0, true);
this.loadingView.setProgress(0, true);
}
}
......@@ -91,50 +94,36 @@ export default class MainStage extends eui.Component {
}
showBlackLayer(event) {
const {promise} = event.data;
const layer = this.loadingView;
Toast.clean();
this.addChildAt(layer, 3);
promise.then(
(data) => {
return new Promise((resolve => {
egret.Tween.get(layer).to({alpha: 1}, 300).call(() => {
resolve();
});
}))
}
)
egret.Tween.get(layer, null, null, true).to({alpha: 1}, 300).call(() => {
})
}
hideBlackLayer(event) {
const {promise} = event.data;
const layer = this.loadingView;
if (!this.contains(layer)) {
return Promise.resolve();
}
promise.then(
(data) => {
return new Promise((resolve => {
egret.Tween.get(layer).to({alpha: 0}, 300).call(() => {
if (this.contains(layer)) {
this.removeChild(layer);
}
resolve();
});
}))
egret.Tween.get(layer, null, null, true).to({alpha: 0}, 300).call(() => {
if (this.contains(layer)) {
this.removeChild(layer);
}
)
})
}
async start(params = null) {
await Promise.all(this.services.map(service => service.start()));
const code = gameInfo.statusCode;
const sceneName = code == 4 || code == 5 ? ConstantNames.SCENE_FINAL_REWARD :
ConstantNames.SCENE_MENU;
const sceneName = code == 4 || code == 5 ? SCENE_FINAL_REWARD :
SCENE_PLAY;
this.clearAndGotoScene(sceneName, params)
}
......
/**
* Created by rockyl on 2018/9/26.
*
* 角标
*/
import {VisualEventComponent} from "@alienlib/support/EventComponent";
import {BADGE_CHANGED} from "../../model/events";
import badgeService from "../../services/BadgeService";
export default class Badge extends VisualEventComponent {
public badgeName:string = '';
private lab: eui.Label;
createChildren(): void {
super.createChildren();
this.registerEvent(badgeService, BADGE_CHANGED, this.onBadgeChange, this);
this.update();
}
enableEvents() {
super.enableEvents();
this.update();
}
private onBadgeChange(event){
const {name, number} = event.data;
if(name == this.badgeName){
this.setNum(number);
}
}
update(){
this.setNum(badgeService.getNumber(this.badgeName));
}
setNum(value){
this.lab.text = value + '';
}
}
/**
* Created by rockyl on 2018/8/16.
*
* 游戏视图
*/
import {EventComponent} from "../../alienlib-cjs/support/EventComponent";
export default class GameView extends EventComponent {
hasPreSetup;
hasSetup;
preSetup() {
if (this.hasPreSetup) {
return;
}
this.hasPreSetup = true;
import {EventComponent} from "@alienlib/support/EventComponent";
import '../../game/ObjectPoolInit'
function eyeWave(offset, t) {
return {
x: Math.sin(t / 2) * offset,
}
}
setup() {
if (this.hasSetup) {
return;
}
this.hasSetup = true;
export default class GameView extends EventComponent {
}
async enter(){
async enter() {
}
async leave(){
async leave() {
}
......
/**
* Created by rockyl on 2018/8/22.
*
* ready go
*/
import {waitPromise} from "../../alienlib-cjs/tools/EgretUtils";
export default class ReadyGo extends eui.Component{
public ready: egret.tween.TweenGroup;
public go: egret.tween.TweenGroup;
setup(){
this.skinName = component.ReadyGoSkin;
}
async play(){
this.ready.play(0);
await waitPromise(700);
this.go.play(0);
await waitPromise(1000);
}
}
/**
* Created by rockyl on 2018/9/10.
*
* 分数标签
*/
export default class ScoreLabel extends eui.BitmapLabel {
formatFun: Function;
_value;
_temp;
updateScore(score, formatFun = null, animation = true) {
this.formatFun = formatFun || this.simpleFormatFun;
this._temp = this._value;
this._value = score;
if (animation) {
egret.Tween.get(this, null, null, true)
.to({temp: score}, 300);
} else {
this.update(score);
}
}
get score() {
return this._value;
}
private get temp() {
return this._temp;
}
private set temp(v) {
this._temp = v;
this.update(v);
}
private simpleFormatFun(v){
return Math.floor(v).toString();
}
update(v) {
this.text = this.formatFun && this.formatFun(v) || v;
}
}
......@@ -3,9 +3,9 @@
*
* Toast组件
*/
import {VisualEventComponent} from "../../alienlib-cjs/support/EventComponent";
import {Dispatcher} from "../../alienlib-cjs/support";
import EventNames from "../../model/EventNames";
import {VisualEventComponent} from "@alienlib/support/EventComponent";
import {Dispatcher} from "@alienlib/support";
import {HIDE_TOAST, SHOW_TOAST} from "../../model/events";
export default class Toast extends VisualEventComponent {
private static _instance:Toast;
......@@ -31,8 +31,8 @@ export default class Toast extends VisualEventComponent {
this.grp.alpha = 0;
this._queue = [];
this.registerEvent(Dispatcher, EventNames.SHOW_TOAST, this.onShow, this);
this.registerEvent(Dispatcher, EventNames.HIDE_TOAST, this.onClean, this);
this.registerEvent(Dispatcher, SHOW_TOAST, this.onShow, this);
this.registerEvent(Dispatcher, HIDE_TOAST, this.onClean, this);
}
addAndPlayOne(data = null){
......
/**
* Created by rockyl on 2018/9/5.
*
* 特效动画
*/
let factor;
export function setup(){
factor = new egret.MovieClipDataFactory(RES.getRes('effects_json'), RES.getRes('effects_png'))
}
export function makeMovieClip(name){
return new egret.MovieClip(factor.generateMovieClipData(name));
}
\ No newline at end of file
......@@ -3,11 +3,11 @@
*
* 导航视图基类
*/
import {INavigatorViewBase} from "../../alienlib-cjs/navigator/Navigator";
import {Dispatcher} from "../../alienlib-cjs/support";
import {NavigatorAction} from "../../alienlib-cjs/navigator/StackNavigator";
import {ResourceLoader} from "../../alienlib-cjs/egret";
import {EventComponent} from "../../alienlib-cjs/support/EventComponent";
import {INavigatorViewBase} from "@alienlib/navigator/Navigator";
import {Dispatcher} from "@alienlib/support";
import {NavigatorAction} from "@alienlib/navigator/StackNavigator";
import {ResourceLoader} from "@alienlib/egret";
import {EventComponent} from "@alienlib/support/EventComponent";
export default class NavigatorViewBase extends EventComponent implements INavigatorViewBase{
constructor(){
......
......@@ -4,16 +4,15 @@
* 自定义导航
*/
import NavigatorViewBase from "./NavigatorViewBase";
import {NavigatorAction} from "../../alienlib-cjs/navigator/StackNavigator";
import {Navigator} from '../../alienlib-cjs/navigator'
import {INavigatorViewBase} from "../../alienlib-cjs/navigator/Navigator";
import {injectProp} from "../../alienlib-cjs/tools/Utils";
import {NavigatorAction} from "@alienlib/navigator/StackNavigator";
import {injectProp} from "@alienlib/tools/Utils";
import {INavigatorViewBase, Navigator} from "@alienlib/navigator/Navigator";
export default class TNavigator extends Navigator{
private _rootView:eui.Group;
private _injectProps;
constructor(rootView:eui.Group, injectProps){
constructor(rootView:eui.Group, injectProps = {}){
super();
this._rootView = rootView;
......
......@@ -3,8 +3,8 @@
*
* 通知弹窗
*/
import {Flew} from "../../alienlib-cjs/popup/PopupEffect";
import {PopupBase} from "../../alienlib-cjs/popup/PopupBase";
import {Flew} from "@alienlib/popup/PopupEffect";
import {PopupBase} from "@alienlib/popup/PopupBase";
class PanelAlert extends PopupBase {
private static _instance: PanelAlert;
......
/**
* Created by rockyl on 2018/8/20.
*
* 排行榜弹窗
*/
import * as api from '../../net/proxy'
import {Flew} from "../../alienlib-cjs/popup/PopupEffect";
import {PopupBase} from "../../alienlib-cjs/popup/PopupBase";
import lang from "../../lang";
import {gameInfo} from "../../model/DataCenter";
export default class PanelRank extends PopupBase {
private static _instance: PanelRank;
public static get instance(): PanelRank {
if (this._instance == undefined) {
this._instance = new PanelRank();
}
return this._instance;
}
public list: eui.List;
public rankSelf: RankItem;
public btnClose: eui.Button;
private dataProvider: eui.ArrayCollection;
constructor() {
super(
Flew, {direction: 'up', withFade: true, ease: egret.Ease.backOut},
Flew, {direction: 'up', withFade: true, ease: egret.Ease.backIn},
);
}
protected getSkinName(): any {
return panel.PanelRankSkin;
}
protected getResGroupNames() {
return ['panel_rank'];
}
protected childrenCreated(): void {
super.childrenCreated();
this.list.itemRenderer = IRRankItem;
this.list.dataProvider = this.dataProvider = new eui.ArrayCollection();
this.registerEvent(this.btnClose, egret.TouchEvent.TOUCH_TAP, this.onBtnCloseTap, this);
}
private onBtnCloseTap(event: egret.Event): void {
this.dealAction();
}
async show() {
await this.popup();
const {userList, user} = await api.getRealtimeRank(0);
this.rankSelf.visible = user;
if(user){
this.rankSelf.setData(user);
}
this.dataProvider.source = userList;
}
}
class IRRankItem extends eui.ItemRenderer {
rankItem: RankItem;
protected dataChanged(): void {
super.dataChanged();
this.rankItem.setData(this.data);
}
}
class RankItem extends eui.Component {
public labNum:eui.Label;
public labName:eui.Label;
public labScore:eui.Label;
setData(data){
let {nickName, cid, rank, maxScore} = data;
this.labNum.text = RankItem.transRank(rank);
this.labName.text = nickName || cid;
this.labScore.text = (maxScore ? maxScore : 0) + lang.score_unit;
}
static transRank(rank){
let result;
switch(rank){
case null:
result = lang.rank_out;
break;
case '1':
result = lang.rank_first;
break;
case '2':
result = lang.rank_second;
break;
case '3':
result = lang.rank_third;
break;
default:
result = lang.format(lang.rank_num, rank);
break;
}
return result;
}
}
/**
* Created by rockyl on 2018/8/20.
*
* 排行榜开奖弹窗
*/
import {Flew} from "../../alienlib-cjs/popup/PopupEffect";
import * as api from '../../net/proxy'
import {PopupBase} from "../../alienlib-cjs/popup/PopupBase";
import lang from "../../lang";
export default class PanelRankReward extends PopupBase {
private static _instance: PanelRankReward;
public static get instance(): PanelRankReward {
if (this._instance == undefined) {
this._instance = new PanelRankReward();
}
return this._instance;
}
public labContent:eui.Label;
public btnShowRank:eui.Button;
constructor() {
super(
Flew, {direction: 'up', withFade: true, ease: egret.Ease.backOut},
Flew, {direction: 'up', withFade: true, ease: egret.Ease.backIn},
);
this.addExcludeForClose(['show_rank'])
}
protected getSkinName(): any {
return panel.PanelRankRewardSkin;
}
protected childrenCreated(): void {
super.childrenCreated();
this.registerEvent(this.btnShowRank, egret.TouchEvent.TOUCH_TAP, this.onBtnShowRankTap, this);
}
private onBtnShowRankTap(event: egret.Event): void {
this.dealAction('show_rank');
}
async show(callback) {
await this.popup(callback);
const {consumer} = await api.getRankRewardList();
const {cid, rank, option} = consumer;
this.labContent.text = lang.format(lang.rank_reward_content, rank, option, cid);
}
}
......@@ -3,11 +3,17 @@
*
* 结果弹窗
*/
import Utils from "../../Utils";
import {Flew} from "../../alienlib-cjs/popup/PopupEffect";
import {PopupBase} from "../../alienlib-cjs/popup/PopupBase";
import lang from "../../lang";
import {gameInfo} from "../../model/DataCenter";
import {Flew} from "@alienlib/popup/PopupEffect";
import {PopupBase} from "@alienlib/popup/PopupBase";
const panelResultHeights = {
real_reward: 755,
unreal_reward: 755,
no_more_item: 585,
no_reward: 585,
need_more_power: 775,
};
export default class PanelResult extends PopupBase {
private static _instance: PanelResult;
......@@ -19,22 +25,15 @@ export default class PanelResult extends PopupBase {
}
public btnClose:eui.Button;
public labScore:eui.BitmapLabel;
public labMaxScore:eui.Label;
public imgReward:eui.Image;
public labRewardIntro:eui.Label;
public grpButtons:eui.Group;
public labCost:eui.Label;
public btnConfirm:eui.Button;
private reward;
private lottery;
constructor() {
super(
Flew, {direction: 'up', withFade: true, ease: egret.Ease.backOut},
Flew, {direction: 'up', withFade: true, ease: egret.Ease.backIn},
);
this.addExcludeForClose(['retry'])
}
protected getSkinName(): any {
......@@ -44,58 +43,21 @@ export default class PanelResult extends PopupBase {
protected childrenCreated(): void {
super.childrenCreated();
this.registerEvent(this.grpButtons, egret.TouchEvent.TOUCH_TAP, this.onGrpButtonsTap, this);
this.registerEvent(this.btnClose, egret.TouchEvent.TOUCH_TAP, this.onBtnCloseTap, this);
this.registerEvent(this.imgReward, egret.TouchEvent.TOUCH_TAP, this.onImgRewardTap, this);
}
private onGrpButtonsTap(event: egret.Event): void {
switch(event.target.name){
case 'retry':
if(gameInfo.status.btnDisable){
Utils.showNoMoreCredits();
}else{
this.dealAction('retry');
}
this.inactive();
break;
case 'get_reward':
this.onImgRewardTap();
break;
}
}
private onImgRewardTap(event = null){
if(this.reward){
location.href = this.reward.link;
}
this.registerEvent(this.btnConfirm, egret.TouchEvent.TOUCH_TAP, this.onBtnConfirmTap, this);
}
private onBtnCloseTap(event) {
this.dealAction();
}
private onBtnConfirmTap(event) {
this.dealAction(this.currentState);
}
async show(data, callback) {
this._callback = callback;
const {score, maxScore, submitResp} = data;
this.reward = submitResp.option && submitResp.option.lottery;
this.currentState = this.reward ? 'reward' : 'normal';
this.height = this.reward ? 646 : 426;
await this.popup();
if(this.reward){
const {title, imgurl} = this.reward;
this.imgReward.source = imgurl;
this.labRewardIntro.text = title;
}
this.labScore.text = lang.format(lang.current_score, score);
this.labMaxScore.text = lang.format(lang.max_score, maxScore);
this.labCost.text = gameInfo.status.text;
}
}
/**
* Created by rockyl on 2018/8/20.
*
* 复活弹窗
*/
import {Utils} from "../../alienlib-cjs/tools";
import {Fade, Flew} from "../../alienlib-cjs/popup/PopupEffect";
import {Wave} from "../../alienlib-cjs/animation/Wave";
import {PopupBase} from "../../alienlib-cjs/popup/PopupBase";
import lang from "../../lang";
import {gameInfo} from "../../model/DataCenter";
export default class PanelRevive extends PopupBase {
private static _instance: PanelRevive;
public static get instance(): PanelRevive {
if (this._instance == undefined) {
this._instance = new PanelRevive();
}
return this._instance;
}
public btnConfirm:eui.Button;
public labContent:eui.Label;
public btnClose:eui.Button;
private aniBtnConfirm: Wave;
constructor() {
super(
Flew, {direction: 'up', withFade: true, ease: egret.Ease.backOut},
Fade, {},
);
this.addExcludeForClose(['revive'])
}
protected getSkinName(): any {
return panel.PanelReviveSkin;
}
createChildren(): void {
super.createChildren();
this.registerEvent(this.btnConfirm, egret.TouchEvent.TOUCH_TAP, this.onBtnConfirmTap, this);
this.registerEvent(this.btnClose, egret.TouchEvent.TOUCH_TAP, this.onBtnCloseTap, this);
Utils.anchorCenter(this.btnConfirm);
this.aniBtnConfirm = new Wave(this.btnConfirm, 4000, Wave.breath.bind(null, 0.05));
}
active(): void {
super.active();
this.aniBtnConfirm.play();
}
inactive(): void {
super.inactive();
this.aniBtnConfirm.stop();
}
async show({cost}, callback) {
this._callback = callback;
await this.popup();
this.labContent.text = lang.format(lang.revive_cost, cost, gameInfo.creditUnit);
}
private onBtnConfirmTap(event) {
this.dealAction('revive');
}
private onBtnCloseTap(event) {
this.dealAction();
}
}
/**
* Created by rockyl on 2018/8/22.
*
* 规则弹窗
*/
import {Flew} from "../../alienlib-cjs/popup/PopupEffect";
import {StageProxy} from "../../alienlib-cjs/support";
import * as api from '../../net/proxy'
import {PopupBase} from "../../alienlib-cjs/popup/PopupBase";
import {HtmlTextParser} from "../../alienlib-cjs/egret/HtmlTextParser";
export default class PanelRule extends PopupBase{
private static _instance:PanelRule;
public static get instance():PanelRule {
if (this._instance == undefined) {
this._instance = new PanelRule();
}
return this._instance;
}
public scroller:eui.Scroller;
public labContent:eui.Label;
public btnClose:eui.Button;
htmlTextParser: HtmlTextParser;
constructor() {
super(
Flew, {direction: 'up', withFade: true, ease: egret.Ease.backOut},
Flew, {direction: 'up', withFade: true, ease: egret.Ease.backIn},
);
this.skinName = panel.PanelRuleSkin;
}
protected getSkinName(): any {
return panel.PanelRuleSkin;
}
protected childrenCreated(): void {
super.childrenCreated();
this.maxHeight = StageProxy.getHeight() - 500;
this.registerEvent(this.btnClose, egret.TouchEvent.TOUCH_TAP, this.onBtnCloseTap, this);
}
private onBtnCloseTap(event:egret.Event):void{
this.dealAction();
}
async show(callback = null) {
this._callback = callback;
await this.popup(this.dealAction);
if(!this.labContent.text){
let content = await api.getRule();
if(!this.htmlTextParser){
this.htmlTextParser = new HtmlTextParser();
}
this.labContent.textFlow = this.htmlTextParser.parse(content)
}
}
}
......@@ -2,19 +2,20 @@
* Created by admin on 2017/5/16.
*/
import NavigatorViewBase from "../core/NavigatorViewBase";
import {NavigatorAction} from "../../alienlib-cjs/navigator/StackNavigator";
import {EgretUtils} from "../../alienlib-cjs/tools";
import {Dispatcher} from "../../alienlib-cjs/support";
import {NavigatorAction} from "@alienlib/navigator/StackNavigator";
import {EgretUtils} from "@alienlib/tools";
import {Dispatcher} from "@alienlib/support";
import TNavigator from "../core/TNavigator";
import {waitPromise} from "@alienlib/tools/EgretUtils";
export default class SceneBase extends NavigatorViewBase {
public navigator: TNavigator;
protected get tweenEnter():egret.tween.TweenGroup{
protected get tweenEnter(): egret.tween.TweenGroup {
return this['enter' + (this.currentState ? '_' + this.currentState : '')];
}
protected get tweenLeave():egret.tween.TweenGroup{
protected get tweenLeave(): egret.tween.TweenGroup {
return this['leave' + (this.currentState ? '_' + this.currentState : '')];
}
......@@ -24,8 +25,8 @@ export default class SceneBase extends NavigatorViewBase {
let tween;
if (this.tweenEnter) {
this.registerEvent(this.tweenEnter, egret.Event.COMPLETE, this.onTweenEnterComplete, this);
}else{
this.skin.states.forEach(state=>{
} else {
this.skin.states.forEach(state => {
if (tween = this['enter_' + state.name]) {
this.registerEvent(tween, egret.Event.COMPLETE, this.onTweenEnterComplete, this);
}
......@@ -33,8 +34,8 @@ export default class SceneBase extends NavigatorViewBase {
}
if (this.tweenLeave) {
this.registerEvent(this.tweenLeave, egret.Event.COMPLETE, this.onTweenLeaveComplete, this);
}else{
this.skin.states.forEach(state=>{
} else {
this.skin.states.forEach(state => {
if (tween = this['leave_' + state.name]) {
this.registerEvent(tween, egret.Event.COMPLETE, this.onTweenLeaveComplete, this);
}
......@@ -50,38 +51,42 @@ export default class SceneBase extends NavigatorViewBase {
return {};
};
protected shouldShowLeaveLayer(next, action, parameters){
protected shouldShowLeaveLayer(next, action, parameters) {
return true;
}
needLoad;
protected onBeginLoadResGroups(needLoad) {
this.needLoad = needLoad;
Dispatcher.dispatch('show_loading', {needLoad})
}
protected onEndLoadResGroups() {
}
async onWillMount(next: string, action: NavigatorAction, parameters: any): Promise<any> {
await EgretUtils.waitPromise(200);
return super.onWillMount(next, action, parameters);
}
async onWillEnter(last: string, action: NavigatorAction, parameters: any): Promise<any> {
this.resetScene(parameters);
await super.onWillEnter(last, action, parameters);
//if(this.needLoad){
await EgretUtils.waitPromise(400);
//}
await EgretUtils.waitPromise(300);
if (this.tweenEnter) {
this.tweenEnter.play(0);
}
this.onPlayEnter();
const promise = Promise.resolve();
Dispatcher.dispatch('hide_black_layer', {promise});
await promise;
Dispatcher.dispatch('hide_black_layer');
await waitPromise(300);
await this.waitingForEnter();
}
private resolveEnter;
private waitingForEnter() {
return new Promise(resolve => {
if (this.tweenEnter && this.resolveEnter === false) {
......@@ -97,17 +102,16 @@ export default class SceneBase extends NavigatorViewBase {
this.tweenLeave.play(0);
}
this.onPlayLeave();
if(this.shouldShowLeaveLayer(next, action, parameters)){
await EgretUtils.waitPromise(200);
const promise = Promise.resolve();
Dispatcher.dispatch('show_black_layer', {promise});
await promise;
}
await this.waitingForLeave();
if (this.shouldShowLeaveLayer(next, action, parameters)) {
Dispatcher.dispatch('show_black_layer');
await waitPromise(300);
}
await super.onWillLeave(next, action, parameters);
}
private resolveLeave;
private waitingForLeave() {
return new Promise(resolve => {
if (this.tweenLeave) {
......@@ -119,14 +123,13 @@ export default class SceneBase extends NavigatorViewBase {
}
private onTweenEnterComplete(event: egret.Event): void {
if (typeof this.resolveEnter == 'function') {
this.resolveEnter();
}
this.resolveEnter = true;
this.resolveEnter && this.resolveEnter();
this.resolveEnter = null;
}
private onTweenLeaveComplete(event: egret.Event): void {
this.resolveLeave && this.resolveLeave();
this.resolveLeave = null;
}
protected onPlayEnter() {
......
......@@ -3,12 +3,11 @@
* 场景控制器
*/
import TNavigator from "../core/TNavigator";
import ConstantNames from "../../model/ConstsNames";
import SceneMenu from "./SceneMenu";
import SceneStory from "./SceneStory";
import {SCENE_DRAW_REWARD, SCENE_MISSION, SCENE_PLAY} from "../../model/constants";
import ScenePlay from "./ScenePlay";
import SceneFinalReward from "./SceneFinalReward";
import SceneBase from "./SceneBase";
import SceneMission from "./SceneMission";
import SceneDrawReward from "./SceneDrawReward";
export default class SceneController {
private static _instance: SceneController;
......@@ -22,7 +21,7 @@ export default class SceneController {
private _navigator: TNavigator;
private _configured;
configure(rootView, injectProps) {
configure(rootView, injectProps?) {
if (this._configured) {
return;
}
......@@ -31,10 +30,9 @@ export default class SceneController {
this._navigator = new TNavigator(rootView, injectProps);
this.register(ConstantNames.SCENE_MENU, SceneMenu);
this.register(ConstantNames.SCENE_STORY, SceneStory);
this.register(ConstantNames.SCENE_PLAY, ScenePlay);
this.register(ConstantNames.SCENE_FINAL_REWARD, SceneFinalReward);
this.register(SCENE_PLAY, ScenePlay);
this.register(SCENE_MISSION, SceneMission);
this.register(SCENE_DRAW_REWARD, SceneDrawReward);
}
register(name, clazz) {
......
/**
* Created by rockyl on 2018/8/29.
*/
import SceneBase from "./SceneBase";
import PanelRankReward from "../panels/PanelRankReward";
import PanelRank from "../panels/PanelRank";
export default class SceneFinalReward extends SceneBase {
constructor() {
super();
this.init();
}
private init(): void {
this.skinName = scene.SceneFinalRewardSkin;
}
protected getResGroupNames(): string[] {
return [];
}
protected resetScene(parameters) {
super.resetScene(parameters);
PanelRankReward.instance.show(this.onPanelRewardResult);
}
createChildren(): void {
super.createChildren();
}
onPanelRewardResult = (action) => {
if(action == 'show_rank'){
PanelRank.instance.show();
}
}
}
\ No newline at end of file
/**
* Created by rockyl on 2018/8/15.
*
* 菜单场景
*/
import SceneBase from "./SceneBase";
import ConstantNames from "../../model/ConstsNames";
import Utils from "../../Utils";
import {Utils as alienUtils} from "../../alienlib-cjs/tools";
import {NavigatorAction} from "../../alienlib-cjs/navigator/StackNavigator";
import PanelRule from "../panels/PanelRule";
import PanelRank from "../panels/PanelRank";
import * as api from '../../net/proxy'
import {Wave} from "../../alienlib-cjs/animation/Wave";
import GameView from "../components/GameView";
import {gameInfo} from "../../model/DataCenter";
import lang from "../../lang";
export default class SceneMenu extends SceneBase {
public grpBg:eui.Group;
public imgPartLeft:eui.Image;
public imgPartRight:eui.Image;
public imgPartTop:eui.Image;
public imgLogo:eui.Image;
public grpButtons:eui.Group;
public btnStart:eui.Button;
public btnRank:eui.Button;
public btnRule:eui.Button;
public labCost:eui.Label;
public labCredit:eui.Label;
public gameView:GameView;
private btnDisable;
private aniBtnStart: Wave;
protected getSkinName(): any {
return scene.SceneMenuSkin;
}
protected getResGroupNames(): string[] {
return ['menu'];
}
protected shouldShowLeaveLayer(next, action, parameters): boolean {
return next != ConstantNames.SCENE_PLAY;
}
protected onEndLoadResGroups() {
super.onEndLoadResGroups();
Utils.delayLoad();
this.gameView.preSetup();
}
childrenCreated(): void {
super.childrenCreated();
this.registerEvent(this.grpButtons, egret.TouchEvent.TOUCH_TAP, this.onGrpButtonsTap, this);
alienUtils.anchorCenter(this.btnStart);
this.aniBtnStart = new Wave(this.btnStart, 4000, Wave.breath.bind(null, 0.03), 0, false);
}
async onWillEnter(last: string, action: NavigatorAction, parameters: any): Promise<any> {
this.aniBtnStart.play();
return super.onWillEnter(last, action, parameters);
}
onDidLeave(next: string, action: NavigatorAction, parameters: any): void {
this.aniBtnStart.stop();
super.onDidLeave(next, action, parameters);
}
protected resetScene(parameters) {
super.resetScene(parameters);
const {status} = gameInfo;
const {btnDisable, text} = status;
this.btnDisable = btnDisable;
this.labCost.text = text;
this.labCredit.text = lang.my_credit + gameInfo.creditUnit + ': ' + gameInfo.credits;
}
private onGrpButtonsTap(event){
switch(event.target.name){
case 'start':
if (this.btnDisable) {
Utils.showNoMoreCredits();
} else {
this.tryStart()
.catch(e=>{
this.enabled = true;
Utils.showErrorAlert(e);
})
}
break;
case 'rule':
PanelRule.instance.show();
break;
case 'rank':
PanelRank.instance.show();
break;
}
}
private async tryStart(){
this.enabled = false;
await api.tryStart();
this.goto(ConstantNames.SCENE_PLAY);
this.enabled = true;
}
}
......@@ -4,34 +4,26 @@
* 游戏场景
*/
import SceneBase from "./SceneBase";
import defenseService from "../../services/DefenseService";
import PanelResult from "../panels/PanelResult";
import {EgretUtils} from "../../alienlib-cjs/tools";
import PanelRevive from "../panels/PanelRevive";
import mainService from "../../services/MainService";
import Toast from "../components/Toast";
import Utils from "../../Utils";
import * as api from '../../net/proxy'
import {EgretUtils} from "@alienlib/tools";
import GameView from "../components/GameView";
import lang from "../../lang";
import {gameInfo} from "../../model/DataCenter";
import {NavigatorAction} from "../../alienlib-cjs/navigator/StackNavigator";
import ScoreLabel from "../components/ScoreLabel";
import ReadyGo from "../components/ReadyGo";
new ScoreLabel();
new ReadyGo();
import {NavigatorAction} from "@alienlib/navigator/StackNavigator";
import {setup as setupEffects} from "../core/Effects";
import {SCENE_DRAW_REWARD, SCENE_MISSION} from "../../model/constants";
import {breath, Wave} from "@alienlib/animation/wave";
import {anchorCenter} from "@alienlib/tools/Utils";
import Badge from "../components/Badge";
import {SCORE_CHANGE} from "../../model/events";
import {delayLoad} from "../../Utils";
import buriedPointService from "../../services/BuriedPointService";
GameView;
Badge;
export default class ScenePlay extends SceneBase {
public touchLayer: eui.Rect;
public labScore: ScoreLabel;
public labScoreAdd: eui.BitmapLabel;
public gameView:GameView;
public readyGo: ReadyGo;
public gameView: GameView;
score;
reviveCount;
combineCount;
protected getSkinName(): any {
return scene.ScenePlaySkin;
......@@ -41,14 +33,11 @@ export default class ScenePlay extends SceneBase {
return ['play'];
}
protected shouldShowLeaveLayer(next, action, parameters): boolean {
return false;
}
protected onEndLoadResGroups() {
super.onEndLoadResGroups();
this.gameView.setup();
delayLoad();
setupEffects();
}
async onWillEnter(last: string, action: NavigatorAction, parameters: any): Promise<any> {
......@@ -57,12 +46,6 @@ export default class ScenePlay extends SceneBase {
return super.onWillEnter(last, action, parameters);
}
onDidEnter(last: string, action: NavigatorAction, parameters: any): void {
this.start();
super.onDidEnter(last, action, parameters);
}
async onWillLeave(next: string, action: NavigatorAction, parameters: any): Promise<any> {
this.gameView.leave();
......@@ -84,146 +67,15 @@ export default class ScenePlay extends SceneBase {
childrenCreated(): void {
super.childrenCreated();
defenseService.setView(this);
this.registerEvent(this.gameView, egret.Event.CHANGE, this.onScoreChange, this);
this.registerEvent(this.gameView, egret.Event.COMPLETE, this.onGameComplete, this);
this.registerEvent(this.touchLayer, egret.TouchEvent.TOUCH_BEGIN, this.onTouchLayerTouchBeing, this);
this.readyGo.setup();
this.labScoreAdd.visible = false;
//defenseService.setView(this);
}
protected resetScene(parameters) {
this.reset();
}
async reset(){
this.labScore.updateScore(0, null, false);
defenseService.reset();
}
async start() {
this.score = 0;
this.reviveCount = 0;
this.combineCount = 0;
await this.gameView.reset();
await this.readyGo.play();
this.gameView.start();
this.enabled = true;
}
private async tryStart() {
this.enabled = false;
await api.tryStart();
PanelResult.instance.close();
await this.reset();
await this.start();
}
private onScoreChange(event) {
const {scoreAdd, } = event.data;
let scoreChange = 0;
if(scoreAdd == 1){
this.combineCount = 0;
scoreChange = 10;
}else{
this.combineCount = Math.min(++this.combineCount, 5);
scoreChange = this.combineCount * 20;
}
this.score += scoreChange;
this.labScore.updateScore(this.score, null, true);
if (scoreChange > 0) {
const labScoreAdd = this.labScoreAdd;
labScoreAdd.visible = true;
labScoreAdd.alpha = 0;
labScoreAdd.verticalCenter = -200;
labScoreAdd.text = '+' + scoreChange;
egret.Tween.get(labScoreAdd, null, null, true)
.to({verticalCenter: -250, alpha: 1,}, 200, egret.Ease.cubicIn)
.wait(300)
.to({verticalCenter: -300, alpha: 0,}, 100, egret.Ease.cubicOut)
.call(function () {
labScoreAdd.visible = false;
}, this);
}
defenseService.scoreChanged(this.score);
}
private onTouchLayerTouchBeing(event){
this.gameView.jump();
}
private async onGameComplete(event) {
this.enabled = false;
await EgretUtils.waitPromise(100);
if (this.reviveCount < 1) {
PanelRevive.instance.show({
cost: mainService.reviveCost,
}, this.onPanelReviveResult
);
} else {
this.submit();
}
}
private onPanelReviveResult = async (action) => {
if (action == 'revive') {
PanelRevive.instance.inactive();
this.revive().catch(e => {
PanelRevive.instance.active();
Toast.show({text: lang.revive_failed});
});
} else {
this.submit();
}
};
private onPanelResultResult = (action) => {
switch (action) {
case 'retry':
PanelResult.instance.inactive();
this.tryStart()
.catch(e => {
PanelResult.instance.active();
Utils.showErrorAlert(e);
});
break;
default:
this.back();
break;
}
};
private async submit() {
try {
const score = this.score;
const {collection, strategyCollection} = defenseService.close();
const submitResp = await api.submit(score, collection, strategyCollection);
PanelResult.instance.show({
submitResp,
score: Math.round(score),
maxScore: gameInfo.maxScore,
}, this.onPanelResultResult);
} catch (e) {
Utils.showErrorAlert();
}
}
private async revive() {
await api.draw(revivePluginId, true);
this.gameView.revive();
this.enabled = true;
this.reviveCount++;
PanelRevive.instance.close();
async reset() {
//defenseService.reset();
}
}
/**
* Created by rockyl on 2018/8/29.
*
* 故事场景
*/
import SceneBase from "./SceneBase";
import Utils from "../../Utils";
import {NavigatorAction} from "../../alienlib-cjs/navigator/StackNavigator";
import ConstantNames from "../../model/ConstsNames";
import {CountingTime} from "../../alienlib-cjs/tools/CountingTime";
export default class SceneStory extends SceneBase {
public story: egret.tween.TweenGroup;
public grpSkip: eui.Group;
public labCD: eui.BitmapLabel;
private cd: CountingTime;
constructor() {
super();
this.cd = new CountingTime(5, 0, {renderer: this.renderer, onComplete: this.onComplete})
}
protected getSkinName(): any {
return scene.SceneStorySkin;
}
protected getResGroupNames(): string[] {
return ['story'];
}
protected onEndLoadResGroups() {
super.onEndLoadResGroups();
Utils.delayLoad();
}
onDidEnter(last: string, action: NavigatorAction, parameters: any): void {
super.onDidEnter(last, action, parameters);
this.story.play(0);
this.cd.start();
}
createChildren(): void {
super.createChildren();
this.registerEvent(this.grpSkip, egret.TouchEvent.TOUCH_TAP, this.onGrpSkinTap, this);
}
private onGrpSkinTap(event = null) {
this.story.stop();
this.cd.stop();
this.goto(ConstantNames.SCENE_MENU);
}
private renderer = (t) => {
this.labCD.text = t.toString();
};
private onComplete = () => {
this.onGrpSkinTap();
};
}
\ No newline at end of file
......@@ -15,7 +15,7 @@
],
"baseUrl": "./",
"paths": {
"@alienlib/*": ["src/alienlib-cjs/*"]
"@alienlib/*": ["/Users/rockyl/WorkSpaces/alienlib/src/*"]
}
},
"exclude": [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment