Commit 8671f224 authored by rockyl's avatar rockyl

init

parents
Pipeline #126831 failed with stages
in 5 seconds
node_modules/
debug/
design/origin/
dist/
\ No newline at end of file
{"currentScene":"assets/scenes/main.scene"}
\ No newline at end of file
{"ver":"1.0.1","uuid":"81900259-12e0-44a6-94f4-88bb48d0fe8b","subMetas":{},"isGroup":true}
{"mc":{
"coin":{
"frameRate":24,
"events":[
],
"frames":[
{
"res":"13497B6D",
"x":-45,
"y":-47
},
{
"res":"87CF8D85",
"x":-44,
"y":-47
},
{
"res":"2CDD23F0",
"x":-36,
"y":-47
},
{
"res":"D4BE6F6D",
"x":-23,
"y":-47
},
{
"res":"ECEC9D8A",
"x":-8,
"y":-47
},
{
"res":"4BC78864",
"x":-25,
"y":-47
},
{
"res":"F2156B7D",
"x":-38,
"y":-47
},
{
"res":"61BC53A",
"x":-45,
"y":-47
}
]
}},
"res":{
"61BC53A":{"x":0,"y":0,"w":93,"h":94},
"F2156B7D":{"x":95,"y":96,"w":78,"h":94},
"4BC78864":{"x":190,"y":0,"w":53,"h":94},
"13497B6D":{"x":95,"y":0,"w":93,"h":94},
"D4BE6F6D":{"x":0,"y":192,"w":53,"h":94},
"ECEC9D8A":{"x":55,"y":192,"w":20,"h":94},
"87CF8D85":{"x":0,"y":96,"w":93,"h":94},
"2CDD23F0":{"x":175,"y":96,"w":78,"h":94}
}}
\ No newline at end of file
{"ver":"1.0.1","uuid":"7a81c636-599e-4707-8688-9d13306cb29c","subMetas":{"coin":{"ver":"1.0.1","uuid":"943a42a1-7426-4894-a880-39a4f5dbf7ab","rawTextureUuid":"7a81c636-599e-4707-8688-9d13306cb29c","frame":{"x":95,"y":0,"w":93,"h":94},"type":"animation"}},"type":"animation"}
{"ver":"1.0.1","uuid":"168ed6dc-c204-4903-b2b6-4d0590248668","subMetas":{"coin":{"ver":"1.0.1","uuid":"65ca9349-7bdd-41c7-a98c-35a2a643e18e","rawTextureUuid":"168ed6dc-c204-4903-b2b6-4d0590248668","type":"texture"}},"type":"texture","imagePath":"/Users/rockyl/WorkSpaces/scilla/samples/super-miner/assets/anims/coin.png"}
{"mc":{
"blue":{
"frameRate":24,
"labels":[
{"name":"idle","frame":1,"end":30}
,{"name":"walk","frame":31,"end":54}
,{"name":"beginDig","frame":55,"end":65}
,{"name":"dig","frame":66,"end":78}
],
"events":[
],
"frames":[
{
"res":"5189086A",
"x":-57,
"y":-142
},
{
"res":"97242FCF",
"x":-57,
"y":-142
},
{
"res":"C49F43C1",
"x":-57,
"y":-142
},
{
"res":"D4F651E",
"x":-57,
"y":-142
},
{
"res":"1A704625",
"x":-57,
"y":-142
},
{
"res":"E01F0539",
"x":-57,
"y":-142
},
{
"res":"6D4869FF",
"x":-57,
"y":-142
},
{
"res":"945F4F46",
"x":-57,
"y":-142
},
{
"res":"4BF9DE6C",
"x":-57,
"y":-142
},
{
"res":"873FC56F",
"x":-57,
"y":-141
},
{
"res":"68F36F0E",
"x":-57,
"y":-141
},
{
"res":"D73D4742",
"x":-57,
"y":-141
},
{
"res":"288836AB",
"x":-57,
"y":-141
},
{
"res":"FE343B90",
"x":-57,
"y":-141
},
{
"res":"5043FDD3",
"x":-57,
"y":-141
},
{
"res":"EEC3DB85",
"x":-57,
"y":-141
},
{
"res":"5043FDD3",
"x":-57,
"y":-141
},
{
"res":"FE343B90",
"x":-57,
"y":-141
},
{
"res":"288836AB",
"x":-57,
"y":-141
},
{
"res":"D73D4742",
"x":-57,
"y":-141
},
{
"res":"68F36F0E",
"x":-57,
"y":-141
},
{
"res":"873FC56F",
"x":-57,
"y":-141
},
{
"res":"4BF9DE6C",
"x":-57,
"y":-142
},
{
"res":"945F4F46",
"x":-57,
"y":-142
},
{
"res":"6D4869FF",
"x":-57,
"y":-142
},
{
"res":"E01F0539",
"x":-57,
"y":-142
},
{
"res":"1A704625",
"x":-57,
"y":-142
},
{
"res":"D4F651E",
"x":-57,
"y":-142
},
{
"res":"C49F43C1",
"x":-57,
"y":-142
},
{
"res":"97242FCF",
"x":-57,
"y":-142
},
{
"res":"5DAA66FC",
"x":-57,
"y":-141
},
{
"res":"4DA31000",
"x":-57,
"y":-141
},
{
"res":"3CCA7F82",
"x":-57,
"y":-140
},
{
"res":"84B64357",
"x":-57,
"y":-140
},
{
"res":"6965B1B1",
"x":-57,
"y":-140
},
{
"res":"2D3CF7FB",
"x":-57,
"y":-140
},
{
"res":"AC70A367",
"x":-57,
"y":-139
},
{
"res":"8863AA2F",
"x":-57,
"y":-140
},
{
"res":"B65D47FB",
"x":-57,
"y":-140
},
{
"res":"17CEEA90",
"x":-57,
"y":-140
},
{
"res":"80713019",
"x":-57,
"y":-140
},
{
"res":"33238AA0",
"x":-57,
"y":-141
},
{
"res":"597B6520",
"x":-57,
"y":-141
},
{
"res":"B31A737B",
"x":-57,
"y":-141
},
{
"res":"8C4FE4E7",
"x":-57,
"y":-140
},
{
"res":"F9C19F52",
"x":-57,
"y":-140
},
{
"res":"C6C03213",
"x":-57,
"y":-140
},
{
"res":"FF992765",
"x":-57,
"y":-140
},
{
"res":"6ADCE5C0",
"x":-57,
"y":-139
},
{
"res":"1F627544",
"x":-57,
"y":-140
},
{
"res":"F5EAF507",
"x":-57,
"y":-140
},
{
"res":"1C2358D2",
"x":-57,
"y":-140
},
{
"res":"798C5805",
"x":-57,
"y":-140
},
{
"res":"30D91BED",
"x":-57,
"y":-141
},
{
"res":"1156A8F5",
"x":-57,
"y":-142
},
{
"res":"926BD52A",
"x":-57,
"y":-142
},
{
"res":"E5BB3541",
"x":-56,
"y":-141
},
{
"res":"8A64AD32",
"x":-57,
"y":-141
},
{
"res":"7173FABB",
"x":-60,
"y":-139
},
{
"res":"B4AC9FF4",
"x":-61,
"y":-138
},
{
"res":"221D4229",
"x":-61,
"y":-138
},
{
"res":"D88C2899",
"x":-60,
"y":-139
},
{
"res":"393A813D",
"x":-58,
"y":-140
},
{
"res":"1A0661BB",
"x":-55,
"y":-141
},
{
"res":"48858E9E",
"x":-57,
"y":-142
},
{
"res":"D57430D6",
"x":-57,
"y":-142
},
{
"res":"E4922D64",
"x":-57,
"y":-142
},
{
"res":"75ADD420",
"x":-56,
"y":-142
},
{
"res":"776BA669",
"x":-56,
"y":-141
},
{
"res":"83A2612F",
"x":-59,
"y":-140
},
{
"res":"2F2D4668",
"x":-61,
"y":-138
},
{
"res":"47998D86",
"x":-62,
"y":-138
},
{
"res":"944F2C72",
"x":-61,
"y":-139
},
{
"res":"48431A33",
"x":-58,
"y":-140
},
{
"res":"69F33EBA",
"x":-55,
"y":-141
},
{
"res":"16C2B2CB",
"x":-56,
"y":-142
},
{
"res":"8E12B400",
"x":-57,
"y":-142
},
{
"res":"78C90DA2",
"x":-57,
"y":-142
}
]
},"red":{
"frameRate":24,
"labels":[
{"name":"idle","frame":1,"end":30}
,{"name":"walk","frame":31,"end":54}
,{"name":"beginDig","frame":55,"end":65}
,{"name":"dig","frame":66,"end":77}
],
"events":[
],
"frames":[
{
"res":"A5E5DE06",
"x":-58,
"y":-145
},
{
"res":"8A029FC9",
"x":-58,
"y":-145
},
{
"res":"536B9DEC",
"x":-58,
"y":-145
},
{
"res":"E3C467C9",
"x":-58,
"y":-145
},
{
"res":"EB803920",
"x":-58,
"y":-145
},
{
"res":"1286BA8",
"x":-58,
"y":-145
},
{
"res":"7FD0F34F",
"x":-58,
"y":-145
},
{
"res":"4F82E49C",
"x":-58,
"y":-145
},
{
"res":"113B9138",
"x":-58,
"y":-145
},
{
"res":"9B5D1403",
"x":-58,
"y":-144
},
{
"res":"98C60BE8",
"x":-58,
"y":-144
},
{
"res":"69056F0D",
"x":-58,
"y":-144
},
{
"res":"B7734038",
"x":-58,
"y":-144
},
{
"res":"9EF29EE5",
"x":-58,
"y":-144
},
{
"res":"867C9CFF",
"x":-58,
"y":-144
},
{
"res":"9AF35C49",
"x":-58,
"y":-144
},
{
"res":"867C9CFF",
"x":-58,
"y":-144
},
{
"res":"9EF29EE5",
"x":-58,
"y":-144
},
{
"res":"B7734038",
"x":-58,
"y":-144
},
{
"res":"69056F0D",
"x":-58,
"y":-144
},
{
"res":"98C60BE8",
"x":-58,
"y":-144
},
{
"res":"9B5D1403",
"x":-58,
"y":-144
},
{
"res":"113B9138",
"x":-58,
"y":-145
},
{
"res":"4F82E49C",
"x":-58,
"y":-145
},
{
"res":"7FD0F34F",
"x":-58,
"y":-145
},
{
"res":"1286BA8",
"x":-58,
"y":-145
},
{
"res":"EB803920",
"x":-58,
"y":-145
},
{
"res":"E3C467C9",
"x":-58,
"y":-145
},
{
"res":"536B9DEC",
"x":-58,
"y":-145
},
{
"res":"8A029FC9",
"x":-58,
"y":-145
},
{
"res":"9A7FD271",
"x":-58,
"y":-144
},
{
"res":"81004BE2",
"x":-58,
"y":-144
},
{
"res":"43FFED26",
"x":-58,
"y":-143
},
{
"res":"A49968F",
"x":-58,
"y":-143
},
{
"res":"A23EA3F1",
"x":-58,
"y":-143
},
{
"res":"AECD8378",
"x":-58,
"y":-143
},
{
"res":"A8218D09",
"x":-58,
"y":-142
},
{
"res":"6BF31364",
"x":-58,
"y":-143
},
{
"res":"DF31C02",
"x":-58,
"y":-143
},
{
"res":"57006AC",
"x":-58,
"y":-143
},
{
"res":"D5DD0D09",
"x":-58,
"y":-143
},
{
"res":"1CF61B99",
"x":-58,
"y":-144
},
{
"res":"EEF34788",
"x":-58,
"y":-144
},
{
"res":"FA773A99",
"x":-58,
"y":-144
},
{
"res":"5A53E1DE",
"x":-58,
"y":-143
},
{
"res":"E261FEDE",
"x":-58,
"y":-143
},
{
"res":"580F8397",
"x":-58,
"y":-143
},
{
"res":"3444D97E",
"x":-58,
"y":-143
},
{
"res":"76F33075",
"x":-58,
"y":-142
},
{
"res":"1482B669",
"x":-58,
"y":-143
},
{
"res":"6C821542",
"x":-58,
"y":-143
},
{
"res":"5082DA1",
"x":-58,
"y":-143
},
{
"res":"A0576612",
"x":-58,
"y":-143
},
{
"res":"DEA2FF5B",
"x":-58,
"y":-144
},
{
"res":"7EE02AE5",
"x":-58,
"y":-145
},
{
"res":"F357F2C0",
"x":-57,
"y":-145
},
{
"res":"8D59120B",
"x":-56,
"y":-145
},
{
"res":"7F537E4",
"x":-57,
"y":-144
},
{
"res":"B5C88679",
"x":-60,
"y":-143
},
{
"res":"3431B2DB",
"x":-61,
"y":-142
},
{
"res":"A54480C9",
"x":-62,
"y":-141
},
{
"res":"BCF94871",
"x":-61,
"y":-142
},
{
"res":"E30B8A4E",
"x":-58,
"y":-144
},
{
"res":"2063C1AB",
"x":-56,
"y":-144
},
{
"res":"465BF7C3",
"x":-57,
"y":-145
},
{
"res":"E328CE1A",
"x":-58,
"y":-145
},
{
"res":"1D69CBDD",
"x":-58,
"y":-145
},
{
"res":"735FE0A6",
"x":-57,
"y":-145
},
{
"res":"72F137C8",
"x":-56,
"y":-144
},
{
"res":"D5BEB784",
"x":-59,
"y":-143
},
{
"res":"C32AABEC",
"x":-61,
"y":-142
},
{
"res":"46C6BBE2",
"x":-62,
"y":-141
},
{
"res":"BF370FC1",
"x":-61,
"y":-142
},
{
"res":"375409DB",
"x":-59,
"y":-143
},
{
"res":"3AD0679C",
"x":-55,
"y":-144
},
{
"res":"BE6C45E4",
"x":-57,
"y":-145
},
{
"res":"C4DDB608",
"x":-58,
"y":-145
}
]
}},
"res":{
"80713019":{"x":626,"y":470,"w":121,"h":152},
"EEC3DB85":{"x":794,"y":941,"w":100,"h":153},
"7173FABB":{"x":1616,"y":154,"w":132,"h":151},
"EB803920":{"x":581,"y":935,"w":98,"h":157},
"4DA31000":{"x":638,"y":315,"w":124,"h":153},
"72F137C8":{"x":917,"y":467,"w":120,"h":156},
"5DAA66FC":{"x":1170,"y":463,"w":123,"h":153},
"8A64AD32":{"x":0,"y":156,"w":128,"h":153},
"2063C1AB":{"x":242,"y":624,"w":114,"h":156},
"4BF9DE6C":{"x":681,"y":1089,"w":98,"h":154},
"A5E5DE06":{"x":1578,"y":941,"w":97,"h":157},
"43FFED26":{"x":1474,"y":304,"w":125,"h":155},
"597B6520":{"x":493,"y":622,"w":117,"h":153},
"1482B669":{"x":0,"y":626,"w":114,"h":155},
"F357F2C0":{"x":666,"y":156,"w":124,"h":157},
"9AF35C49":{"x":1624,"y":783,"w":100,"h":156},
"68F36F0E":{"x":1411,"y":1086,"w":99,"h":153},
"8E12B400":{"x":405,"y":1095,"w":98,"h":154},
"D88C2899":{"x":1213,"y":0,"w":134,"h":151},
"5082DA1":{"x":764,"y":469,"w":119,"h":155},
"B31A737B":{"x":612,"y":624,"w":116,"h":153},
"81004BE2":{"x":1176,"y":305,"w":124,"h":156},
"1A0661BB":{"x":1918,"y":627,"w":114,"h":153},
"798C5805":{"x":1801,"y":472,"w":120,"h":152},
"69F33EBA":{"x":374,"y":622,"w":117,"h":153},
"B5C88679":{"x":811,"y":0,"w":131,"h":155},
"1D69CBDD":{"x":805,"y":782,"w":100,"h":157},
"8D59120B":{"x":539,"y":155,"w":125,"h":157},
"113B9138":{"x":1477,"y":927,"w":99,"h":157},
"9EF29EE5":{"x":1375,"y":926,"w":100,"h":156},
"3CCA7F82":{"x":1044,"y":463,"w":124,"h":152},
"945F4F46":{"x":896,"y":1089,"w":98,"h":154},
"E3C467C9":{"x":437,"y":936,"w":98,"h":157},
"C4DDB608":{"x":1008,"y":930,"w":99,"h":157},
"3444D97E":{"x":116,"y":628,"w":112,"h":155},
"6D4869FF":{"x":537,"y":1094,"w":98,"h":154},
"6965B1B1":{"x":917,"y":313,"w":125,"h":152},
"A49968F":{"x":1347,"y":157,"w":125,"h":155},
"B65D47FB":{"x":1556,"y":462,"w":124,"h":152},
"1156A8F5":{"x":1729,"y":315,"w":123,"h":154},
"A0576612":{"x":378,"y":465,"w":121,"h":155},
"A23EA3F1":{"x":1877,"y":158,"w":125,"h":155},
"48858E9E":{"x":230,"y":782,"w":104,"h":154},
"DEA2FF5B":{"x":792,"y":311,"w":123,"h":156},
"1286BA8":{"x":1210,"y":939,"w":98,"h":157},
"C32AABEC":{"x":272,"y":0,"w":133,"h":154},
"FF992765":{"x":358,"y":777,"w":112,"h":152},
"EEF34788":{"x":122,"y":470,"w":118,"h":156},
"7FD0F34F":{"x":1826,"y":940,"w":98,"h":157},
"375409DB":{"x":1349,"y":0,"w":130,"h":155},
"D73D4742":{"x":304,"y":1089,"w":99,"h":153},
"926BD52A":{"x":384,"y":309,"w":125,"h":154},
"8A029FC9":{"x":102,"y":943,"w":97,"h":157},
"F9C19F52":{"x":1655,"y":629,"w":114,"h":152},
"C6C03213":{"x":1394,"y":772,"w":113,"h":152},
"465BF7C3":{"x":1269,"y":780,"w":104,"h":157},
"83A2612F":{"x":1617,"y":0,"w":132,"h":152},
"9A7FD271":{"x":1050,"y":305,"w":124,"h":156},
"873FC56F":{"x":1677,"y":1095,"w":98,"h":153},
"97242FCF":{"x":781,"y":1096,"w":97,"h":154},
"75ADD420":{"x":581,"y":779,"w":109,"h":154},
"1C2358D2":{"x":1157,"y":618,"w":118,"h":152},
"776BA669":{"x":251,"y":469,"w":121,"h":153},
"17CEEA90":{"x":501,"y":468,"w":123,"h":152},
"5043FDD3":{"x":0,"y":941,"w":100,"h":153},
"78C90DA2":{"x":996,"y":1089,"w":98,"h":154},
"6ADCE5C0":{"x":692,"y":780,"w":111,"h":151},
"7F537E4":{"x":1881,"y":0,"w":128,"h":156},
"9B5D1403":{"x":1109,"y":931,"w":99,"h":156},
"E5BB3541":{"x":1601,"y":307,"w":126,"h":153},
"30D91BED":{"x":1295,"y":468,"w":122,"h":153},
"3431B2DB":{"x":677,"y":0,"w":132,"h":154},
"33238AA0":{"x":1923,"y":472,"w":119,"h":153},
"221D4229":{"x":1077,"y":153,"w":133,"h":150},
"1A704625":{"x":1196,"y":1098,"w":97,"h":154},
"E30B8A4E":{"x":1751,"y":0,"w":128,"h":156},
"1F627544":{"x":1509,"y":773,"w":113,"h":152},
"48431A33":{"x":407,"y":155,"w":130,"h":152},
"DF31C02":{"x":0,"y":311,"w":124,"h":155},
"A8218D09":{"x":922,"y":157,"w":126,"h":154},
"867C9CFF":{"x":0,"y":783,"w":100,"h":156},
"84B64357":{"x":511,"y":314,"w":125,"h":152},
"AECD8378":{"x":130,"y":156,"w":126,"h":155},
"288836AB":{"x":1310,"y":1084,"w":99,"h":153},
"B7734038":{"x":1879,"y":782,"w":100,"h":156},
"46C6BBE2":{"x":542,"y":0,"w":133,"h":153},
"76F33075":{"x":1001,"y":774,"w":111,"h":154},
"E328CE1A":{"x":1726,"y":936,"w":98,"h":157},
"3AD0679C":{"x":1419,"y":614,"w":116,"h":156},
"6BF31364":{"x":1750,"y":158,"w":125,"h":155},
"D4F651E":{"x":201,"y":1097,"w":97,"h":154},
"16C2B2CB":{"x":1771,"y":780,"w":106,"h":154},
"5189086A":{"x":1777,"y":1099,"w":97,"h":154},
"735FE0A6":{"x":1157,"y":772,"w":110,"h":157},
"BF370FC1":{"x":0,"y":0,"w":134,"h":154},
"1CF61B99":{"x":0,"y":468,"w":120,"h":156},
"5A53E1DE":{"x":1039,"y":617,"w":116,"h":155},
"57006AC":{"x":126,"y":313,"w":123,"h":155},
"FA773A99":{"x":1682,"y":471,"w":117,"h":156},
"98C60BE8":{"x":336,"y":931,"w":99,"h":156},
"A54480C9":{"x":407,"y":0,"w":133,"h":153},
"4F82E49C":{"x":907,"y":930,"w":99,"h":157},
"BCF94871":{"x":136,"y":0,"w":134,"h":154},
"FE343B90":{"x":1926,"y":940,"w":100,"h":153},
"E01F0539":{"x":1096,"y":1089,"w":98,"h":154},
"D57430D6":{"x":0,"y":1096,"w":97,"h":154},
"AC70A367":{"x":1429,"y":461,"w":125,"h":151},
"69056F0D":{"x":102,"y":785,"w":100,"h":156},
"D5DD0D09":{"x":1854,"y":315,"w":122,"h":155},
"E261FEDE":{"x":1277,"y":623,"w":115,"h":155},
"944F2C72":{"x":1077,"y":0,"w":134,"h":151},
"B4AC9FF4":{"x":1212,"y":153,"w":133,"h":150},
"7EE02AE5":{"x":258,"y":156,"w":124,"h":157},
"2D3CF7FB":{"x":1302,"y":314,"w":125,"h":152},
"8863AA2F":{"x":251,"y":315,"w":125,"h":152},
"C49F43C1":{"x":1926,"y":1095,"w":97,"h":154},
"8C4FE4E7":{"x":1801,"y":626,"w":115,"h":152},
"393A813D":{"x":792,"y":157,"w":128,"h":152},
"6C821542":{"x":1537,"y":616,"w":116,"h":155},
"47998D86":{"x":1481,"y":152,"w":133,"h":150},
"BE6C45E4":{"x":472,"y":777,"w":107,"h":157},
"F5EAF507":{"x":730,"y":626,"w":116,"h":152},
"E4922D64":{"x":692,"y":933,"w":100,"h":154},
"2F2D4668":{"x":1481,"y":0,"w":134,"h":150},
"536B9DEC":{"x":204,"y":938,"w":98,"h":157},
"580F8397":{"x":885,"y":625,"w":114,"h":155},
"D5BEB784":{"x":944,"y":0,"w":131,"h":155}
}}
\ No newline at end of file
{"ver":"1.0.1","uuid":"ec1d28d1-aeea-4e43-9d07-b597f7364e7a","subMetas":{"blue":{"ver":"1.0.1","uuid":"f4d7b2a7-e8b8-406f-bda8-6ed3bd77c34c","rawTextureUuid":"ec1d28d1-aeea-4e43-9d07-b597f7364e7a","frame":{"x":1777,"y":1099,"w":97,"h":154},"type":"animation"},"red":{"ver":"1.0.1","uuid":"53f788bd-4d09-4376-91e4-f81cf07421f3","rawTextureUuid":"ec1d28d1-aeea-4e43-9d07-b597f7364e7a","frame":{"x":1578,"y":941,"w":97,"h":157},"type":"animation"}},"type":"animation"}
{"ver":"1.0.1","uuid":"77174112-cf30-4ca1-8802-3fd0ccd7d2df","subMetas":{"miner":{"ver":"1.0.1","uuid":"0e8277c4-9b4f-410b-b799-9f60127ac2ab","rawTextureUuid":"77174112-cf30-4ca1-8802-3fd0ccd7d2df","type":"texture"}},"type":"texture","imagePath":"/Users/rockyl/WorkSpaces/scilla/samples/super-miner/assets/anims/miner.png"}
{"mc":{
"stone-effect":{
"frameRate":24,
"events":[
],
"frames":[
{
"res":"D8639186",
"x":-8,
"y":-8
},
{
"res":"6967EB1E",
"x":-9,
"y":-25
},
{
"res":"2033343B",
"x":-19,
"y":-45
},
{
"res":"F4F73900",
"x":-29,
"y":-53
},
{
"res":"DC223A5F",
"x":-35,
"y":-54
},
{
"res":"88880345",
"x":-37,
"y":-48
},
{
"res":"DA97FA47",
"x":-44,
"y":-54
},
{
"res":"C6A85FFB",
"x":-48,
"y":-50
},
{
"res":"2144DF1C",
"x":-121,
"y":-157
}
]
}},
"res":{
"88880345":{"x":106,"y":59,"w":94,"h":47},
"2033343B":{"x":203,"y":0,"w":45,"h":40},
"2144DF1C":{"x":250,"y":0,"w":1,"h":1},
"DA97FA47":{"x":106,"y":0,"w":95,"h":57},
"F4F73900":{"x":81,"y":108,"w":67,"h":48},
"DC223A5F":{"x":0,"y":61,"w":79,"h":51},
"D8639186":{"x":227,"y":42,"w":16,"h":17},
"C6A85FFB":{"x":0,"y":0,"w":104,"h":59},
"6967EB1E":{"x":203,"y":42,"w":22,"h":26}
}}
\ No newline at end of file
{"ver":"1.0.1","uuid":"73f0cb03-42cf-4f21-bc6c-ac949e0e6d90","subMetas":{"stone-effect":{"ver":"1.0.1","uuid":"0a04e5f9-c4af-44f7-abb8-f48570174492","rawTextureUuid":"73f0cb03-42cf-4f21-bc6c-ac949e0e6d90","frame":{"x":227,"y":42,"w":16,"h":17},"type":"animation"}},"type":"animation"}
{"ver":"1.0.1","uuid":"7adf4036-c0b4-41c0-833e-fa45312ac5f3","subMetas":{"stone-effect":{"ver":"1.0.1","uuid":"3f847433-7d24-4f41-b952-6ce032e53e6f","rawTextureUuid":"7adf4036-c0b4-41c0-833e-fa45312ac5f3","type":"texture"}},"type":"texture","imagePath":"/Users/rockyl/WorkSpaces/scilla/samples/super-miner/assets/anims/stone-effect.png"}
{"ver":"1.0.1","uuid":"63d93bf8-dde1-4eca-bc6f-5d5fa86e5f23","subMetas":{},"isGroup":true}
{
"name": "coin",
"root": {
"uuid": "20190301114308",
"components": [
{
"script": "components/base/Transform"
}
],
"children": [
{
"uuid": "20190301114245",
"name": "coin",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/FrameAnimationRenderer",
"properties": {
"frameAnimation": "res|943a42a1-7426-4894-a880-39a4f5dbf7ab",
"autoPlay": true
}
}
]
}
]
}
}
\ No newline at end of file
{"ver":"1.0.1","uuid":"ac43106a-4ddf-4a44-8f3c-eb5d0b107c74","subMetas":{},"type":"prefab"}
{
"name": "item-hang",
"root": {
"uuid": "20190301114308",
"components": [
{
"script": "components/base/Transform"
}
],
"children": [
{
"uuid": "20190301114245",
"name": "item-hang",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|0af7c70e-2e83-4ae8-aaa0-78a6f0feb02f",
"anchor": {
"y": 0.35,
"_type_": "scilla/support/Vector2D"
}
}
}
],
"children": []
}
]
}
}
\ No newline at end of file
{"ver":"1.0.1","uuid":"75327890-4087-485f-8594-6f1c26bd43e8","subMetas":{},"type":"prefab"}
{
"name": "item",
"root": {
"uuid": "20190301114308",
"components": [
{
"script": "components/base/Transform"
}
],
"children": [
{
"uuid": "20190301114245",
"name": "item",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|0af7c70e-2e83-4ae8-aaa0-78a6f0feb02f",
"anchor": {
"y": 0.35,
"_type_": "scilla/support/Vector2D"
}
}
},
{
"script": "./scripts/game/Item",
"properties": {
"creditsEntity": "entity|b2a12ec2-fd60-4a8a-8bd0-8d426eab0e96",
"Label": "entity|1e9d8ad9-356a-4479-b4de-5cfcb3c0e3b9"
}
}
],
"children": [
{
"name": "Credits",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": 0,
"y": -40
}
}
},
{
"script": "./scripts/common/FloatMissing",
"properties": {}
}
],
"uuid": "b2a12ec2-fd60-4a8a-8bd0-8d426eab0e96",
"children": [
{
"name": "icon",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": -20,
"y": 0,
"_type_": "scilla/support/Vector2D"
}
}
},
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|e9bcb67a-0626-4849-aaf5-33d1728c145e"
}
}
],
"uuid": "7c71c78a-ba6a-451a-a448-d7c62d14145c"
},
{
"name": "Label",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/TextRenderer",
"properties": {
"fillColor": "rgba(255, 255, 0, 1)",
"textStyle": {
"fontSize": 24
},
"text": "0",
"textAlign": "center",
"anchor": {
"x": 0,
"_type_": "scilla/support/Vector2D"
}
}
}
],
"uuid": "1e9d8ad9-356a-4479-b4de-5cfcb3c0e3b9"
}
]
}
]
}
]
}
}
\ No newline at end of file
{"ver":"1.0.1","uuid":"67e32bdb-f410-42f5-8a9e-4d06c056eaa4","subMetas":{},"type":"prefab"}
{
"name": "miner",
"root": {
"uuid": "20190301114308",
"components": [
{
"script": "components/base/Transform"
}
],
"children": [
{
"uuid": "20190301114245",
"name": "miner",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "./scripts/game/Miner",
"properties": {
"Hole": "entity|8f23c3a7-a168-4ae4-9d41-32daffb70d45",
"Body": "entity|10e4ba7c-5ef4-4493-856b-92ee1996171c",
"Effect": "entity|da765ba6-9a03-4237-b981-7fb619209a1e",
"Miner": "entity|1b4744e5-55af-4a44-a433-3dbec058d8c4",
"Items": "entity|ebb58804-f432-4612-bb35-b7214f0ea790",
"itemHangPrefab": "res|75327890-4087-485f-8594-6f1c26bd43e8",
"animations": "res|ec1d28d1-aeea-4e43-9d07-b597f7364e7a",
"holeRes": "res|933c5bc7-aa8e-43ff-9910-10b67ff910e9"
}
}
],
"children": [
{
"name": "Hole",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "./scripts/game/Hole",
"properties": {
"Bg": "entity|6045c0b6-4dde-4735-9e5a-447b69e259a6",
"Bottom": "entity|4b66fbf8-cec7-400d-b2ca-29c51ebea4f0",
"BgImage": "entity|6ba5995d-8a37-4753-ac6c-67e4b251e373"
}
}
],
"uuid": "8f23c3a7-a168-4ae4-9d41-32daffb70d45",
"children": [
{
"name": "HoleBg",
"components": [
{
"script": "components/base/Transform",
"properties": {
"width": 169,
"height": 45,
"position": {
"_hashCode": 22353,
"_x": 0,
"_y": 0
}
}
},
{
"script": "components/renderer/RectRenderer",
"properties": {
"anchor": {
"y": 0,
"_type_": "scilla/support/Vector2D"
},
"isMask": true,
"maskVisible": false
}
}
],
"uuid": "6045c0b6-4dde-4735-9e5a-447b69e259a6",
"children": [
{
"name": "Image",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|933c5bc7-aa8e-43ff-9910-10b67ff910e9",
"anchor": {
"y": 0,
"_type_": "scilla/support/Vector2D"
}
}
}
],
"uuid": "6ba5995d-8a37-4753-ac6c-67e4b251e373"
}
]
},
{
"name": "HoleBottom",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"y": 50,
"_type_": "scilla/support/Vector2D"
}
}
},
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|e0953ca5-665b-400d-9eec-7c6d8887c15a"
}
}
],
"uuid": "4b66fbf8-cec7-400d-b2ca-29c51ebea4f0"
}
]
},
{
"name": "Miner",
"components": [
{
"script": "components/base/Transform",
"properties": {}
}
],
"uuid": "1b4744e5-55af-4a44-a433-3dbec058d8c4",
"children": [
{
"name": "Effect",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/FrameAnimationRenderer",
"properties": {
"frameAnimation": "res|0a04e5f9-c4af-44f7-abb8-f48570174492",
"autoPlay": false
}
}
],
"uuid": "da765ba6-9a03-4237-b981-7fb619209a1e"
},
{
"name": "Body",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/FrameAnimationRenderer",
"properties": {
"frameAnimation": "res|fa38740c-fcf1-4e9b-a80f-0d48b77968e8",
"autoPlay": false,
"onComplete": [
{
"entity": "entity|20190301114245",
"component": 1,
"method": "onAnimationComplete"
}
],
"onLoopComplete": [
{
"entity": "entity|20190301114245",
"component": 1,
"method": "onAnimationLoopComplete"
}
],
"anchor": {
"x": 1,
"_type_": "scilla/support/Vector2D"
}
}
}
],
"uuid": "10e4ba7c-5ef4-4493-856b-92ee1996171c"
},
{
"name": "Items",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": -20,
"y": -60,
"_type_": "scilla/support/Vector2D"
}
}
}
],
"uuid": "ebb58804-f432-4612-bb35-b7214f0ea790"
}
]
}
]
}
]
}
}
\ No newline at end of file
{"ver":"1.0.1","uuid":"efa8a4db-c1c1-4ac0-959a-90043fbd8974","subMetas":{},"type":"prefab"}
{
"name": "times-card",
"root": {
"uuid": "20190301114308",
"components": [
{
"script": "components/base/Transform"
}
],
"children": [
{
"uuid": "20190301114245",
"name": "times-card",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "./scripts/game/TimesCard",
"properties": {
"Label": "entity|89f4d9a0-04f7-4663-b05e-9bbdafaa5967",
"Light": "entity|939c54ad-9379-480c-87dc-0f2a1c3cbd52"
}
}
],
"children": [
{
"name": "Light",
"components": [
{
"script": "components/base/Transform",
"properties": {
"scale": {
"x": 0.7,
"y": 0.7,
"_type_": "scilla/support/Vector2D"
}
}
},
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|c73ad06f-6ddb-4677-959f-00c6886a4dc5"
}
}
],
"uuid": "939c54ad-9379-480c-87dc-0f2a1c3cbd52"
},
{
"name": "Card",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|6532dcec-e4a5-4630-90a4-5b8518a856fc"
}
}
],
"uuid": "899cc817-919e-48e2-a9e9-c222bd81c59a"
},
{
"name": "Label",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": 0,
"y": 25,
"_type_": "scilla/support/Vector2D"
}
}
},
{
"script": "components/renderer/TextRenderer",
"properties": {
"text": "X1",
"fillColor": "rgba(255, 255, 255, 1)",
"textStyle": {
"fontSize": 35
}
}
}
],
"uuid": "89f4d9a0-04f7-4663-b05e-9bbdafaa5967"
}
]
}
]
}
}
\ No newline at end of file
{"ver":"1.0.1","uuid":"1bbb5b66-33ea-4035-a6fe-3ec5af37ad23","subMetas":{},"type":"prefab"}
{
"name": "two-lines-button",
"root": {
"uuid": "20190301114308",
"components": [
{
"script": "components/base/Transform"
}
],
"children": [
{
"uuid": "20190301114245",
"name": "two-lines-button",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/TextureRenderer",
"properties": {
"texture": "res|e9d7f891-46a6-4038-a89a-6bf12e014b40"
}
},
{
"script": "./scripts/common/TwoLinesButton",
"properties": {
"bgRes": "res|e9d7f891-46a6-4038-a89a-6bf12e014b40",
"bgDisabledRes": "res|fa182a61-d334-4c3e-ad93-b0f168ca3307",
"label0Entity": "entity|4032f2b5-44da-4c5f-a77d-aac1a1d9280f",
"label1Entity": "entity|dce477d1-a18f-4d38-8ebc-8f428e54ab76"
}
},
{
"script": "components/animation/Wave",
"properties": {
"autoPlay": false
}
},
{
"script": "./scripts/common/BounceButtonController",
"properties": {
"button": "entity|20190301114245"
}
}
],
"children": [
{
"name": "Label0",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": 0,
"y": -15
}
}
},
{
"script": "components/renderer/TextRenderer",
"properties": {
"text": "开始挖矿",
"fillColor": "rgba(204, 51, 0, 1)",
"textStyle": {
"fontSize": 38,
"fontWeight": "bold"
}
}
}
],
"uuid": "4032f2b5-44da-4c5f-a77d-aac1a1d9280f"
},
{
"name": "Label1",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": 0,
"y": 20
}
}
},
{
"script": "components/renderer/TextRenderer",
"properties": {
"fillColor": "rgba(204, 51, 0, 1)",
"text": "100积分/次",
"textStyle": {
"fontSize": 22
}
}
}
],
"uuid": "dce477d1-a18f-4d38-8ebc-8f428e54ab76"
}
]
}
]
}
}
\ No newline at end of file
{"ver":"1.0.1","uuid":"14e4c41e-456b-4c30-a692-30da59907d61","subMetas":{},"type":"prefab"}
{"ver":"1.0.1","uuid":"78c18f8f-b241-42e3-b7e2-81c41117a8d6","subMetas":{},"isGroup":true}
This source diff could not be displayed because it is too large. You can view the blob instead.
{"ver":"1.0.1","uuid":"1f50815f-bf2f-4cf6-8432-f56f3aa834ef","subMetas":{},"type":"scene"}
{"ver":"1.0.1","uuid":"f529f015-2952-4026-be7e-ff8d7367444e","subMetas":{},"isGroup":true}
/**
* Created by rockyl on 2019-04-18.
*
* 抖动
*/
import ScillaComponent from "components/base/ScillaComponent";
import {createTween} from "scilla";
export default class Animation extends ScillaComponent {
onCreate() {
super.onCreate();
}
onAwake() {
super.onAwake();
createTween(this, this.transform, true, {fields: ['x', 'y']})
.to({
position: {x: 100, y: 100},
scale: {x: 2, y: 3},
rotation: 270
}, 1000)
}
onUpdate(t) {
super.onUpdate(t);
}
onSleep() {
super.onSleep();
}
onDestroy() {
super.onDestroy();
}
}
{"ver":"1.0.1","uuid":"5f2419c1-237c-4901-92ce-4079420063dc","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-09.
*
* 主控制器
*/
import ScillaComponent from "components/base/ScillaComponent";
import {dynamic, engine, Entity} from "scilla";
import Toast from "./common/Toast";
import Popup from "./popup/Popup";
import {initEnv} from "./common/BuriedPoint";
import {isWeiXin} from "./game/utils";
export default class MainController extends ScillaComponent {
Popup: Entity;
Toast: Entity;
opActivityId: dynamic;
private _toast: Toast;
private _popup: Popup;
onAwake() {
super.onAwake();
engine.dataCenter.set('CFG', window['CFG']);
this._toast = this.Toast.getComponent(Toast);
this._popup = this.Popup.getComponent(Popup);
initEnv();
this.broadcast('callApi', 1, 'activityBaseInfo', {opActivityId: this.opActivityId})
}
onGotActivityBaseInfo() {
this.broadcast('initGameStage');
}
onActivityBaseInfoError(e) {
console.log(e);
if (typeof e === 'string') {
switch (e) {
case '0100016': //活动未开始
case '0100014': //活动已结束
case '0100017': //活动已关闭
this.showErrorToast(e);
break;
default:
this.showNetError();
}
} else {
this.showNetError();
}
}
showErrorToast(e) {
switch (e) {
case '0100016': //活动未开始
this.showToast('活动未开始,暂时无法参与');
break;
case '0100014': //活动已结束
case '0100017': //活动已关闭
this.showToast('活动已结束,无法参与');
break;
}
}
showToast(content, duration?) {
this._toast.show({
content,
duration,
})
}
showDialog(name, data?, callback?) {
this._popup.showDialog(name, data, callback);
}
hideDialog(name, action?: string, data?) {
this._popup.hideDialog(name, action, data);
}
hideAllDialog() {
this._popup.hideAll();
}
alert(data?, callback?) {
this.showDialog('Alert', data, callback);
}
showLoginAlert() {
const callUpRegistH5Code = engine.dataCenter.get('CFG', 'callUpRegistH5Code');
const callUpLoginFunc = window['requirelogin'];
this.alert({
title: `啊哦,你还未登录`,
content: `登录后即可参与活动`,
button: (callUpLoginFunc || callUpRegistH5Code) ? '立即登录' : null,
}, (action) => {
if (action === 'confirm') {
if(isWeiXin()){
if(callUpRegistH5Code){
location.href = callUpRegistH5Code;
}else{
console.log('没有登录方案');
}
}else{
if(callUpLoginFunc){
callUpLoginFunc();
}else{
console.log('没有登录方案');
}
}
}
});
}
showCreditsAlert() {
const unitName = engine.dataCenter.get('CFG', 'unitName');
const earnCreditsUrl = engine.dataCenter.get('CFG', 'earnCreditsUrl');
this.alert({
title: `啊哦,当前${unitName}不足`,
content: `快去领取更多${unitName}吧`,
button: earnCreditsUrl ? '去做任务' : null,
}, (action) => {
if (action === 'confirm') {
location.href = earnCreditsUrl;
}
});
}
showNetError(action?) {
this.showDialog('Alert', {title: '网络异常', content: '请检查网络后重试!', button: '重新加载', showCloseButton: false}, () => {
if (typeof action === 'function') {
action();
} else {
action = action || 'refresh';
switch (action) {
case 'back':
history.back();
break;
case 'refresh':
location.reload();
break;
}
}
})
}
}
{"ver":"1.0.1","uuid":"77a9f9eb-77c4-4b5a-88ca-22e717d807f3","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-04-09.
*/
import {createTween, ease, Entity} from "scilla";
export async function playAnimation(config, context){
for(let partName in config){
let partConfig = config[partName];
let part:Entity = context[partName];
for(let componentName in partConfig){
let component = part.getComponentByName(componentName);
let {params, duration, ease: easeName} = partConfig[componentName];
createTween(context, component)
.to(params, duration, ease[easeName]);
}
}
}
\ No newline at end of file
{"ver":"1.0.1","uuid":"1ae03578-651e-4285-aae5-d41098d478b2","subMetas":{},"type":"script"}
{"ver":"1.0.1","uuid":"4e924060-72b7-4ff8-86da-0362ec826a89","subMetas":{},"isGroup":true}
/**
* Created by rockyl on 2018-12-16.
*
* Api接口组件基类
*/
import {engine, ScillaEvent} from "scilla";
import ScillaComponent from "components/base/ScillaComponent";
export enum RequestMethod{
GET = 'GET',
POST = 'POST',
PUT = 'PUT',
DELETE = 'DELETE',
}
export default class ApiComponent extends ScillaComponent {
name: string;
method: RequestMethod = RequestMethod.POST;
params: any;
onResponse: ScillaEvent = new ScillaEvent();
onError: ScillaEvent = new ScillaEvent();
onFinish: ScillaEvent = new ScillaEvent();
autoCall: boolean = false;
private _args;
onAwake() {
super.onAwake();
if(this.autoCall){
this.execute();
}
}
protected async execute(paramsInput?, ...args) {
this._args = args;
}
onGotResponse(response: any) {
if(this.name){
engine.dataCenter.set('API', this.name, response.data);
}
if(this._args && this._args.length > 0){
this.onResponse.invoke(response.data, ...this._args);
}else{
this.onResponse.invoke(response.data);
}
this.onCallFinish();
}
onGotError(e) {
if(this._args && this._args.length > 0){
this.onError.invoke(e, ...this._args);
}else{
this.onError.invoke(e);
}
this.onCallFinish();
}
onCallFinish(){
if(this._args && this._args.length > 0){
this.onFinish.invoke(...this._args);
}else{
this.onFinish.invoke();
}
}
}
{"ver":"1.0.1","uuid":"ac217ee2-c5ac-489c-9c9b-3b2f1b50a22d","subMetas":{},"type":"script"}
/**
* Created by hwj on 2018/12/1.
*
* 简单的api组件
*/
import {utils, } from 'scilla'
import ApiComponent from "./ApiComponent";
import {callApi} from "../net/webService";
export default class SampleApi extends ApiComponent {
uri: string;
ignoreSuccessField = false;
async callApi(name, paramsInput, ...args){
if(this.name == name){
await this.execute(paramsInput, ...args);
}
}
protected async execute(paramsInput?, ...args) {
await super.execute(paramsInput, ...args);
const params = {};
if(this.params){
utils.injectProp(params, this.params);
}
if(paramsInput){
utils.injectProp(params, paramsInput);
}
const {uri, method} = this;
try {
const response = await callApi(uri, params, method, 'json', this.ignoreSuccessField);
this.onGotResponse(response);
return response.data;
} catch (e) {
this.onGotError(e);
}
}
}
{"ver":"1.0.1","uuid":"35c9db7c-1baa-4ddb-a098-24d04642f6d6","subMetas":{},"type":"script"}
/**
* Created by hwj on 2018/12/1.
*
* 简单的api组件
*/
import {raw, utils,} from 'scilla'
import ApiComponent from "./ApiComponent";
import { polling} from "../net/webService";
export default class SamplePollingApi extends ApiComponent {
successField: string;
successValues: raw;
uri: string;
maxTimes = 5;
delay = 500;
private _abortFlag = false;
async callApi(name, paramsInput, ...args) {
if (this.name == name) {
await this.execute(paramsInput, ...args);
}
}
abortCallApi(name){
if (this.name == name) {
this._abort();
}
}
protected async execute(paramsInput?, ...args) {
await super.execute(paramsInput, ...args);
this._abortFlag = false;
const params = {};
if (this.params) {
utils.injectProp(params, this.params);
}
if (paramsInput) {
utils.injectProp(params, paramsInput);
}
const {uri, method} = this;
try {
const response = await polling(this.successFunc, uri, params, this.maxTimes, this.delay, this.abortFunc, method);
this.onGotResponse(response);
return response.data;
} catch (e) {
this.onGotError(e);
}
}
protected abortFunc=()=>{
return this._abortFlag;
}
protected _abort(){
this._abortFlag = true;
}
successFunc=(response)=> {
const {successField, successValues} = this;
let v = successField ? response.data[successField] : response.data;
return successValues ? successValues.indexOf(v) >= 0 : false;
}
}
{"ver":"1.0.1","uuid":"548fab96-299d-4363-8adc-ed14345ce2a0","subMetas":{},"type":"script"}
{"ver":"1.0.1","uuid":"c4cc21d9-db56-46b6-b317-edae64d94ecb","subMetas":{},"isGroup":true}
/**
* Created by rockyl on 2018-12-26.
*
* 埋点按钮
*/
import InteractComponent from "components/base/InteractComponent";
import {callApi} from "../net/webService";
import {engine} from "scilla";
export default class BuriedPoint extends InteractComponent {
dpm: string;
dcm: string;
private _buriedPointName: string;
private _exposured: boolean;
onAwake() {
super.onAwake();
if (this.dpm && this.dcm && !this._exposured) {
this.setConfig(this.dpm, this.dcm, true);
}
}
onTouchTap(e) {
super.onTouchTap(e);
if (this._buriedPointName) {
logClick(this._buriedPointName);
}
}
setConfig(dpm, dcm, needLogExposure = false) {
this._buriedPointName = 'buried-point-' + Date.now() + Math.floor(Math.random() * 999999);
addBuriedPointConfig(
this._buriedPointName,
{dpm, dcm}
);
if (needLogExposure) {
logExposure(this._buriedPointName);
this._exposured = true;
}
}
}
let _buriedPoints: any = {};
let env: any;
export function initEnv() {
const cfg = engine.dataCenter.get('CFG');
env = {
app_id: cfg.appId,
oaid: cfg.opActivityId,
page_id: 3,
comp_id: 4,
}
}
export function addBuriedPoints(buriedPoints) {
for (let name in buriedPoints) {
_buriedPoints[name] = buriedPoints[name];
}
}
export function addBuriedPointConfig(name, config) {
const {dpm, dcm} = config;
_buriedPoints[name] = new BuriedPointData(dpm, dcm);
}
export function addBuriedPointConfigs(configs) {
for (let name in configs) {
addBuriedPointConfig(name, configs[name]);
}
}
export function logExposure(name) {
return log(name, 'exposure');
}
export function logClick(name) {
return log(name, 'click');
}
function log(name, type) {
if (DEBUG) {
//return;
}
let logPoint = _buriedPoints[name];
let appId = engine.dataCenter.get('CFG', 'appId');
let {dpm, dcm} = logPoint;
return callApi( //todo 埋点
type == 'exposure' ? '//embedlog.duiba.com.cn/exposure/standard' : '/log/click',
{
dpm, dcm, appId
},
'get', type == 'exposure' ? 'jsonp' : 'json'
).catch(e => {
//console.log(e);
});
}
function fillData(src) {
let result = src;
for (let key in env) {
result = result.replace(key, env[key]);
}
return result;
}
class BuriedPointData {
dpm: string;
dcm: string;
constructor(dpm, dcm) {
this.dpm = fillData(dpm);
this.dcm = fillData(dcm);
}
}
{"ver":"1.0.1","uuid":"cd8dc475-b08f-42c5-95f6-40cbbcf891c1","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-14.
*
* 倒计时
*/
import ScillaComponent from "components/base/ScillaComponent";
import {resource, ScillaEvent, Sheet} from "scilla";
import TextureRenderer from "components/renderer/TextureRenderer";
function getTextureNameSample(second){
return `${second}.png`;
}
export default class CountDown extends ScillaComponent {
numberSheet: resource;
seconds: number;
onComplete: ScillaEvent = new ScillaEvent();
interval = 1000;
hideWhenStop = true;
$getTextureName: (second: number)=>string;
private _textureRenderer: TextureRenderer;
private _timer;
private _remainSeconds;
constructor(){
super();
this.$getTextureName = getTextureNameSample;
}
onAwake() {
super.onAwake();
this._textureRenderer = this.getComponent(TextureRenderer);
}
play(){
if(this.seconds > 0){
this.entity.enabled = true;
this._remainSeconds = this.seconds;
this.stop();
this.onTimer();
this._timer = setInterval(this.onTimer, this.interval);
}
}
stop(){
if(this._timer){
clearInterval(this._timer);
this._timer = null;
if(this.hideWhenStop){
this.entity.enabled = false;
}
}
}
private onTimer=()=>{
if(this._remainSeconds <= 0){
this.onComplete.invoke();
this.stop();
return;
}
let sheet = this.numberSheet;
this._textureRenderer.texture = sheet.getTexture(this.$getTextureName(this._remainSeconds));
this._remainSeconds--;
}
}
{"ver":"1.0.1","uuid":"b491b5a5-5322-4f05-bcd0-30710e31d386","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-16.
*
* 点等待
*/
import ScillaComponent from "components/base/ScillaComponent";
import {color} from "scilla";
import GraphicRenderer from "components/renderer/GraphicRenderer";
export default class DotWaiting extends ScillaComponent {
activeColor: color;
inativeColor: color;
interval = 300;
private _index;
private _startTime;
private _reset;
private _dots: GraphicRenderer[] = [];
onAwake() {
super.onAwake();
this._reset = true;
this._dots.splice(0);
for(let child of this.entity.children){
this._dots.push(child.getComponent(GraphicRenderer));
}
}
onUpdate(t) {
super.onUpdate(t);
if(this._reset){
this._reset = false;
this._startTime = t;
}
let index = Math.floor((t - this._startTime) / this.interval) % this._dots.length;
if(this._index !== index){
for (let i = 0, li = this._dots.length; i < li; i++) {
const dot = this._dots[i];
dot.fillColor = index === i ? this.activeColor : this.inativeColor;
}
}
}
}
{"ver":"1.0.1","uuid":"c8059e2b-543f-4482-9a45-ac0074393cba","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-08.
*
* 浮动上升渐隐
*/
import ScillaComponent from "components/base/ScillaComponent";
import {createTween, ease, Tween, Vector2D} from "scilla";
import {killTweens} from "scilla/src/support/Tween";
export default class FloatMissing extends ScillaComponent {
wait = 500;
delay = 0;
endPos: Vector2D = new Vector2D(0, -100);
private _tween: Tween;
private _tweenResolve: Function;
onAwake() {
super.onAwake();
if(!this._tween){
this.init();
this._tween = createTween(this, this.transform, false, {
autoPlay: false,
initFields: ['position', 'alpha', 'scale'],
onComplete: this.onTweenComplete
})
.wait(this.delay)
.to({scale: {x: 1, y: 1}}, 500, ease.backOut)
.wait(this.wait)
.to({alpha: 0, position: this.endPos.toObj()}, 300);
}
}
init() {
this.transform.alpha = 1;
this.transform.scale.setXY(0, 0)
}
play() {
return new Promise(resolve => {
this._tweenResolve = resolve;
this._tween.play(true, 0, false);
})
}
stop() {
killTweens(this.transform);
}
private onTweenComplete = () => {
if (this._tweenResolve) {
this._tweenResolve();
this._tweenResolve = null;
}
}
}
{"ver":"1.0.1","uuid":"42b053b6-a66f-417d-94a2-7bfa17086579","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-16.
*
* 飞行序列
*/
import ScillaComponent from "components/base/ScillaComponent";
import {createTween, ease, Entity, instantiate, resource, ScillaEvent, Vector2D} from "scilla";
import Transform from "components/base/Transform";
export default class FlySequence extends ScillaComponent {
ToEntity: Entity;
itemPrefab: resource;
count = 10;
fromPos = new Vector2D();
toPos = new Vector2D();
toScale = new Vector2D(0.3, 0.3);
duration = 3000;
delay = 500;
itemInterval = 100;
hideWhenComplete = true;
offset = 1;
onComplete: ScillaEvent = new ScillaEvent();
private _items: Transform[] = [];
private _itemDuration;
private _counting;
private _timerDelay;
private _timer;
onAwake() {
super.onAwake();
if (this._items.length === 0) {
this._itemDuration = this.duration - this.count * this.itemInterval - this.delay;
for (let i = 0; i < this.count; i++) {
let itemEntity = instantiate(this.itemPrefab);
itemEntity.enabled = false;
this.entity.addChild(itemEntity);
let transform = itemEntity.getComponent(Transform);
this._items.push(transform);
}
}
}
onUpdate(t) {
super.onUpdate(t);
}
play() {
this.stop();
if (this.ToEntity) {
this.toPos = this.transform.globalPositionToLocal(this.ToEntity.getComponent(Transform).globalPosition);
}
let first = this._items[0];
first.entity.enabled = true;
first.position.copyFrom(this.fromPos);
first.scale.setXY(1, 1);
this._counting = 1;
this._timerDelay = setTimeout(this.onDelay, this.delay);
}
stop(hidden = true) {
if (this._timer) {
clearInterval(this._timer);
this._timer = null;
}
if (this._timerDelay) {
clearTimeout(this._timerDelay);
this._timerDelay = null;
}
if (hidden) {
for (let item of this._items) {
item.entity.enabled = false;
}
}
}
private onDelay = () => {
this._timer = setInterval(() => {
if (this._counting > this.count - 1) {
this.stop(false);
this._flyItem(this._items[0], this.onEnd);
return;
}
this._playItem(this._counting);
this._counting++;
}, this.itemInterval)
}
private onEnd = () => {
this.onComplete.invoke();
}
private _playItem(index) {
let item = this._items[index];
item.entity.enabled = true;
item.position.copyFrom(this.fromPos);
item.scale.setXY(0, 0);
this._flyItem(item);
}
private _flyItem(item, callback?) {
const itemDuration = this._itemDuration;
createTween(this, item.scale, false)
.to({x: 1, y: 1}, itemDuration * 0.1)
.wait(itemDuration * 0.4)
.to(this.toScale.toObj(), itemDuration * 0.5);
createTween(this, item.position)
.to({x: this.toPos.x}, itemDuration);
let easeFuncCreator = Math.random() > 0.5 ? ease.getPowOut : ease.getPowIn;
let easeFunc = easeFuncCreator(Math.random() + this.offset);
createTween(this, item.position)
.to({y: this.toPos.y}, itemDuration, easeFunc)
.call(() => {
if (this.hideWhenComplete) {
item.entity.enabled = false;
}
callback && callback();
});
}
}
{"ver":"1.0.1","uuid":"ad0bee45-adbd-4088-a49d-9e6828bb0a41","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-08.
*
* 文本轮播
*/
import ScillaComponent from "components/base/ScillaComponent";
import {createTween, ease, Entity} from "scilla";
import Transform from "components/base/Transform";
import TextRenderer from "components/renderer/TextRenderer";
export enum DIR {
UP,
DOWN,
}
export default class LabelCarousel extends ScillaComponent {
entity0: Entity;
entity1: Entity;
offset = 40;
interval = 1000;
scrollDuration = 500;
dir: DIR = DIR.UP;
getTextFunc: Function;
autoPlay = false;
_playing = false;
private _index = 0;
private _labels = [];
private _timer;
onAwake() {
super.onAwake();
const {_labels, entity0, entity1, offset, dir} = this;
const entities = [entity0, entity1];
for (let entity of entities) {
let transform = entity.getComponent(Transform);
let textRenderer = entity.getComponent(TextRenderer);
transform.position.y = offset * (dir === DIR.UP ? -1 : 1);
transform.alpha = 0;
_labels.push({
transform,
textRenderer
});
}
if(this.autoPlay){
this.play();
}
}
play() {
this.playNext();
this.stop();
this._timer = setInterval(() => {
this.playNext();
}, this.interval);
this._playing = true;
}
stop() {
if(this._timer){
clearInterval(this._timer);
this._timer = null;
}
this._playing = false;
}
private updateText(textRenderer){
let text = this.getTextFunc ? this.getTextFunc() : null;
if(text){
textRenderer.text = text;
}
}
playNext() {
const {_labels, _index, scrollDuration, offset, dir} = this;
let nextLabel = _labels[_index % 2];
const sign = dir === DIR.UP ? -1 : 1;
this.updateText(nextLabel.textRenderer);
createTween(this, nextLabel.transform, true)
.set({position: {y: offset * sign * -1}})
.to({position: {y: 0}, alpha: 1}, scrollDuration, ease.cubicOut);
if (_index > 0) {
let lastLabel = _labels[(_index + 1) % 2];
createTween(this, lastLabel.transform, true)
.to({position: {y: offset * sign}, alpha: 0}, scrollDuration, ease.cubicOut);
}
this._index++;
}
}
{"ver":"1.0.1","uuid":"e61b7fe1-59ff-4cf8-8e3c-d2d0a63b4df9","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-15.
*
* 跑数字
*/
import ScillaComponent from "components/base/ScillaComponent";
import TextRenderer from "components/renderer/TextRenderer";
import {createTween, ScillaEvent} from "scilla";
function renderSimple(v) {
return Math.floor(v).toString();
}
export default class RunNumber extends ScillaComponent {
duration = 3000;
onComplete = new ScillaEvent();
private _textRenderer: TextRenderer;
private _t;
$renderFunc: (v: number) => string = renderSimple;
onAwake() {
super.onAwake();
this._textRenderer = this.getComponent(TextRenderer);
}
play(to, from?) {
if(!this._textRenderer){
return Promise.resolve();
}
from = from === undefined ? parseFloat(this._textRenderer.text) : from;
return new Promise(resolve => {
createTween(this, this, true)
.set({t: from})
.to({t: to}, this.duration)
.call(()=>{
resolve();
this.onComplete.invoke();
});
})
}
get t() {
return this._t;
}
set t(v) {
this._t = v;
this._textRenderer.text = this.$renderFunc(v);
}
}
{"ver":"1.0.1","uuid":"34eb1693-96bd-4b71-9ca6-2de9274f60fc","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-01-02.
*
* Toast
*/
import {Entity, createTween, Tween, ease, engine,} from "scilla";
import ScillaComponent from "components/base/ScillaComponent";
import TextRenderer from "components/renderer/TextRenderer";
import Transform from "components/base/Transform";
export default class Toast extends ScillaComponent {
Label: Entity;
padding = 20;
offsetY = 0;
showDuration = 300;
hideDuration = 300;
private _bgTransform: Transform;
private _labelRenderer: TextRenderer;
private _labelTransform: Transform;
private _tweenIn: Tween;
private _tweenOut: Tween;
private _timerDuration;
onAwake() {
super.onAwake();
if (!this._bgTransform) {
const {offsetY, hideDuration, showDuration, transform} = this;
this._bgTransform = this.getComponent(Transform);
this._labelRenderer = this.Label.getComponent(TextRenderer);
this._labelTransform = this.Label.getComponent(Transform);
this._tweenIn = createTween(this, transform, false, {autoPlay: false})
.to({position: {x: 0, y: offsetY}}, showDuration, ease.cubicOut);
this._tweenOut = createTween(this, transform, false, {autoPlay: false})
.to({position: {y: 0}}, hideDuration, ease.cubicIn)
.call(this.onHidden);
this.transform.position.y = this.outPos;
}
}
private get outPos(){
return engine.renderContext.stageCenter.y + this._bgTransform.height;
}
show({content, duration = 1000}) {
this.entity.enabled = true;
const {_bgTransform, _labelRenderer, _labelTransform, padding} = this;
_labelRenderer.text = content;
_labelRenderer.measureBounds();
_bgTransform.width = _labelTransform.width + padding * 2;
_bgTransform.height = _labelTransform.height + padding * 2;
this._tweenOut.queue[0].props.position.y = this.outPos;
this._tweenIn.play(true);
if (this._timerDuration) {
clearTimeout(this._timerDuration);
this._timerDuration = null;
}
this._timerDuration = setTimeout(() => {
this.hide();
}, duration);
}
hide() {
this._tweenOut.play(true);
}
private onHidden() {
this.entity.enabled = false;
}
}
{"ver":"1.0.1","uuid":"4deea944-f0f1-4802-b298-61c8826432e4","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-10.
*
* 波动画控制器
*/
import InteractComponent from "components/base/InteractComponent";
import Wave from "components/animation/Wave";
export default class WaveController extends InteractComponent {
/**
* 可交互时是否播放
*/
playWhenInteractable = true;
/**
* 不可交互时是否停止
*/
stopWhenUninteractable = true;
/**
* 按下时是否停止
*/
stopWhenTouchBegin = true;
/**
* 松开时是否停止
*/
playWhenTouchEnd = true;
private _wave: Wave;
touchBeginFlag = false;
onAwake() {
super.onAwake();
this._wave = this.getComponent(Wave);
}
onTouchBegin(e) {
super.onTouchBegin(e);
this.touchBeginFlag = true;
if(this.stopWhenTouchBegin){
if(this._wave) this._wave.stop(true);
}
}
onGlobalTouchEnd(e) {
if(this.touchBeginFlag){
this.touchBeginFlag = false;
if(this.playWhenTouchEnd){
if(this._wave) this._wave.play();
}
}
}
onInteractableChanged(interactable) {
super.onInteractableChanged(interactable);
if(interactable && this.playWhenInteractable){
if(this._wave) this._wave.play();
}
if(!interactable && this.stopWhenUninteractable){
if(this._wave) this._wave.stop();
}
}
}
{"ver":"1.0.1","uuid":"511ecf71-7d16-422b-9513-8f945ee1027e","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-15.
*/
export const configs = {
};
{"ver":"1.0.1","uuid":"19636d71-e3df-4c54-a0f1-34fc2782697b","subMetas":{},"type":"script"}
{"ver":"1.0.1","uuid":"a3fcf7cd-7450-4bd2-a98a-953050e254d9","subMetas":{},"isGroup":true}
/**
* Created by rockyl on 2019-04-10.
*
* 警告对话框内容
*/
import DialogContent from "../popup/DialogContent";
import {Entity} from "scilla";
import TextRenderer from "components/renderer/TextRenderer";
import Transform from "components/base/Transform";
export default class AlertDialogContent extends DialogContent {
Title: Entity;
Content: Entity;
ConfirmButton: Entity;
private _confirmButtonLabel: TextRenderer;
private _titleLabel: TextRenderer;
private _contentLabel: TextRenderer;
private _contentTransform: Transform;
onAwake() {
super.onAwake();
this._titleLabel = this.Title.getComponent(TextRenderer);
this._contentLabel = this.Content.getComponent(TextRenderer);
this._contentTransform = this.Content.getComponent(Transform);
if (this.ConfirmButton) {
this._confirmButtonLabel = this.ConfirmButton.getChildrenByName('Label')[0].getComponent(TextRenderer);
}
}
setup(data: any = {}) {
const {title = 'Alert', content = '', button = 'Confirm', showCloseButton = true} = data;
this._titleLabel.text = title;
this._contentLabel.text = content;
this._closeButton.entity.enabled = showCloseButton;
if (button) {
this._confirmButtonLabel.text = button;
}
this._contentTransform.position.y = button ? -30 : 40;
this.ConfirmButton.enabled = !!button;
}
onClickConfirmButton() {
this.hide('confirm')
}
}
{"ver":"1.0.1","uuid":"f92bbd9c-d6e2-4b0a-be50-30d4972521f2","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-15.
*
* PK挑战书
*/
import DialogContent from "../popup/DialogContent";
import {dynamic, Entity} from "scilla";
import TextRenderer from "components/renderer/TextRenderer";
import {renderRunCredits} from "../game/utils";
import TwoLinesButton from "../game/TwoLinesButton";
export default class PKChallenge extends DialogContent {
Content: Entity;
ButtonPK: Entity;
activityBaseInfo: dynamic;
private _buttonPK: TwoLinesButton;
onAwake() {
super.onAwake();
this._buttonPK = this.ButtonPK.getComponent(TwoLinesButton);
}
setup(data) {
super.setup(data);
const {pkExpend, machineNickname} = this.activityBaseInfo;
this._buttonPK.label1 = renderRunCredits(pkExpend) + '/次';
this.Content.getComponent(TextRenderer).text = `我是${machineNickname}`;
}
onClickConfirm() {
this.hide('accept')
}
}
{"ver":"1.0.1","uuid":"f68dd866-0ca5-4809-b91f-de05a9d683ca","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-04-10.
*
* 警告对话框内容
*/
import DialogContent from "../popup/DialogContent";
import {dynamic, Entity, resource} from "scilla";
import TextRenderer from "components/renderer/TextRenderer";
export default class PKMatching extends DialogContent {
Title: Entity;
SelfName: Entity;
OtherName: Entity;
AvatarOther: Entity;
AvatarWaiting: Entity;
CloseButton: Entity;
userNickname: dynamic;
otherName: dynamic;
private _titleRenderer: TextRenderer;
private _selfNameRenderer: TextRenderer;
private _otherNameRenderer: TextRenderer;
private _timer;
onAwake() {
super.onAwake();
this._titleRenderer = this.Title.getComponent(TextRenderer);
this._selfNameRenderer = this.SelfName.getComponent(TextRenderer);
this._otherNameRenderer = this.OtherName.getComponent(TextRenderer);
}
setup(data: any) {
const {channel} = data;
this._titleRenderer.text = '正在匹配对手…';
this._selfNameRenderer.text = this.userNickname;
this._otherNameRenderer.text = this.otherName;
this.AvatarOther.enabled = false;
this.AvatarWaiting.enabled = true;
this.CloseButton.enabled = true;
this.stop();
if(channel === 1){
this.onMatched();
}else{
this._timer = setTimeout(this.onMatched, Math.random() * 2000 + 2000);
}
}
stop() {
if (this._timer) {
clearTimeout(this._timer);
this._timer = null;
}
}
protected onTapCloseButton() {
super.onTapCloseButton();
this.stop();
}
private onMatched = () => {
this._titleRenderer.text = '匹配成功';
this.AvatarOther.enabled = true;
this.AvatarWaiting.enabled = false;
this.CloseButton.enabled = false;
setTimeout(this.hide, 1000, 'success');
}
}
{"ver":"1.0.1","uuid":"aeadb7b3-cab8-4ae0-b003-52ed2097c3d1","subMetas":{},"type":"script"}
{"ver":"1.0.1","uuid":"3da3b8d4-9870-4b99-984f-364c93608d1d","subMetas":{},"isGroup":true}
/**
* Created by rockyl on 2019-05-20.
*
* PK结果动画弹窗
*/
import {Entity, utils,} from "scilla";
import DialogContent from "../popup/DialogContent";
import AnimLayer from "./pkresult/AnimLayer";
import ResultLayer from "./pkresult/ResultLayer";
export default class PKResult extends DialogContent {
AnimLayer: Entity;
ResultLayer: Entity;
private _animLayer: AnimLayer;
private _resultLayer: ResultLayer;
onAwake() {
super.onAwake();
this._animLayer = this.AnimLayer.getComponent(AnimLayer);
this._resultLayer = this.ResultLayer.getComponent(ResultLayer);
}
onUpdate(t) {
super.onUpdate(t);
}
async setup(data) {
super.setup(data);
this.AnimLayer.enabled = true;
this.ResultLayer.enabled = false;
await this._animLayer.play(data);
await utils.waitPromise(500);
this.ResultLayer.enabled = true;
this._resultLayer.play(data);
}
onBottomButtonTap(action){
this._resultLayer.hide();
this.hide(action);
}
}
{"ver":"1.0.1","uuid":"14719161-5d31-4e48-a7b8-6109977d8441","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-04-10.
*
* 规则对话框内容
*/
import DialogContent from "../popup/DialogContent";
import {dynamic, Entity} from "scilla";
import HtmlRenderer from "components/renderer/HtmlRenderer";
export default class RuleDialogContent extends DialogContent {
Content: Entity;
ruleContent: dynamic;
private _contentRenderer: HtmlRenderer;
onAwake() {
super.onAwake();
this._contentRenderer = this.Content.getComponent(HtmlRenderer);
this._contentRenderer.htmlText = this.ruleContent;
const config = window['configJson'];
this._contentRenderer.color = config.dialog_text_color;
}
}
{"ver":"1.0.1","uuid":"f45130ad-d500-4ced-af9b-ac87ec009a19","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-15.
*
* 单人挖矿结果
*/
import {createTween, dynamic, Entity, utils} from "scilla";
import DialogContent from "../popup/DialogContent";
import RunNumber from "../common/RunNumber";
import Transform from "components/base/Transform";
import FlySequence from "../common/FlySequence";
import globalEvent from "globalEvent";
import TimesCard from "../game/TimesCard";
import {renderRunCredits} from "../game/utils";
export default class SingleResult extends DialogContent {
Wrapper: Entity;
ColorTape: Entity;
Credits: Entity;
TimesCard: Entity;
Light: Entity;
Coins: Entity;
singleDigData: dynamic;
private _runCredits: RunNumber;
private _timesCard: TimesCard;
private _wrapperTransform: Transform;
private _colorTapeTransform: Transform;
private _lightTransform: Transform;
private _flySequence: FlySequence;
onAwake() {
super.onAwake();
this._timesCard = this.TimesCard.getComponent(TimesCard);
this._colorTapeTransform = this.ColorTape.getComponent(Transform);
this._wrapperTransform = this.Wrapper.getComponent(Transform);
this._lightTransform = this.Light.getComponent(Transform);
this._flySequence = this.Coins.getComponent(FlySequence);
this._runCredits = this.Credits.getComponent(RunNumber);
this._runCredits.$renderFunc = renderRunCredits;
}
onUpdate(t) {
super.onUpdate(t);
}
async setup(data) {
super.setup(data);
this.Wrapper.enabled = true;
this.Light.enabled = false;
createTween(this, this._wrapperTransform)
.set({scale: {x: 0.8, y: 0.8}, alpha: 1})
.to({scale: {x: 1.0, y: 1.0}}, 2000);
createTween(this, this._colorTapeTransform)
.set({scale: {x: 0, y: 0}, alpha: 1})
.wait(100)
.to({scale: {x: 0.8, y: 0.8}}, 800)
.to({scale: {x: 1.1, y: 1.1}, alpha: 0}, 1200);
await this.playCredits();
this.playLight();
}
async playCredits(){
const {receiveCredits, finalCredits, multipleCard} = this.singleDigData;
const showTimesCard = multipleCard > 0;
this.TimesCard.enabled = false;
await this._runCredits.play(receiveCredits, 0);
await utils.waitPromise(500);
if (showTimesCard) {
this.TimesCard.enabled = true;
await this._timesCard.playShow(multipleCard);
createTween(this, this._wrapperTransform)
.to({scale: {x: 1.2, y: 1.2}}, 2000);
await this._runCredits.play(finalCredits, receiveCredits);
}
}
private playLight() {
createTween(this, this._wrapperTransform)
.to({alpha: 0}, 500)
.call(()=>{
this.Wrapper.enabled = false;
});
this.Light.enabled = true;
this._lightTransform.alpha = 0;
createTween(this, this._lightTransform)
.set({scale: {x: 0, y: 0}})
.to({alpha: 1, scale: {x: 1, y: 1}}, 300)
.call(()=>{
this.playCoins();
})
.to({alpha: 0, scale: {x: 0, y: 0}}, 300)
.call(()=>{
this.Light.enabled = false;
})
}
private playCoins() {
this.bubbling('setBgVisible', false);
this._flySequence.play();
globalEvent.emit('runCredits');
}
onFlyCoinEnd(){
this.hide('complete');
}
}
{"ver":"1.0.1","uuid":"d3f88761-453c-4bd6-9af5-608c6debf166","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-20.
*
* 动画层
*/
import ScillaComponent from "components/base/ScillaComponent";
import {createTween, dynamic, ease, Entity} from "scilla";
import PKResultAnimSide from "../../game/PKResultAnimSide";
import Transform from "components/base/Transform";
export default class AnimLayer extends ScillaComponent {
LeftSide: Entity;
RightSide: Entity;
Line: Entity;
userNickname: dynamic;
pkData: dynamic;
private _leftSide: PKResultAnimSide;
private _rightSide: PKResultAnimSide;
private _lineTransform: Transform;
onAwake() {
super.onAwake();
this._leftSide = this.LeftSide.getComponent(PKResultAnimSide);
this._rightSide = this.RightSide.getComponent(PKResultAnimSide);
this._lineTransform = this.Line.getComponent(Transform);
}
onUpdate(t) {
super.onUpdate(t);
}
async play(data) {
createTween(this, this._lineTransform)
.set({scale: {x: 0, y: 0}, alpha: 0}, true)
.wait(200)
.to({scale: {x: 1, y: 1}, alpha: 1}, 500, ease.backOut);
await Promise.all([this._leftSide.play({
nickname: this.userNickname,
receiveCredits: this.pkData.userReceiveCredits,
finalCredits: this.pkData.userFinalCredits,
multipleCard: this.pkData.userMultipleCard,
}),
this._rightSide.play({
nickname: this.pkData.machineNickname,
receiveCredits: this.pkData.machineReceiveCredits,
finalCredits: this.pkData.machineFinalCredits,
multipleCard: this.pkData.machineMultipleCard,
}),]);
}
}
{"ver":"1.0.1","uuid":"623082f2-a2fc-4003-9265-ae241da467a8","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-20.
*
* 结果层
*/
import ScillaComponent from "components/base/ScillaComponent";
import {createTween, dynamic, ease, Entity} from "scilla";
import PKResultSide from "../../game/PKResultSide";
import Transform from "components/base/Transform";
import RelativeLayout from "components/other/RelativeLayout";
export default class ResultLayer extends ScillaComponent {
LeftSide: Entity;
RightSide: Entity;
Line: Entity;
BottomBar: Entity;
userNickname: dynamic;
pkData: dynamic;
private _leftSide: PKResultSide;
private _rightSide: PKResultSide;
private _lineTransform: Transform;
private _bottomBarLayout: RelativeLayout;
private _bottomBarHeight;
onAwake() {
super.onAwake();
this._leftSide = this.LeftSide.getComponent(PKResultSide);
this._rightSide = this.RightSide.getComponent(PKResultSide);
this._lineTransform = this.Line.getComponent(Transform);
this._bottomBarLayout = this.BottomBar.getComponent(RelativeLayout);
this._bottomBarHeight = this.BottomBar.getComponent(Transform).height;
this.hide();
}
onUpdate(t) {
super.onUpdate(t);
}
async play(data) {
const {userFinalCredits, machineFinalCredits, machineNickname, resultState} = this.pkData;
createTween(this, this._lineTransform)
.set({scale: {x: 0, y: 0}, alpha: 0}, true)
.wait(200)
.to({scale: {x: 1, y: 1}, alpha: 1}, 500, ease.backOut);
await Promise.all([this._leftSide.play({
nickname: this.userNickname,
finalCredits: userFinalCredits,
otherFinalCredits: machineFinalCredits,
resultState
}),
this._rightSide.play({
nickname: machineNickname,
finalCredits: machineFinalCredits,
otherFinalCredits: userFinalCredits,
resultState
}),]).then(
()=>{
createTween(this, this._bottomBarLayout)
.to({bottom: 0}, 500, ease.cubicOut);
}
);
}
hide(){
this._bottomBarLayout.bottom = -this._bottomBarHeight;
}
}
{"ver":"1.0.1","uuid":"da78325c-afbd-47d5-b3f6-2a627fc81544","subMetas":{},"type":"script"}
{"ver":"1.0.1","uuid":"e6a72a1b-31bd-444b-bef6-ea7462b827c5","subMetas":{},"isGroup":true}
/**
* Created by rockyl on 2019-05-10.
*
* api处理过程
*/
import ScillaComponent from "components/base/ScillaComponent";
import GameStage from "./GameStage";
export default class ApiProcess extends ScillaComponent {
private _gameStage: GameStage;
onAwake() {
super.onAwake();
this._gameStage = this.entity.getComponent(GameStage);
}
onSingleDigSuccess(response) {
console.log(response);
this._gameStage.readyDig(1, 0);
this.getOrderStatus(response)
}
onPkDigSuccess(response, channel) {
console.log(response);
this._gameStage.readyDig(2, channel);
this.getOrderStatus(response)
}
private getOrderStatus(response){
const {actOrderNum, operationType,} = response;
this.broadcast('callApi', 1, 'getOrderStatus', {actOrderNum, operationType,})
}
onDigError(e) {
console.log(e);
if(typeof e === 'string'){
switch(e){
case '0100000':
this.bubbling('showLoginAlert');
this._gameStage.resetBottomButton();
break;
case '0201150':
this.bubbling('showCreditsAlert');
this._gameStage.resetBottomButton();
break;
case '0100016': //活动未开始
case '0100014': //活动已结束
case '0100017': //活动已关闭
this.bubbling('showErrorToast', e);
break;
default:
this.bubbling('showNetError');//, this._gameStage.restoreDig.bind(this._gameStage, e));
}
}else{
this.bubbling('showNetError');
}
}
onOrderStatusResponse(response) {
console.log('onOrderStatusResponse', response);
this._gameStage.changeOrderStatus(response);
}
onOrderStatusError(e) {
console.log('onOrderStatusError', e);
this._gameStage.changeOrderStatus(1);
}
}
{"ver":"1.0.1","uuid":"be5a5336-ec52-4fa2-bb02-22c4b73439b2","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-09.
*
* 底部按钮控制器
*/
import ScillaComponent from "components/base/ScillaComponent";
import {dynamic, Entity} from "scilla";
import TwoLinesButton from "../game/TwoLinesButton";
import Wave from "components/animation/Wave";
import WaveController from "../common/WaveController";
import {renderRunCredits} from "./utils";
import CustomButton from "./CustomButton";
function getWaveAlgorithm(){
return function bounce(t){
const s = 1 + Math.abs(Math.sin(t)) * 0.1;
return {
sx: s,
sy: s,
}
}
}
export default class BottomButtonController extends ScillaComponent {
activityBaseInfo: dynamic;
buttonPKEntity: Entity;
buttonDigEntity: Entity;
buttonDigSLEntity: Entity;
private _buttonPK: TwoLinesButton;
private _buttonDig: TwoLinesButton;
private _buttonSLDig: CustomButton;
private _buttons = [];
private _counting = 0;
onAwake() {
super.onAwake();
this._buttonSLDig = this.buttonDigSLEntity.getComponent(CustomButton);
this._buttonPK = this.buttonPKEntity.getComponent(TwoLinesButton);
const wavePK = this.buttonPKEntity.getComponent(Wave);
const wcPK = this.buttonPKEntity.getComponent(WaveController);
wavePK.waveAlgorithm = getWaveAlgorithm();
this._buttonDig = this.buttonDigEntity.getComponent(TwoLinesButton);
const waveDig = this.buttonDigEntity.getComponent(Wave);
const wcDig = this.buttonDigEntity.getComponent(WaveController);
waveDig.waveAlgorithm = getWaveAlgorithm();
this.switchState(false);
this._buttons.push({
button: this._buttonPK,
wave: wavePK,
wc: wcPK,
}, {
button: this._buttonDig,
wave: waveDig,
wc: wcDig,
});
setInterval(()=>{
const {button, wave, wc} = this._buttons[(this._counting++) % this._buttons.length];
if(button.interactable && !wc.touchBeginFlag){
wave.play();
}
}, 600);
this.updateButtonLabel();
this.disableAll();
}
initGameStage(){
const {pkExpend, miningExpend} = this.activityBaseInfo;
this.updateButtonLabel(pkExpend, miningExpend);
this.switchState(false);
}
private updateButtonLabel(pkExpend = 0, miningExpend = 0){
this._buttonPK.label1 = renderRunCredits(pkExpend) + '/次';
this._buttonDig.label1 = renderRunCredits(miningExpend) + '/次';
}
enableAll(){
for(let {button, wc} of this._buttons){
button.interactable = true;
wc.touchBeginFlag = false;
}
}
disableAll(){
for(let {button, wc} of this._buttons){
button.interactable = false;
wc.touchBeginFlag = false;
}
}
enablePkDigButton(){
this._buttonSLDig.interactable = true;
}
disablePkDigButton(){
this._buttonSLDig.interactable = false;
}
switchState(isPK){
this.buttonPKEntity.enabled = !isPK;
this.buttonDigEntity.enabled = !isPK;
this.buttonDigSLEntity.enabled = isPK;
if(isPK){
this.enablePkDigButton();
}
}
}
{"ver":"1.0.1","uuid":"a007b015-23b8-469d-9cbb-4580e1e2f56a","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-09.
*
* 积分栏
*/
import ScillaComponent from "components/base/ScillaComponent";
import TextRenderer from "components/renderer/TextRenderer";
import {dynamic, Entity,} from "scilla";
import RunNumber from "../common/RunNumber";
import globalEvent from "globalEvent";
import RectRenderer from "components/renderer/RectRenderer";
export default class CreditsBar extends ScillaComponent {
CreditsUnitName: Entity;
LabelCreditsCurrent: Entity;
Line: Entity;
Label: Entity;
LabelCreditsTotal: Entity;
showCredits: dynamic;
activityBaseInfo: dynamic;
unitName: dynamic;
runDuration = 2000;
private _bgRenderer: RectRenderer;
private _creditsUnitName: TextRenderer;
private _labelCreditsCurrent: TextRenderer;
private _labelCreditsTotal: TextRenderer;
private _runCreditsTotal: RunNumber;
private _runCreditsCurrent: RunNumber;
onAwake() {
super.onAwake();
globalEvent.on('runCredits', this.runCredits, this);
this._bgRenderer = this.getComponent(RectRenderer);
this._creditsUnitName = this.CreditsUnitName.getComponent(TextRenderer);
this._labelCreditsCurrent = this.LabelCreditsCurrent.getComponent(TextRenderer);
this._labelCreditsTotal = this.LabelCreditsTotal.getComponent(TextRenderer);
this._runCreditsCurrent = this.LabelCreditsCurrent.getComponent(RunNumber);
this._runCreditsTotal = this.LabelCreditsTotal.getComponent(RunNumber);
this._creditsUnitName.text = this.unitName;
if(this.showCredits !== 1){
this.LabelCreditsCurrent.enabled = false;
this.Line.enabled = false;
this.Label.enabled = false;
}
this._bgRenderer.width = this.showCredits === 1 ? 480 : 320;
}
initGameStage(){
const {curCredits, heapCredits} = this.activityBaseInfo;
if(this.showCredits === 1){
this._labelCreditsCurrent.text = curCredits.toString();
}
this._labelCreditsTotal.text = heapCredits.toString();
}
runCredits(duration?){
const {curCredits, heapCredits} = this.activityBaseInfo;
if(this.showCredits === 1){
this._runCreditsCurrent.duration = duration || this.runDuration;
this._runCreditsCurrent.play(curCredits);
}
this._runCreditsTotal.duration = duration || this.runDuration;
this._runCreditsTotal.play(heapCredits);
}
}
{"ver":"1.0.1","uuid":"462522fe-e68c-4c0b-b784-267109cdcd6d","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-22.
*
* 自定义按钮
*/
import Button from "components/ui/Button";
export default class CustomButton extends Button {
upLabelColorKey:string;
disabledLabelColorKey:string;
onAwake() {
super.onAwake();
const config = window['configJson'];
if(this.upLabelColorKey){
this.upLabelColor = config[this.upLabelColorKey];
}
if(this.disabledLabelColorKey){
this.disabledLabelColor = config[this.disabledLabelColorKey];
}
}
}
{"ver":"1.0.1","uuid":"d74bdb4d-5af2-43c6-ac4b-299e4d2db9a8","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-23.
*
* 自定义文本渲染器
*/
import TextRenderer from "components/renderer/TextRenderer";
export default class CustomTextRenderer extends TextRenderer {
fillColorKey: string;
onAwake() {
super.onAwake();
const config = window['configJson'];
if(this.fillColorKey){
this.fillColor = config[this.fillColorKey];
}
}
}
{"ver":"1.0.1","uuid":"edf9fcf2-169b-46e9-88c5-a7b1e043c312","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-07.
*
* 游戏舞台
*/
import ScillaComponent from "components/base/ScillaComponent";
import {Entity, instantiate, Texture, resource, dynamic, engine} from "scilla";
import Miner from "./Miner";
import BottomButtonController from "./BottomButtonController";
import CountDown from "../common/CountDown";
import ItemLayer from "./ItemLayer";
import globalEvent from "globalEvent";
const minerConfigs = [
{res: 'blue', dir: 1, walk: true},
{res: 'red', dir: -1, walk: false},
];
export default class GameStage extends ScillaComponent {
MinerLayer: Entity;
ItemLayer: Entity;
Bottom: Entity;
CountDown: Entity;
isLogin: dynamic;
holeRes: Texture;
minerPrefab: resource;
activityBaseInfo: dynamic;
singleDigData: dynamic;
pkDigData: dynamic;
private _bottomButtonController: BottomButtonController;
private _miners: Miner[] = [];
private _countdown: CountDown;
private _itemLayer: ItemLayer;
private _orderStatus;
private _digFinishedCount;
private _minerCount;
onAwake() {
super.onAwake();
this._bottomButtonController = this.Bottom.getComponent(BottomButtonController);
this._countdown = this.CountDown.getComponent(CountDown);
this._itemLayer = this.ItemLayer.getComponent(ItemLayer);
for (let config of minerConfigs) {
let minerEntity = instantiate(this.minerPrefab);
this.MinerLayer.addChild(minerEntity);
let miner: Miner = minerEntity.getComponent(Miner);
miner.prepare(this._itemLayer.digDelegate, this.holeRes.height - 40, config.res);
this._miners.push(miner);
minerEntity.enabled = false;
}
}
initGameStage() {
this.reset();
if (this.activityBaseInfo.machineNickname) {
this.bubbling('showDialog', 'PKChallenge', null, this.onPKChallengeClose)
}
}
private reset() {
for (let miner of this._miners) {
miner.entity.enabled = false;
miner.reset();
}
this._itemLayer.prepareItems();
this.resetBottomButton();
const selfMiner: Miner = this._miners[0];
selfMiner.entity.enabled = true;
selfMiner.standSide(1);
selfMiner.playWalk();
}
resetBottomButton() {
this._bottomButtonController.switchState(false);
this._bottomButtonController.enableAll();
}
private loginAlert() {
if (!this.isLogin) {
this.bubbling('showLoginAlert');
}
return this.isLogin;
}
private creditsAlert() {
/*let {miningExpend, pkExpend, curCredits} = engine.dataCenter.get('API', 'activityBaseInfo');
if (miningExpend > curCredits || pkExpend > curCredits) {
this.bubbling('showCreditsAlert');
return false;
}*/
return true;
}
onTapDig() {
if (!this.loginAlert() || !this.creditsAlert()) {
return;
}
this._bottomButtonController.disableAll();
this._orderStatus = 0;
this._digFinishedCount = 0;
this._minerCount = 1;
const opActivityId = engine.dataCenter.get('CFG', 'opActivityId');
this.broadcast('callApi', 1, 'singleDigData', {opActivityId})
}
onTapPK(channel = 0) {
if (!this.loginAlert() || !this.creditsAlert()) {
return;
}
this._bottomButtonController.disableAll();
this._orderStatus = 0;
this._digFinishedCount = 0;
this._minerCount = 2;
const opActivityId = engine.dataCenter.get('CFG', 'opActivityId');
this.broadcast('callApi', 1, 'pkDigData', {opActivityId}, channel)
}
changeOrderStatus(v) {
this._orderStatus = v;
this.checkDigEnd();
}
readyDig(minerCount, channel) {
if (minerCount === 1) {
this.startDig(minerCount);
} else {
//this.onDigEnd();
if(channel === 1){
this.pkDigData.machineNickname = this.activityBaseInfo.machineNickname;
}
this.bubbling('hideAllDialog');
this.bubbling('showDialog', 'PKMatching', {channel}, this.matchResult);
}
this.activityBaseInfo.curCredits -= minerCount === 1 ? this.activityBaseInfo.miningExpend : this.activityBaseInfo.pkExpend;
globalEvent.emit('runCredits', 500);
this._itemLayer.stopCreditsAnimation();
}
startDig(minerCount) {
const {_miners, _countdown} = this;
_countdown.stop();
const selfMiner: Miner = _miners[0];
selfMiner.playDig();
if (minerCount === 1) {
} else {
this._bottomButtonController.disablePkDigButton();
const otherMiner: Miner = _miners[1];
otherMiner.avoidToDig(selfMiner.transform.position);
}
}
private matchResult = (action) => {
if (action === 'close') {
this._bottomButtonController.enableAll();
this.broadcast('abortCallApi', 1, 'getOrderStatus');
} else {
this.startPKDig();
}
}
startPKDig() {
this._bottomButtonController.switchState(true);
this._countdown.play();
for (let i = 0, li = minerConfigs.length; i < li; i++) {
const config = minerConfigs[i];
const miner = this._miners[i];
miner.entity.enabled = true;
miner.standSide(config.dir);
miner.playWalk();
}
}
restoreDig(e) {
this.reset();
}
checkDigEnd() {
if (this._orderStatus !== 0 && this._digFinishedCount === this._minerCount) {
switch (this._orderStatus) {
case 2:
this.onDigEnd();
break;
case 1:
case 3:
this.bubbling('showNetError');
break;
}
}
}
digEnd() {
this._digFinishedCount++;
this.checkDigEnd();
}
private onDigEnd() {
switch (this._minerCount) {
case 1:
this.activityBaseInfo.curCredits += this.singleDigData.finalCredits;
this.activityBaseInfo.heapCredits += this.singleDigData.finalCredits;
this.bubbling('hideAllDialog');
this.bubbling('showDialog', 'SingleResult', null, this.onSingleResultComplete);
break;
case 2:
const {userFinalCredits, machineFinalCredits} = this.pkDigData;
const resultState = userFinalCredits === machineFinalCredits ? 0 : (userFinalCredits > machineFinalCredits ? -1 : 1);
this.pkDigData.resultState = resultState;
let gotCredits = userFinalCredits;
if (resultState < 0) {
gotCredits += machineFinalCredits;
} else if (resultState > 0) {
gotCredits = 0;
}
this.activityBaseInfo.curCredits += gotCredits;
this.activityBaseInfo.heapCredits += gotCredits;
this.bubbling('hideAllDialog');
this.bubbling('showDialog', 'PKResult', null, this.onPKResult);
break;
}
}
private onPKResult = (action) => {
this.reset();
if (action === 'retry') {
this.onTapPK();
}
}
private onSingleResultComplete = () => {
this.reset();
}
private onPKChallengeClose = (action) => {
if(action === 'accept'){
this.onTapPK(1);
}
}
}
{"ver":"1.0.1","uuid":"32b6e077-b050-4fef-b311-f20eed2b138e","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-10.
*
* 洞
*/
import ScillaComponent from "components/base/ScillaComponent";
import {Entity} from "scilla";
import Transform from "components/base/Transform";
export default class Hole extends ScillaComponent {
Bg: Entity;
Bottom: Entity;
heightOffset = 50;
bottomOffset = 50;
private bgMask: Transform;
private bottomTransform: Transform;
onAwake() {
super.onAwake();
this.bgMask = this.Bg.getComponent(Transform);
this.bottomTransform = this.Bottom.getComponent(Transform);
}
show(){
this.entity.enabled = true;
this.setDeep(0);
}
hide(){
this.entity.enabled = false;
}
setDeep(v){
this.bgMask.height = v + this.heightOffset;
this.bottomTransform.position.y = v + this.bottomOffset;
}
}
{"ver":"1.0.1","uuid":"0a6de690-76e4-4086-9c7f-4901026ab16f","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-07.
*
* 物品
*/
import ScillaComponent from "components/base/ScillaComponent";
import {Entity} from "scilla";
import FloatMissing from "../common/FloatMissing";
import TextRenderer from "components/renderer/TextRenderer";
export default class Item extends ScillaComponent {
creditsEntity: Entity;
Label: Entity;
exclude = false;
private _floatMissing: FloatMissing;
private _label: TextRenderer;
private _playing = false;
onAwake() {
super.onAwake();
this._floatMissing = this.creditsEntity.getComponent(FloatMissing);
this._label = this.Label.getComponent(TextRenderer);
}
reset(pos) {
this.transform.position.copyFrom(pos);
this.entity.enabled = true;
this.exclude = false;
this._playing = false;
}
async playCredits(cost) {
this._label.text = cost.toString();
this.creditsEntity.enabled = true;
this._floatMissing.delay = Math.random() * 500;
this._playing = true;
await this._floatMissing.play();
this._playing = false;
}
stopCredits() {
this.creditsEntity.enabled = false;
}
get playing() {
return this._playing;
}
hit(x, y, hitWidth, hitHeight) {
const {x: px, y: py} = this.transform.position;
return x > px - hitWidth / 2 && x < px + hitWidth / 2 && py && y > py - hitHeight / 2 && y < py + hitHeight / 2;
}
}
{"ver":"1.0.1","uuid":"be58ee69-4724-453a-bb23-5d720af5508b","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-17.
*
* 物品层管理
*/
import ScillaComponent from "components/base/ScillaComponent";
import {dynamic, instantiate, math, resource, Size, Texture} from "scilla";
import Item from "./Item";
import Transform from "components/base/Transform";
export default class ItemLayer extends ScillaComponent {
itemCount = 13;
itemPosPadding = 50;
itemPosRange: Size = new Size(750, 500);
itemCellPadding = 20;
itemPosOffsetY = 50;
playCreditsCount = 4;
itemPrefab: resource;
activityBaseInfo: dynamic;
holeRes: Texture;
itemRes: Texture;
private _items: Item[] = [];
private _playCreditsCount;
private _itemGap;
private _itemPosOffset;
private _freePlayCreditsCount;
private _excludeItemQueue = [];
private _timerCreditsAnimation;
onAwake() {
super.onAwake();
this._playCreditsCount = Math.floor(this.itemCount / 3);
this._itemGap = {
x: (this.itemPosRange.width - this.itemPosPadding * 2) / 3,
y: (this.itemPosRange.height - this.itemCellPadding * 2) / 3,
};
this._itemPosOffset = {
x: -this.itemPosRange.width / 2,
y: this.itemPosOffsetY,
};
for (let i = 0; i < this.itemCount; i++) {
let itemEntity = instantiate(this.itemPrefab);
this.entity.addChild(itemEntity);
itemEntity.enabled = false;
this._items.push(itemEntity.getComponent(Item));
}
}
prepareItems() {
this._freePlayCreditsCount = this.playCreditsCount;
this._excludeItemQueue.splice(0);
const {_itemGap, _itemPosOffset, itemPosPadding, itemCellPadding, itemPosRange} = this;
let i, j;
for (i = 0; i < 4; i++) {
this.addItem(i, {
x: i * _itemGap.x + _itemPosOffset.x + itemPosPadding,
y: _itemPosOffset.y + Math.random() * itemPosRange.height + itemPosPadding,
})
}
for (j = 0; j < this.itemCount - 4; j++) {
const gx = j % 3;
const gy = Math.floor(j / 3);
this.addItem(i + j, {
x: gx * _itemGap.x + _itemPosOffset.x + itemPosPadding + Math.random() * (_itemGap.x - itemCellPadding * 2) + itemCellPadding,
y: gy * _itemGap.y + _itemPosOffset.y + itemPosPadding + Math.random() * (_itemGap.y - itemCellPadding * 2) + itemCellPadding,
})
}
this.entity.children.sort((a, b) => {
return a.getComponent(Transform).position.y - b.getComponent(Transform).position.y
});
this.stopCreditsAnimation();
this.playCreditsAnimation();
}
private addItem(i, pos) {
const item = this._items[i];
item.reset(pos);
}
playCreditsAnimation() {
this._timerCreditsAnimation = setInterval(this.playACredits, 200)
}
stopCreditsAnimation() {
if (this._timerCreditsAnimation) {
clearInterval(this._timerCreditsAnimation);
this._timerCreditsAnimation = null;
}
for (let item of this._items) {
item.stopCredits();
}
}
private playACredits = async () => {
if (this._freePlayCreditsCount > 0) {
const {_excludeItemQueue, _items} = this;
let targetItem: Item, index;
while (true) {
index = Math.floor(Math.random() * _items.length);
if (_excludeItemQueue.indexOf(index) < 0) {
targetItem = _items[index];
if (!targetItem.playing) {
break;
}
}
}
this._freePlayCreditsCount--;
_excludeItemQueue.push(index);
if (_excludeItemQueue.length > this._playCreditsCount * 2) {
_excludeItemQueue.shift();
}
const cost = math.makeRandomInt(this.activityBaseInfo.miningExpend * 2, 1);
await targetItem.playCredits(cost);
this._freePlayCreditsCount++;
}
};
digDelegate = (x, y) => {
let items = [];
let hitWidth = this.holeRes.width + this.itemRes.width - 40;
for (let item of this._items) {
if (!item.exclude && item.hit(x, y, hitWidth, 5)) {
items.push(item);
}
}
return items;
}
}
{"ver":"1.0.1","uuid":"d96ccbea-dbe7-403e-ab94-c2951e4e8478","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-07.
*
* 矿工
*/
import ScillaComponent from "components/base/ScillaComponent";
import FrameAnimationRenderer from "components/renderer/FrameAnimationRenderer";
import {createTween, ease, Entity, instantiate, resource, Texture, Vector2D} from "scilla";
import Hole from "./Hole";
import Transform from "components/base/Transform";
const speed: Vector2D = new Vector2D(2.5, 2.5);
const walkRange: number = 750 / 2 - 50;
enum STATUS {
IDLE,
WALK,
DIG,
DIG_IDLE,
}
export default class Miner extends ScillaComponent {
Hole: Entity;
Miner: Entity;
Body: Entity;
Effect: Entity;
Items: Entity;
itemHangPrefab: resource;
itemGap = new Vector2D(5, -1);
smallItemScale: Vector2D = new Vector2D(0.3, 0.3);
animations: resource;
holeRes: Texture;
private _minerTransform: Transform;
private _bodyAnim: FrameAnimationRenderer;
private _effectAnim: FrameAnimationRenderer;
private _velocity: Vector2D = new Vector2D();
private _status: STATUS;
private _diggingHole = false;
private _digDelegate;
private _hole: Hole;
private _itemCount = 0;
private _maxDepth;
private _avoidPosition;
constructor() {
super();
this._status = STATUS.IDLE;
}
prepare(digDelegate, maxDepth, resName) {
this._digDelegate = digDelegate;
this._maxDepth = maxDepth;
this._bodyAnim.frameAnimation = this.animations[resName];
}
reset() {
for (let item of this.Items.children) {
item.enabled = false;
}
this._itemCount = 0;
this._avoidPosition = null;
this._hole.hide();
this._minerTransform.position.y = 0;
}
onAwake() {
super.onAwake();
if (!this._minerTransform) {
this._minerTransform = this.Miner.getComponent(Transform);
this._bodyAnim = this.Body.getComponent(FrameAnimationRenderer);
this._effectAnim = this.Effect.getComponent(FrameAnimationRenderer);
this._hole = this.Hole.getComponent(Hole);
this._hole.hide();
}
}
onUpdate(t) {
super.onUpdate(t);
const {_minerTransform: {position: minerPosition}, transform: {position}, _velocity} = this;
switch (this._status) {
case STATUS.IDLE:
break;
case STATUS.WALK:
position.x += _velocity.x;
if (Math.abs(position.x) > walkRange) {
_velocity.x = -_velocity.x;
this.dir = _velocity.x >= 0 ? 1 : -1;
}
if (this._avoidPosition && Math.abs(position.x - this._avoidPosition.x) > this.holeRes.width) {
this.playDig();
}
break;
case STATUS.DIG:
if (this._diggingHole) {
minerPosition.y += _velocity.y;
this._hole.setDeep(minerPosition.y - 25);
let items = this._digDelegate(position.x, minerPosition.y - 50);
if (items.length > 0) {
this.playDigIdle();
}
for (const item of items) {
this.playAddItem(item);
}
if (minerPosition.y > this._maxDepth) {
this.playIdle();
this.bubbling('digEnd');
}
}
break;
case STATUS.DIG_IDLE:
break;
}
}
get dir() {
return this._minerTransform.scale.x;
}
set dir(v) {
this._minerTransform.scale.x = v;
}
standSide(dir) {
this.transform.position.x = walkRange * -dir;
this.dir = dir;
}
playIdle() {
this._status = STATUS.IDLE;
this._bodyAnim.play('idle', -1);
}
playWalk() {
this._status = STATUS.WALK;
this._diggingHole = false;
this._bodyAnim.play('walk', -1);
this._velocity.x = speed.x;
this.dir = 1;
}
playDig() {
this._bodyAnim.play('beginDig', 1);
this._status = STATUS.DIG;
this._velocity.setXY(0, speed.y);
}
playDigIdle() {
this._bodyAnim.play('idle', -1);
this._status = STATUS.DIG_IDLE;
this._velocity.y = 0;
}
playAddItem(item) {
let target: Entity;
for (let item of this.Items.children) {
if (!item.enabled) {
target = item;
target.enabled = true;
break;
}
}
if (!target) {
target = instantiate(this.itemHangPrefab);
this.Items.addChild(target);
}
item.exclude = true;
item.entity.enabled = false;
const pos = item.getComponent(Transform).globalPosition;
const targetTransform = target.getComponent(Transform);
let localPos = this.Items.getComponent(Transform).globalPositionToLocal(pos);
targetTransform.position.copyFrom(localPos);
targetTransform.scale.setXY(1, 1);
const position = {x: this._itemCount * this.itemGap.x, y: this._itemCount * this.itemGap.y};
this._itemCount++;
createTween(this, targetTransform, false, {fields: ['x', 'y']})
.to({position, scale: this.smallItemScale.toObj()}, 500, ease.cubicInOut)
.call(() => {
this.playDig();
});
}
onAnimationComplete(label) {
switch (label) {
case 'beginDig':
this._bodyAnim.play('dig', -1);
this._effectAnim.play(0, 1);
this._hole.show();
this._diggingHole = true;
break;
}
}
onAnimationLoopComplete(label) {
switch (label) {
case 'dig':
this._effectAnim.play(0, 1);
break;
}
}
avoidToDig(position: Vector2D) {
setTimeout(() => {
this._avoidPosition = position;
}, Math.random() * 500 + 500);
}
}
{"ver":"1.0.1","uuid":"ea56aa28-3292-4e32-bb05-de08d7be6bc2","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-10.
*
* 公告栏
*/
import ScillaComponent from "components/base/ScillaComponent";
import LabelCarousel from '../common/LabelCarousel'
import {dynamic} from "scilla";
import RectRenderer from "components/renderer/RectRenderer";
export default class NoticeBar extends ScillaComponent {
opActivityId: dynamic;
private _labelCarousel: LabelCarousel;
private _pool:string[] = [];
private _bgRenderer: RectRenderer;
onAwake() {
super.onAwake();
this._bgRenderer = this.getComponent(RectRenderer);
this._bgRenderer.enabled = false;
this._labelCarousel = this.getComponent(LabelCarousel);
this._labelCarousel.getTextFunc = this.getTextFunc;
}
initGameStage(){
this.broadcast('callApi', 1, 'noticeContent', {opActivityId: this.opActivityId})
}
onGotNoticeContent(response){
this._pool = this._pool.concat(response);
if(!this._labelCarousel._playing){
this._labelCarousel.play();
}
}
getTextFunc=()=>{
if(this._pool.length < 5){
this.initGameStage();
}
if(this._pool.length > 0){
if(this._pool.length > 0){
this._bgRenderer.enabled = true;
}
return this._pool.shift();
}
}
}
{"ver":"1.0.1","uuid":"9d25ac25-4b4e-4306-b25d-15ead82e32b8","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-14.
*
* pk结果动画一侧
*/
import ScillaComponent from "components/base/ScillaComponent";
import {createTween, ease, engine, Entity, Tween} from "scilla";
import Transform from "components/base/Transform";
import TextRenderer from "components/renderer/TextRenderer";
import TimesCard from "./TimesCard";
import RunNumber from "../common/RunNumber";
import {renderRunCredits} from "./utils";
export default class PKResultAnimSide extends ScillaComponent {
LabelName: Entity;
LabelCredits: Entity;
TimesCard: Entity;
side: number;
private _labelName: TextRenderer;
private _labelCredits: TextRenderer;
private _labelCreditsTransform: Transform;
private _labelRunCredits: RunNumber;
private _timesCard: TimesCard;
private _pos;
onAwake() {
super.onAwake();
if (!this._labelName) {
this._labelName = this.LabelName.getComponent(TextRenderer);
this._labelCredits = this.LabelCredits.getComponent(TextRenderer);
this._labelCreditsTransform = this.LabelCredits.getComponent(Transform);
this._labelRunCredits = this.LabelCredits.getComponent(RunNumber);
this._timesCard = this.TimesCard.getComponent(TimesCard);
this._labelRunCredits.$renderFunc = renderRunCredits;
this._pos = this.transform.position.x;
}
}
async play(data) {
const {nickname, receiveCredits, finalCredits, multipleCard} = data;
const showTimesCard = multipleCard > 0;
this._labelName.text = nickname;
this._labelCredits.text = '';
this.TimesCard.enabled = false;
this._labelCreditsTransform.scale.setXY(0.6, 0.6);
const toScale1 = {
x: 1, y: 1,
};
const toScale2 = {
x: 1.4, y: 1.4,
};
const stageWidth = engine.renderContext.stageSize.width;
await createTween(this, this.transform.position)
.set({x: stageWidth * this.side}, true)
.to({x: this._pos}, 500, ease.backOut)
.getPromise();
createTween(this, this._labelCreditsTransform)
.to({scale: showTimesCard ? toScale1 : toScale2}, 1000);
await this._labelRunCredits.play(receiveCredits, 0);
if (showTimesCard) {
await this._timesCard.playShow(multipleCard);
createTween(this, this._labelCreditsTransform)
.to({scale: toScale2}, 1000);
await this._labelRunCredits.play(finalCredits, receiveCredits);
}
}
}
{"ver":"1.0.1","uuid":"63601f3f-259a-4797-ba07-798fe00d4890","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-14.
*
* pk结果一侧
*/
import {Entity, resource} from "scilla";
import ScillaComponent from "components/base/ScillaComponent";
import {createTween, ease, engine, Entity, Tween} from "scilla";
import Transform from "components/base/Transform";
import TextRenderer from "components/renderer/TextRenderer";
import RunNumber from "../common/RunNumber";
import {renderRunCredits} from "./utils";
import Zoom from "components/animation/Zoom";
import TextureRenderer from "components/renderer/TextureRenderer";
export default class PKResultSide extends ScillaComponent {
LabelName: Entity;
LabelCredits: Entity;
ResultTag: Entity;
Body: Entity;
Stars: Entity;
side: number;
winTagRes: resource;
loseTagRes: resource;
equalTagRes: resource;
winBodyRes: resource;
loseBodyRes: resource;
private _labelName: TextRenderer;
private _labelCredits: TextRenderer;
private _labelCreditsTransform: Transform;
private _resultTagZoom: Zoom;
private _resultTagRenderer: TextureRenderer;
private _bodyRenderer: TextureRenderer;
private _labelRunCredits: RunNumber;
private _pos;
onAwake() {
super.onAwake();
if (!this._labelName) {
this._labelName = this.LabelName.getComponent(TextRenderer);
this._labelCredits = this.LabelCredits.getComponent(TextRenderer);
this._labelCreditsTransform = this.LabelCredits.getComponent(Transform);
this._resultTagRenderer = this.ResultTag.getComponent(TextureRenderer);
this._bodyRenderer = this.Body.getComponent(TextureRenderer);
this._resultTagZoom = this.ResultTag.getComponent(Zoom);
this._labelRunCredits = this.LabelCredits.getComponent(RunNumber);
this._labelRunCredits.$renderFunc = renderRunCredits;
this._pos = this.transform.position.x;
}
}
onUpdate(t) {
super.onUpdate(t);
}
async play(data) {
const {nickname, finalCredits, otherFinalCredits, resultState} = data;
this._labelName.text = nickname;
this._labelCredits.text = renderRunCredits(finalCredits);
const win = resultState === this.side;
this._bodyRenderer.texture = resultState === 0 || win ? this.winBodyRes : this.loseBodyRes;
this.ResultTag.enabled = false;
this.Stars.enabled = false;
const stageWidth = engine.renderContext.stageSize.width;
await createTween(this, this.transform.position)
.set({x: stageWidth * this.side}, true)
.to({x: this._pos}, 300, ease.cubicOut)
.getPromise();
this._labelCreditsTransform.scale.setXY(1, 1);
this._resultTagRenderer.texture = resultState === 0 ? this.equalTagRes : (win ? this.winTagRes : this.loseTagRes);
setTimeout(() => {
this.ResultTag.enabled = true;
if(win){
this.Stars.enabled = true;
}
}, 300);
if (resultState === 0) {
} else {
const toValue = win ? finalCredits + otherFinalCredits : 0;
await createTween(this, this._labelCreditsTransform)
.wait(1000)
.call(() => {
this._labelRunCredits.play(toValue);
})
.to({scale: win ? {x: 1.4, y: 1.4} : {x: 0.6, y: 0.6}}, 1000)
.getPromise();
}
}
}
{"ver":"1.0.1","uuid":"78cfc556-fadc-4586-9220-9dfd6a7afde6","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-14.
*
* 翻倍卡
*/
import ScillaComponent from "components/base/ScillaComponent";
import {createTween, ease, Entity} from "scilla";
import TextRenderer from "components/renderer/TextRenderer";
export default class TimesCard extends ScillaComponent {
Label: Entity;
private _labelRenderer: TextRenderer;
onAwake() {
super.onAwake();
this._labelRenderer = this.Label.getComponent(TextRenderer);
}
setTimes(v){
this._labelRenderer.text = 'X' + v;
}
playShow(v){
if(v !== undefined){
this.setTimes(v);
}
this.entity.enabled = true;
return new Promise(resolve => {
createTween(this, this.transform, true)
.set({scale: {x: 2, y: 2}, alpha: 0}, true)
.to({scale: {x: 1, y: 1}, alpha: 1}, 500, ease.backOut)
.wait(500)
.to({alpha: 0}, 500)
.call(resolve);
})
}
}
{"ver":"1.0.1","uuid":"1018b3da-572b-4807-8ede-f42091ce6a62","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-06.
*
* 双行文本按钮
*/
import {Entity} from "scilla";
import {decorators} from "scilla";
import TextRenderer from "components/renderer/TextRenderer";
import CustomButton from "./CustomButton";
const {dirtyFieldDetector} = decorators;
export default class TwoLinesButton extends CustomButton {
@dirtyFieldDetector
label0: string;
@dirtyFieldDetector
label1: string;
label0Entity: Entity;
label1Entity: Entity;
protected label0TextRenderer: TextRenderer;
protected label1TextRenderer: TextRenderer;
onAwake() {
if(!this.label0TextRenderer){
this.label0TextRenderer = this.label0Entity.getComponent(TextRenderer);
this.label1TextRenderer = this.label1Entity.getComponent(TextRenderer);
}
super.onAwake();
}
onUpdate(t) {
if(this['dirty']){
this.label0TextRenderer.text = this.label0;
this.label1TextRenderer.text = this.label1;
}
super.onUpdate(t);
}
changeTexture(status) {
super.changeTexture(status);
if(this.label0TextRenderer){
this.label0TextRenderer.fillColor = this.interactable ? this.upLabelColor : this.disabledLabelColor;
this.label1TextRenderer.fillColor = this.interactable ? this.upLabelColor : this.disabledLabelColor;
}
}
}
{"ver":"1.0.1","uuid":"d28cdfe9-7aad-4db4-a824-80f786cba979","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-15.
*/
import {engine} from "scilla";
export function renderRunCredits(v) {
const unitName = engine.dataCenter.get('CFG', 'unitName');
return Math.floor(v) + unitName;
}
export function htmlSimplify(html: string): string {
let content = html
.replace(/<\/\w+><\w+>/ig, '\n')
.replace(/<\w+>/ig, '\n')
.replace(/<\/\w+>/ig, '\n')
.replace(/<\w+\/>/ig, '\n')
.replace('&nbsp;', '')
content = content.trim();
return content;
}
export function isWeiXin() {
const ua = window.navigator.userAgent.toLowerCase();
return ua.includes('micromessenger');
}
{"ver":"1.0.1","uuid":"7501ad5e-293d-4dbc-95a0-03568d6bb466","subMetas":{},"type":"script"}
{"ver":"1.0.1","uuid":"3aee8c54-5ca1-40de-a693-344b22f66170","subMetas":{},"isGroup":true}
/**
* Created by rocky.l on 2017/1/19.
*
* 场景导航器
*/
import {EventEmitter} from 'scilla'
import {alien} from "./StackNavigator";
import NavigatorAction = alien.NavigatorAction;
import INavigatorDelegate = alien.INavigatorDelegate;
import StackNavigator = alien.StackNavigator;
export interface INavigatorViewBase {
onAddView(): boolean;
onWillMount(last: string, action: NavigatorAction, parameters: any): Promise<any>;
onWillUnMount(next: string, action: NavigatorAction, parameters: any): Promise<any>;
onWillEnter(last: string, action: NavigatorAction, parameters: any): Promise<any>;
onDidEnter(last: string, action: NavigatorAction, parameters: any): void;
onWillLeave(next: string, action: NavigatorAction, parameters: any): Promise<any>;
onDidLeave(next: string, action: NavigatorAction, parameters: any): void;
}
const showLog = false;
export class Navigator extends EventEmitter implements INavigatorDelegate {
static VIEW_WILL_ENTER: string = 'VIEW_WILL_ENTER';
static VIEW_DID_ENTER: string = 'VIEW_DID_ENTER';
static VIEW_WILL_LEAVE: string = 'VIEW_WILL_LEAVE';
static VIEW_DID_LEAVE: string = 'VIEW_DID_LEAVE';
stack: StackNavigator;
protected _classDic: any;
protected _instanceDic: any;
protected _currentName: string;
protected _currentView: INavigatorViewBase;
constructor() {
super();
this._classDic = {};
this._instanceDic = {};
this.stack = new StackNavigator(this);
}
register(name: string, clazz: any): void {
this._classDic[name] = clazz;
}
push(name: string, parameters: any = null) {
this.stack.push(name, parameters);
}
pop(parameters: any = null) {
this.stack.pop(parameters);
}
popToBottom(parameters: any = null) {
this.stack.popTo(0, null, parameters);
}
popAll(name: string, parameters: any = null) {
this.stack.popAll(name, parameters);
}
replace(name: string, parameters: any = null) {
this.stack.replace(name, parameters);
}
jump(name: string, parameters: any = null) {
this.stack.jump(name, parameters);
}
get currentView(): INavigatorViewBase {
return this._currentView;
}
get currentName(): string {
return this._currentName;
}
protected newView(name: string): INavigatorViewBase {
return new this._classDic[name]();
}
protected getViewInstanceByName(name: string): INavigatorViewBase {
let view: INavigatorViewBase = this._instanceDic[name];
if (!view) {
view = this._instanceDic[name] = this.newView(name);
}
return view;
}
protected addView(view: INavigatorViewBase, addToBottom) {
}
/**
* 栈入实现
* @param name
* @param last
* @param action
* @param parameters
* @returns {Promise<void>}
*/
async onEnter(name: string, last: string, action: NavigatorAction, parameters: any) {
let view: INavigatorViewBase = this.getViewInstanceByName(name);
this._currentView = view;
this._currentName = name;
await view.onWillMount(last, action, parameters);
let addToBottom = view.onAddView();
this.addView(view, addToBottom);
if (showLog) console.log(name + ' will enter.');
this.emit(Navigator.VIEW_WILL_ENTER, {name, last, action, parameters});
await view.onWillEnter(last, action, parameters);
if (showLog) console.log(name + ' did enter.');
this.emit(Navigator.VIEW_DID_ENTER, {name, last, action, parameters});
view.onDidEnter(last, action, parameters);
}
/**
* 栈出实现
* @param name
* @param next
* @param action
* @param parameters
* @returns {Promise<void>}
*/
async onLeave(name: string, next: string, action: NavigatorAction, parameters: any) {
let view: INavigatorViewBase = this.getViewInstanceByName(name);
await view.onWillUnMount(name, action, parameters);
if (showLog) console.log(name + ' will leave.');
this.emit(Navigator.VIEW_WILL_LEAVE, {name, next, action, parameters});
await view.onWillLeave(next, action, parameters);
if (showLog) console.log(name + ' did leave.');
this.emit(Navigator.VIEW_DID_LEAVE, {name, next, action, parameters});
view.onDidLeave(next, action, parameters);
}
/**
* 当收到错误实现
* @param error
*/
onError(error: Error) {
}
}
{"ver":"1.0.1","uuid":"ea74b1a5-4d17-4b99-8e60-1e3b5aabf31b","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-04-09.
*
* 单场景导航器
*/
import {VirtualNavigator} from "./VirtualNavigator";
import {SceneStart, ScenePlay} from "../scenes";
import ScillaComponent from "components/base/ScillaComponent";
export default class SingleSceneNavigator extends ScillaComponent {
_navigator: VirtualNavigator;
onCreate() {
super.onCreate();
this._navigator = new VirtualNavigator(this.entity);
this._navigator.register('start', 'SceneStart', SceneStart);
this._navigator.register('play', 'ScenePlay', ScenePlay);
}
onAwake() {
super.onAwake();
this.push('start');
}
onUpdate(t) {
super.onUpdate(t);
}
onSleep() {
super.onSleep();
}
onDestroy() {
super.onDestroy();
}
push(name: string, parameters: any = null) {
this._navigator.stack.push(name, parameters);
}
pop(parameters: any = null) {
this._navigator.stack.pop(parameters);
}
popToBottom(parameters: any = null) {
this._navigator.stack.popTo(0, null, parameters);
}
popAll(name: string, parameters: any = null) {
this._navigator.stack.popAll(name, parameters);
}
replace(name: string, parameters: any = null) {
this._navigator.stack.replace(name, parameters);
}
jump(name: string, parameters: any = null) {
this._navigator.stack.jump(name, parameters);
}
}
{"ver":"1.0.1","uuid":"b9511adc-3aea-4f7e-a864-7dd8cd77f1ea","subMetas":{},"type":"script"}
/**
* Created by rocky.l on 2017/1/17.
*
* 堆栈导航器
*/
export module alien {
export enum NavigatorAction {Push, Pop, Replace, Jump}
export interface INavigatorDelegate {
onEnter(name: string, last: string, action: NavigatorAction, parameters: any);
onLeave(name: string, next: string, action: NavigatorAction, parameters: any);
onError(error: Error);
}
export class StackNavigator {
private _stack: string[];
private _delegate: INavigatorDelegate;
constructor(delegate: INavigatorDelegate) {
this._stack = [];
this._delegate = delegate;
}
private catchPromise(p: Promise<any>) {
if (p) {
p.catch((e => {
this._delegate.onError(e);
}))
}
}
push(name: string, parameters: any = null) {
let last: string = this.getTopSceneName();
if (last) {
if (last == name) {
return;
}
this.catchPromise(this._delegate.onLeave(last, name, NavigatorAction.Push, parameters));
}
this._stack.push(name);
this.catchPromise(this._delegate.onEnter(name, last, NavigatorAction.Push, parameters));
}
popTo(index, name?: string, parameters: any = null) {
if (this._stack.length > 0 && this._stack.length < (index + 1)) {
return;
}
let last: string = this.getTopSceneName();
this._stack.splice(Math.max(index + 1, 0));
let next: string = this._stack[index];
if (!next) {
this._stack.push(next = name);
}
if (last) {
this.catchPromise(this._delegate.onLeave(last, next, NavigatorAction.Pop, parameters));
}
this.catchPromise(this._delegate.onEnter(next, last, NavigatorAction.Pop, parameters));
}
pop(parameters: any = null) {
this.popTo(this._stack.length - 2, null, parameters);
}
popAll(name: string, parameters: any = null) {
this.popTo(-1, name, parameters);
}
replace(name: string, parameters: any = null) {
let last: string = this._stack.pop();
this._stack.push(name);
this.catchPromise(this._delegate.onLeave(last, name, NavigatorAction.Replace, parameters));
this.catchPromise(this._delegate.onEnter(name, last, NavigatorAction.Replace, parameters));
}
jump(name: string, parameters: any = null){
if(this._stack.length < 2){
this.push(name, parameters);
return;
}
let last:string = this._stack.pop();
this._stack.splice(1);
let next:string = name;
this._stack.push(next);
this._delegate.onLeave(last, next, NavigatorAction.Pop, parameters);
this._delegate.onEnter(next, last, NavigatorAction.Pop, parameters);
}
private getTopSceneName(): string {
return this._stack.length > 0 ? this._stack[this._stack.length - 1] : null;
}
private getBottomSceneName(): string {
return this._stack.length > 0 ? this._stack[0] : null;
}
}
}
{"ver":"1.0.1","uuid":"f5068160-2556-48f9-9e64-05ed06dd74d9","subMetas":{},"type":"script"}
/**
* Created by rocky.l on 2017/1/19.
*
* 场景导航器
*/
import {Entity, EventEmitter} from 'scilla'
import {alien} from "./StackNavigator";
import NavigatorAction = alien.NavigatorAction;
import INavigatorDelegate = alien.INavigatorDelegate;
import StackNavigator = alien.StackNavigator;
const showLog = false;
export const VIEW_WILL_ENTER: string = 'VIEW_WILL_ENTER';
export const VIEW_DID_ENTER: string = 'VIEW_DID_ENTER';
export const VIEW_WILL_LEAVE: string = 'VIEW_WILL_LEAVE';
export const VIEW_DID_LEAVE: string = 'VIEW_DID_LEAVE';
export interface INavigatorViewBase {
onWillMount(last: string, action: NavigatorAction, parameters: any): Promise<any>;
onWillUnMount(next: string, action: NavigatorAction, parameters: any): Promise<any>;
onWillEnter(last: string, action: NavigatorAction, parameters: any): Promise<any>;
onDidEnter(last: string, action: NavigatorAction, parameters: any): void;
onWillLeave(next: string, action: NavigatorAction, parameters: any): Promise<any>;
onDidLeave(next: string, action: NavigatorAction, parameters: any): void;
}
export class VirtualNavigator extends EventEmitter implements INavigatorDelegate {
stack: StackNavigator;
protected _currentName: string;
protected _currentView: INavigatorViewBase;
protected _classDic: any;
protected _container: Entity;
constructor(container) {
super();
this._container = container;
this._classDic = {};
this.stack = new StackNavigator(this);
}
register(alias: string, childName: string, componentDef): void {
this._classDic[alias] = {
childName,
componentDef,
};
}
get currentView(): INavigatorViewBase {
return this._currentView;
}
get currentName(): string {
return this._currentName;
}
protected getViewInstanceByName(name: string): INavigatorViewBase {
let {childName, componentDef,} = this._classDic[name];
let scene: Entity = this._container.getChildrenByName(childName)[0];
let component:any = scene.getComponent(componentDef);
return component;
}
/**
* 栈入实现
* @param name
* @param last
* @param action
* @param parameters
* @returns {Promise<void>}
*/
async onEnter(name: string, last: string, action: NavigatorAction, parameters: any) {
let view: INavigatorViewBase = this.getViewInstanceByName(name);
this._currentView = view;
this._currentName = name;
await view.onWillMount(last, action, parameters);
if (showLog) console.log(name + ' will enter.');
this.emit(VIEW_WILL_ENTER, {name, last, action, parameters});
await view.onWillEnter(last, action, parameters);
if (showLog) console.log(name + ' did enter.');
this.emit(VIEW_DID_ENTER, {name, last, action, parameters});
view.onDidEnter(last, action, parameters);
}
/**
* 栈出实现
* @param name
* @param next
* @param action
* @param parameters
* @returns {Promise<void>}
*/
async onLeave(name: string, next: string, action: NavigatorAction, parameters: any) {
let view: INavigatorViewBase = this.getViewInstanceByName(name);
await view.onWillUnMount(name, action, parameters);
if (showLog) console.log(name + ' will leave.');
this.emit(VIEW_WILL_LEAVE, {name, next, action, parameters});
await view.onWillLeave(next, action, parameters);
if (showLog) console.log(name + ' did leave.');
this.emit(VIEW_DID_LEAVE, {name, next, action, parameters});
view.onDidLeave(next, action, parameters);
}
/**
* 当收到错误实现
* @param error
*/
onError(error: Error) {
}
}
{"ver":"1.0.1","uuid":"aaca9542-45fc-4165-be5d-5f2f916b9238","subMetas":{},"type":"script"}
{"ver":"1.0.1","uuid":"e90aa5d8-5a22-41d4-9d77-b88512e27ab4","subMetas":{},"isGroup":true}
/**
* Created by hwj on 2018/11/22.
* 网络组件
*/
import {utils, engine} from "scilla";
/**
* 调用接口
* @param uri
* @param params
* @param method
* @param responseType
* @param ignoreSuccessField
*/
export function callApi(uri: string, params: any = null, method: string = 'post', responseType = 'json', ignoreSuccessField = false): Promise<any> {
let ts = Date.now() + Math.floor(Math.random() * 9999999);
let url = uri.startsWith('//') ? uri : `${engine.customConfig.webServiceUrl}${uri}?_=${ts}`;
params = params || {};
let options: any = {
method,
};
if (!DEBUG) {
options.credentials = 'include';
}
let temp = typeof params === 'string' ? params : utils.objectStringify(params);
switch (method.toUpperCase()) {
case 'GET':
if(temp && temp.length > 0){
url += (url.indexOf('?') < 0 ? '?' : '') + '&' + temp;
}
break;
case 'POST':
options.body = temp;
options.headers = {
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
};
break;
}
const fetchMethod = responseType == 'jsonp' ? window['fetchJsonp'] : fetch;
return fetchMethod(url, options)
.then((response) => {
if (response.type === 'opaque') {
return null;
}
return response.text();
})
.then((response) => {
//console.log('fetch ==>', url, response);
if (response) {
let data;
switch (responseType) {
case 'json':
try {
data = JSON.parse(response);
} catch (e) {
console.log('decode json failed: ' + url);
return Promise.reject({});
}
if (ignoreSuccessField || data.success) {
return {
data: data.hasOwnProperty('data') ? data.data : data,
origin: data,
};
} else {
return Promise.reject(data.code);
}
case 'html':
let html = null;//DOMParser.parseFromString(response, 'text/html');
return html;
case 'txt':
return response;
}
}
return Promise.reject();
})
}
/**
* 轮训请求
* @param successFunc
* @param maxTimes
* @param delay
* @param uri
* @param params
* @param abortFunc
* @param method
* @param responseType
*/
export async function polling(successFunc, uri, params, maxTimes = 10, delay = 500, abortFunc?: Function, method = 'POST', responseType = 'json'): Promise<any> {
let lastData;
/*let p = Promise.resolve();
for (let i = 0; i < maxTimes; i++) {
if(abortFunc){
p.then(
()=>{
if(abortFunc()){
return Promise.reject('abort');
//throw new Error('abort');
}
}, (e)=>{
return Promise.reject(e);
}
)
}
p = p.then(func);
p = p.then(() => {
return utils.waitPromise(delay)
})
}
return p.then(
() => {
return Promise.reject(null);
},
(e) => {
if (e === 'success') {
return Promise.resolve(lastData);
}
return Promise.reject(e);
}
);*/
let needBreak;
for (let i = 0; i < maxTimes; i++) {
await func().catch(e=>{
if (e === 'success') {
needBreak = true;
}else{
throw e;
}
});
if(needBreak){
break;
}
if(abortFunc()){
throw new Error('abort')
}
await utils.waitPromise(delay);
}
if(!needBreak){
throw new Error('timeout')
}
return lastData;
function func() {
return callApi(uri, params, method, responseType).then(
(data) => {
if (successFunc(data)) {
lastData = data;
return Promise.reject('success');
}
}
)
}
}
/**
* 获取token并发送
* @param uri
* @param params
* @param method
* @param responseType
*/
export async function getToken(uri: string, params: any, method: string = 'POST', responseType: string = 'json') {
if (window['getDuibaToken']) {
window['getDuibaToken'](async (tokenObj: any) => {
params.token = tokenObj.token;
await this.send(uri, params, method, responseType);
}, () => {
});
} else {
await this.send(uri, params, method, responseType);
}
}
// /**
// * 通讯底层错误
// */
// protected onError(key,msgObj): void {
// const msg = `${key}:${msgObj}`
// this.dispatchEvent('Error', msg );
// }
/**
* 生成签名
* @param {number} ticketId
* @param {number} score
* @param {any} gameData
* @param {string} submitToken 提交
* @returns {string} 签名
*/
export function createSgin(ticketId: number, score: number, gameData: any, submitToken: string): string {
return window['duiba_md5'](ticketId + '' + score + '' + gameData + '' + submitToken);
}
{"ver":"1.0.1","uuid":"562810f7-0883-4982-8649-d3e8d4856365","subMetas":{},"type":"script"}
{"ver":"1.0.1","uuid":"e95c77f9-046f-4811-9c33-5e4b825ddc0b","subMetas":{},"isGroup":true}
/**
* Created by rockyl on 2018-12-12.
*
* 对话框内容组件
*/
import ScillaComponent from "components/base/ScillaComponent";
import {fade, flew, none, zoom} from "./PopupEffect";
import {raw} from "scilla";
import {decorators} from "scilla";
import CustomButton from "../game/CustomButton";
const {dirtyFieldTrigger} = decorators;
export default class DialogContent extends ScillaComponent {
@dirtyFieldTrigger
effect: PopupEffect = PopupEffect.none;
showEffectOptions: raw;
hideEffectOptions: raw;
protected _closeButton: CustomButton;
effectImpl = none;
protected onModify(value, key, oldValue) {
super.onModify(value, key, oldValue);
if (key === 'effect') {
this.effectImpl = effects[value];
}
}
onAwake() {
super.onAwake();
if (!this._closeButton) {
const buttons = this.entity.getChildrenByName('CloseButton');
if (buttons.length > 0) {
this._closeButton = buttons[0].getComponent(CustomButton);
this._closeButton.onClick.addListener(this.onTapCloseButton, this);
}
}
}
protected onTapCloseButton() {
this.hide();
}
setup(data) {
}
show = (data?, callback?) => {
this.bubbling('showDialog', this.entity.name, data, callback);
}
hide = (action?) => {
this.bubbling('hideDialog', this.entity.name, action || 'close');
}
}
const effects = {
none,
fade,
flew,
zoom,
};
export enum PopupEffect {
none = 'none',
fade = 'fade',
flew = 'flew',
zoom = 'zoom',
}
{"ver":"1.0.1","uuid":"2657ed67-fc9d-48b4-9ffa-dc242e49f212","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2018-12-12.
*
* 弹层
*/
import DialogContent from "./DialogContent";
import RectRenderer from "components/renderer/RectRenderer";
import TouchInterrupt from "components/base/TouchInterrupt";
import Transform from "components/base/Transform";
import ScillaComponent from "components/base/ScillaComponent";
import {none} from "./PopupEffect";
import {createTween} from "scilla";
export default class Popup extends ScillaComponent {
blackLayerDuration = 300;
private _bgRenderer: RectRenderer;
private _touchInterrupt: TouchInterrupt;
private _dialogStack = [];
onAwake() {
super.onAwake();
this._touchInterrupt = this.getComponent(TouchInterrupt);
this._touchInterrupt.enabled = false;
const bgRenderer = this._bgRenderer = this.getComponent(RectRenderer);
bgRenderer.enabled = false;
}
onUpdate(t) {
super.onUpdate(t);
}
onSleep() {
super.onSleep();
}
onDestroy() {
super.onDestroy();
}
setBgVisible(visible) {
if(visible){
this._bgRenderer.enabled = true;
}
this._bgRenderer.alpha = visible ? 0 : 1;
createTween(this, this._bgRenderer, true)
.to({alpha: visible ? 1 : 0}, this.blackLayerDuration)
.call(()=>{
if(!visible){
this._bgRenderer.enabled = false;
}
});
}
getDialogInStack(name){
let result;
for(let dialog of this._dialogStack){
if(dialog.name === name){
result = dialog;
break;
}
}
return result;
}
private bringToTop(dialogConfig){
let index = this._dialogStack.indexOf(dialogConfig);
if(index >= 0){
this._dialogStack.splice(index, 1);
}
this._dialogStack.push(dialogConfig);
}
private delete(dialogConfig){
let index = this._dialogStack.indexOf(dialogConfig);
this._dialogStack.splice(index, 1);
}
async showDialog(name, data?, callback?) {
let dialogConfig = this.getDialogInStack(name);
let dialog = this.entity.getChildrenByName(name)[0];
if(!dialogConfig){
dialogConfig = {
name, data, callback, dialog
};
dialog.enabled = true;
}
this.bringToTop(dialogConfig);
const parent = dialog.parent;
parent.removeChild(dialog);
parent.addChildAt(dialog, parent.children.length);
this.setBgVisible(true);
this._touchInterrupt.enabled = true;
const content: DialogContent = dialog.getComponent(DialogContent);
content && content.setup(data);
const transform = dialog.getComponent(Transform);
const effect = content ? content.effectImpl : none;
const effectOptions = content ? content.showEffectOptions : null;
await effect.show(transform, effectOptions);
}
async hideDialog(name, action?: string, data?) {
let dialogConfig = this.getDialogInStack(name);
if(!dialogConfig){
return;
}
let dialog = this.entity.getChildrenByName(name)[0];
this.delete(dialogConfig);
if(this._dialogStack.length === 0){
this.setBgVisible(false);
this._touchInterrupt.enabled = false;
}
const transform = dialog.getComponent(Transform);
const content: DialogContent = dialog.getComponent(DialogContent);
const effect = content ? content.effectImpl : none;
const effectOptions = content ? content.hideEffectOptions : null;
await effect.hide(transform, effectOptions);
dialog.enabled = false;
if (dialogConfig.callback) {
dialogConfig.callback(action, data);
dialogConfig.callback = null;
}
}
hideAll(){
for(let dialog of this._dialogStack){
this.hideDialog(dialog.name);
}
}
}
{"ver":"1.0.1","uuid":"403a3aeb-aa5d-4957-8be4-1ab61fd1b4aa","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-05-15.
*/
import Transform from "components/base/Transform";
import {createTween, ease, engine} from "scilla";
function bearingsToOutPos(bearings) {
const {width, height} = engine.renderContext.stageSize;
let x, y;
switch (bearings) {
case 'south':
x = 0;
y = height / 2;
break;
case 'west':
x = -width / 2;
y = 0;
break;
case 'east':
x = width / 2;
y = 0;
break;
case 'north':
default:
x = 0;
y = -height / 2;
}
return {
x, y,
}
}
export const none = {
show(transform: Transform, options?) {
transform.position.setXY(0, 0);
return Promise.resolve();
},
hide(transform: Transform, options?) {
transform.position.setXY(engine.renderContext.stageSize.width, 0);
return Promise.resolve();
}
};
export const fade = {
show(transform: Transform, options?: { bearings?: string, duration?: number, easeFunc?: Function }) {
options = options || {};
transform.alpha = 0;
const toProps: any = {
alpha: 1,
};
return new Promise(resolve => {
createTween(transform, transform)
.to(toProps, options.duration || 300, options.easeFunc)
.call(resolve);
})
},
hide(transform: Transform, options?: { bearings?: string, duration?: number, easeFunc?: Function }) {
options = options || {};
const toProps: any = {
alpha: 0,
};
return new Promise(resolve => {
createTween(transform, transform)
.to(toProps, options.duration || 200, options.easeFunc)
.call(resolve);
});
}
};
export const flew = {
show(transform: Transform, options?: { bearings?: string, withFade?: boolean, duration?: number, easeFunc?: Function }) {
options = options || {};
let outPos = bearingsToOutPos(options.bearings);
transform.position.copyFrom(outPos);
const toProps: any = {
position: {x: 0, y: 0,},
};
const withFade = options.hasOwnProperty('withFade') ? options.withFade : false;
if (withFade) {
transform.alpha = 0;
toProps.alpha = 1;
}
return new Promise(resolve => {
createTween(transform, transform)
.to(toProps, options.duration || 300, options.easeFunc || ease.backOut)
.call(resolve);
})
},
hide(transform: Transform, options?: { bearings?: string, withFade?: boolean, duration?: number, easeFunc?: Function }) {
options = options || {};
let outPos = bearingsToOutPos(options.bearings);
const toProps: any = {
position: outPos,
};
const withFade = options.hasOwnProperty('withFade') ? options.withFade : false;
if (withFade) {
toProps.alpha = 0;
}
return new Promise(resolve => {
createTween(transform, transform)
.to(toProps, options.duration || 200, options.easeFunc || ease.backIn)
.call(resolve);
});
}
};
export const zoom = {
show(transform: Transform, options?: { bearings?: string, withFade?: boolean, duration?: number, easeFunc?: Function }) {
options = options || {};
transform.scale.setXY(0, 0);
const toProps: any = {
scale: {x: 1, y: 1,},
};
const withFade = options.hasOwnProperty('withFade') ? options.withFade : false;
if (withFade) {
transform.alpha = 0;
toProps.alpha = 1;
}
return new Promise(resolve => {
createTween(transform, transform)
.to(toProps, options.duration || 300, options.easeFunc || ease.backOut)
.call(resolve);
})
},
hide(transform: Transform, options?: { bearings?: string, withFade?: boolean, duration?: number, easeFunc?: Function }) {
options = options || {};
const toProps: any = {
scale: {x: 0, y: 0},
};
const withFade = options.hasOwnProperty('withFade') ? options.withFade : false;
if (withFade) {
toProps.alpha = 0;
}
return new Promise(resolve => {
createTween(transform, transform)
.to(toProps, options.duration || 200, options.easeFunc || ease.backIn)
.call(resolve);
});
}
};
{"ver":"1.0.1","uuid":"6c4d99c9-7dcf-4613-bd93-e4e49b8de177","subMetas":{},"type":"script"}
{"ver":"1.0.1","uuid":"45ed64c9-54a3-4905-8dcb-04ac571c4f07","subMetas":{},"isGroup":true}
/**
* Created by rockyl on 2019-04-09.
*/
import {INavigatorViewBase} from "../navigator/VirtualNavigator";
import {alien} from "../navigator/StackNavigator";
import {Entity, engine} from "scilla";
import {playAnimation} from "../animation-utils";
import Puzzle from "../game/Puzzle";
import ScillaComponent from "components/base/ScillaComponent";
const animationConfig = {
enter: {
/*BackButton: {
'components/other/RelativeLayout': {params: {top: 10,}, duration: 500, ease: 'cubicOut'},
},
ResetButton: {
'components/other/RelativeLayout': {params: {bottom: 100,}, duration: 500, ease: 'cubicOut'},
},
Puzzle: {
'components/base/Transform': {params: {alpha: 1,}, duration: 500, ease: 'cubicOut'},
},*/
},
leave: {
/*BackButton: {
'components/other/RelativeLayout': {params: {top: -60,}, duration: 500, ease: 'cubicOut'},
},
ResetButton: {
'components/other/RelativeLayout': {params: {bottom: -90,}, duration: 500, ease: 'cubicOut'},
},
Puzzle: {
'components/base/Transform': {params: {alpha: 0,}, duration: 500, ease: 'cubicOut'},
},*/
},
};
export default class ScenePlay extends ScillaComponent implements INavigatorViewBase {
BackButton: Entity;
ResetButton: Entity;
Puzzle: Entity;
_puzzle: Puzzle;
_level: number = 3;
_img: any;
onAwake() {
super.onAwake();
//this._puzzle = this.Puzzle.getComponent(Puzzle);
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
//this.reset();
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
await playAnimation(animationConfig.enter, this);
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
await playAnimation(animationConfig.leave, this);
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
async reset() {
let id = 1;
let url = `singles/${id}.jpg`;
this._img = await engine.assetsManager.loadImage(url);
this.startLevel();
}
nextLevel() {
this._level++;
this.startLevel();
}
startLevel() {
this._puzzle.start(this._img, this._level);
}
}
{"ver":"1.0.1","uuid":"511bb8db-5e80-4646-9205-c9fa93f120c3","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-04-09.
*/
import {INavigatorViewBase} from "../navigator/VirtualNavigator";
import {alien} from "../navigator/StackNavigator";
import {Entity, resource, instantiate} from "scilla";
import {playAnimation} from "../animation-utils";
import ScillaComponent from "components/base/ScillaComponent";
const animationConfig = {
enter: {
/*RuleButton: {
'components/other/RelativeLayout': {params: {left: 10,}, duration: 500, ease: 'cubicOut'},
},
PrizeButton: {
'components/other/RelativeLayout': {params: {right: 10,}, duration: 500, ease: 'cubicOut'},
},
StartButton: {
'components/other/RelativeLayout': {params: {bottom: 200,}, duration: 500, ease: 'cubicOut'},
},*/
},
leave: {
/*RuleButton: {
'components/other/RelativeLayout': {params: {left: -100,}, duration: 500, ease: 'cubicOut'},
},
PrizeButton: {
'components/other/RelativeLayout': {params: {right: -100,}, duration: 500, ease: 'cubicOut'},
},
StartButton: {
'components/other/RelativeLayout': {params: {bottom: -90,}, duration: 500, ease: 'cubicOut'},
},*/
},
};
export default class SceneStart extends ScillaComponent implements INavigatorViewBase{
/*RuleButton: Entity;
PrizeButton: Entity;
StartButton: Entity;*/
onAwake() {
super.onAwake();
}
showRuleDialog(){
this.bubbling('showDialog', 'Rule');
}
onDidEnter(last: string, action: alien.NavigatorAction, parameters: any): void {
}
onDidLeave(next: string, action: alien.NavigatorAction, parameters: any): void {
}
async onWillEnter(last: string, action: alien.NavigatorAction, parameters: any) {
await playAnimation(animationConfig.enter, this);
}
async onWillLeave(next: string, action: alien.NavigatorAction, parameters: any) {
await playAnimation(animationConfig.leave, this);
}
onWillMount(last: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
onWillUnMount(next: string, action: alien.NavigatorAction, parameters: any): Promise<any> {
return undefined;
}
}
{"ver":"1.0.1","uuid":"6bd4a810-2792-482e-a03a-5caa2506781c","subMetas":{},"type":"script"}
/**
* Created by rockyl on 2019-04-09.
*/
export {default as SceneStart} from "./SceneStart";
export {default as ScenePlay} from "./ScenePlay";
{"ver":"1.0.1","uuid":"58b64019-1aee-4bb2-81f9-d964e2f1bfaa","subMetas":{},"type":"script"}
{"ver":"1.0.1","uuid":"7cc0c22c-1f18-4b6f-a031-4bcfad60919a","subMetas":{},"isGroup":true}
{"ver":"1.0.1","uuid":"19a96339-3de9-45cc-af1f-61b477d2a021","subMetas":{"1.png":{"ver":"1.0.1","uuid":"b440ea70-ce5c-46f6-adad-1e900aac9f9b","rawTextureUuid":"19a96339-3de9-45cc-af1f-61b477d2a021","type":"texture"},"2.png":{"ver":"1.0.1","uuid":"58011c9c-770a-4968-89ca-c2ff434ebc33","rawTextureUuid":"19a96339-3de9-45cc-af1f-61b477d2a021","type":"texture"},"3.png":{"ver":"1.0.1","uuid":"14fa8b21-f6b6-421f-af53-fbd809e82924","rawTextureUuid":"19a96339-3de9-45cc-af1f-61b477d2a021","type":"texture"},"4.png":{"ver":"1.0.1","uuid":"6a8d2e30-b972-41f7-8a05-b8540edcfec8","rawTextureUuid":"19a96339-3de9-45cc-af1f-61b477d2a021","type":"texture"},"5.png":{"ver":"1.0.1","uuid":"f87f9235-171c-43fa-bc61-2e9af0540d95","rawTextureUuid":"19a96339-3de9-45cc-af1f-61b477d2a021","type":"texture"}},"type":"sheet"}
{"ver":"1.0.1","uuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","subMetas":{"avatar/0.png":{"ver":"1.0.1","uuid":"8a1e0b9b-ba63-4372-b501-2e889f5bad47","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"avatar/1.png":{"ver":"1.0.1","uuid":"930360e0-678a-4841-b270-601015bfeeb2","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"avatar/bg-waiting.png":{"ver":"1.0.1","uuid":"f24ac227-d97f-4d92-9889-335dafe70113","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"avatar/bg.png":{"ver":"1.0.1","uuid":"5e237c4d-3ab1-4f89-992a-b6acf62bdf44","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"avatar/other.png":{"ver":"1.0.1","uuid":"e2afcb73-9a26-424b-8fea-a9ccb141b1f8","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"bg/1.png":{"ver":"1.0.1","uuid":"c015cba9-f6f9-4109-b216-7048c5416a3a","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"btn/close.png":{"ver":"1.0.1","uuid":"38716214-eee0-4d8d-8029-72d8de2b18b0","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"color-tape.png":{"ver":"1.0.1","uuid":"f8b9cb7e-331c-405e-9ecf-b33b4752cedc","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"light/1.png":{"ver":"1.0.1","uuid":"ce56139c-4e6f-4e09-8e8e-7653c769f137","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"result/avatar-0.png":{"ver":"1.0.1","uuid":"9c710b9c-bf50-4054-9503-a90e124b5ab3","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"result/avatar-1.png":{"ver":"1.0.1","uuid":"173f95ce-e5ef-47ad-8d2c-284bf1bcc60a","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"result/line.png":{"ver":"1.0.1","uuid":"eb4eb4a2-ac5b-4a1f-a876-11e48f224b73","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"star/4.png":{"ver":"1.0.1","uuid":"ba313154-8f11-44ad-8593-d486ff5d5bea","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"text/congratulations.png":{"ver":"1.0.1","uuid":"9851843c-186a-453c-a838-e431773574c7","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"times-card.png":{"ver":"1.0.1","uuid":"6532dcec-e4a5-4630-90a4-5b8518a856fc","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"light/0.png":{"ver":"1.0.1","uuid":"c73ad06f-6ddb-4677-959f-00c6886a4dc5","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"pk/equal.png":{"ver":"1.0.1","uuid":"0fcfdb84-b8e1-44f9-8f41-d003560f1c71","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"pk/line.png":{"ver":"1.0.1","uuid":"2b4e2f1c-8d2d-4c71-8c80-212f5b299d3d","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"pk/name-bg.png":{"ver":"1.0.1","uuid":"c66bbfdb-b28e-41a5-ac21-a887642655cd","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"pk/left-lose.png":{"ver":"1.0.1","uuid":"c2281767-8b16-408e-a0e9-6b826c859c82","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"pk/left-win.png":{"ver":"1.0.1","uuid":"f5641e45-0dff-4eef-989a-254bf6545fe3","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"pk/right-lose.png":{"ver":"1.0.1","uuid":"cd4eb6ca-3c1c-4ad7-a183-f18b48d252f4","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"pk/right-win.png":{"ver":"1.0.1","uuid":"fabb2a67-7285-4f31-a54e-1cfb9ddea49d","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"pk/left-body-lose.png":{"ver":"1.0.1","uuid":"74561a9a-d546-4ac8-8fbf-ad711896ef1b","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"pk/left-body-win.png":{"ver":"1.0.1","uuid":"5cfa694d-325a-48cd-b840-9ddddac7d7b1","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"pk/right-body-lose.png":{"ver":"1.0.1","uuid":"dd28d496-2e82-4723-8478-c1ccd8972188","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"pk/right-body-win.png":{"ver":"1.0.1","uuid":"1d7921f9-363c-4d81-bd46-c340d02e03d5","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"light/2.png":{"ver":"1.0.1","uuid":"fcfe479f-abc7-4e84-b279-0bcaf40c53b1","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"star/0.png":{"ver":"1.0.1","uuid":"2024cac4-f424-40b5-a6eb-e8063cde3530","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"star/1.png":{"ver":"1.0.1","uuid":"68f56ec4-c1d4-4530-90bc-8e41d41495f4","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"star/2.png":{"ver":"1.0.1","uuid":"fe8ccd49-18d0-4ee9-a78d-9ec6edd7ccc2","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"star/3.png":{"ver":"1.0.1","uuid":"ec74403c-0230-47d2-bedc-0ea25ee6d541","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"},"result/name-bg.png":{"ver":"1.0.1","uuid":"c44141c9-eed0-4a25-b5ff-b21bb6739a35","rawTextureUuid":"59bb6746-81b2-4adf-bdfc-3083fcd57446","type":"texture"}},"type":"sheet"}
{"ver":"1.0.1","uuid":"b17680ba-32ac-49fd-8441-efe19765265b","subMetas":{"hole.png":{"ver":"1.0.1","uuid":"933c5bc7-aa8e-43ff-9910-10b67ff910e9","rawTextureUuid":"b17680ba-32ac-49fd-8441-efe19765265b","type":"texture"},"icon-credits.png":{"ver":"1.0.1","uuid":"e9bcb67a-0626-4849-aaf5-33d1728c145e","rawTextureUuid":"b17680ba-32ac-49fd-8441-efe19765265b","type":"texture"},"target-item.png":{"ver":"1.0.1","uuid":"0af7c70e-2e83-4ae8-aaa0-78a6f0feb02f","rawTextureUuid":"b17680ba-32ac-49fd-8441-efe19765265b","type":"texture"},"btn-rule.png":{"ver":"1.0.1","uuid":"42670a96-737a-4456-b118-42b617cfa449","rawTextureUuid":"b17680ba-32ac-49fd-8441-efe19765265b","type":"texture"},"hole-bottom.png":{"ver":"1.0.1","uuid":"e0953ca5-665b-400d-9eec-7c6d8887c15a","rawTextureUuid":"b17680ba-32ac-49fd-8441-efe19765265b","type":"texture"}},"type":"sheet"}
{"ver":"1.0.1","uuid":"67a77d02-04c0-4cfd-8c2d-f5f411b928df","subMetas":{},"isGroup":true}
{"ver":"1.0.1","uuid":"2eb50e69-818d-4afd-b466-15a6f345f26c","subMetas":{"bg":{"ver":"1.0.1","uuid":"6b67c1bc-e662-4730-946b-00a8cba8a782","rawTextureUuid":"2eb50e69-818d-4afd-b466-15a6f345f26c","type":"texture"}},"type":"texture","imagePath":"/Users/rockyl/WorkSpaces/scilla/samples/super-miner/assets/singles/bg.jpg"}
{"ver":"1.0.1","uuid":"a96e14dd-2d79-4b14-a02a-45a540b3a709","subMetas":{"btn-start-dig-disabled":{"ver":"1.0.1","uuid":"d167832b-6f20-4aa5-8b07-6861158dc56c","rawTextureUuid":"a96e14dd-2d79-4b14-a02a-45a540b3a709","type":"texture"}},"type":"texture","imagePath":"/Users/rockyl/WorkSpaces/scilla/samples/super-miner/assets/singles/btn-start-dig-disabled.png"}
{"ver":"1.0.1","uuid":"c72f820e-f021-45b3-b0ce-22e03699c627","subMetas":{"btn-start-dig":{"ver":"1.0.1","uuid":"2ce67a38-368b-4841-9e57-aea1d3536f3f","rawTextureUuid":"c72f820e-f021-45b3-b0ce-22e03699c627","type":"texture"}},"type":"texture","imagePath":"/Users/rockyl/WorkSpaces/scilla/samples/super-miner/assets/singles/btn-start-dig.png"}
{"ver":"1.0.1","uuid":"572df845-76bd-45cd-98e9-9bf7f88f2c64","subMetas":{"btn-start-pk-disabled":{"ver":"1.0.1","uuid":"99758758-5ae9-4bb4-9613-4446045756bd","rawTextureUuid":"572df845-76bd-45cd-98e9-9bf7f88f2c64","type":"texture"}},"type":"texture","imagePath":"/Users/rockyl/WorkSpaces/scilla/samples/super-miner/assets/singles/btn-start-pk-disabled.png"}
{"ver":"1.0.1","uuid":"c7844460-15f0-4b20-bb5a-a19c3d36c853","subMetas":{"btn-start-pk":{"ver":"1.0.1","uuid":"7667e218-cd45-42c9-acdf-57f364d839c8","rawTextureUuid":"c7844460-15f0-4b20-bb5a-a19c3d36c853","type":"texture"}},"type":"texture","imagePath":"/Users/rockyl/WorkSpaces/scilla/samples/super-miner/assets/singles/btn-start-pk.png"}
{"ver":"1.0.1","uuid":"961eb7ec-a6cd-4f9a-a5e1-51b1255f705a","subMetas":{"red":{"ver":"1.0.1","uuid":"c045f8ab-50ca-4679-a538-76959405fdaa","rawTextureUuid":"961eb7ec-a6cd-4f9a-a5e1-51b1255f705a","type":"texture"}},"type":"texture","imagePath":"/Users/rockyl/WorkSpaces/scilla/samples/super-miner/assets/singles/red.png"}
{"ver":"1.0.1","uuid":"96aa9ef2-822a-46a6-abfd-aa8590f408ea","subMetas":{"0":{"ver":"1.0.1","uuid":"8d27aabc-4723-4584-9da8-8971e15c2d18","rawTextureUuid":"96aa9ef2-822a-46a6-abfd-aa8590f408ea","type":"texture"}},"type":"texture","imagePath":"/Users/rockyl/WorkSpaces/scilla/samples/super-miner/assets/sheets/bg/0.png"}
{"ver":"1.0.1","uuid":"ccec8e2c-112c-48e1-8800-b4d447540012","subMetas":{"left":{"ver":"1.0.1","uuid":"95012ccf-47a9-468d-92bf-d1b400f1a5d8","rawTextureUuid":"ccec8e2c-112c-48e1-8800-b4d447540012","type":"texture"}},"type":"texture","imagePath":"/Users/rockyl/WorkSpaces/scilla/samples/super-miner/assets/singles/pk/left.png"}
{"ver":"1.0.1","uuid":"1e6c8747-9713-47cc-a5b7-161f1ea272ae","subMetas":{"right":{"ver":"1.0.1","uuid":"09312ab5-bd23-46e2-9e42-644b7c9743a4","rawTextureUuid":"1e6c8747-9713-47cc-a5b7-161f1ea272ae","type":"texture"}},"type":"texture","imagePath":"/Users/rockyl/WorkSpaces/scilla/samples/super-miner/assets/singles/pk/right.png"}
{"mc":{
"coin":{
"frameRate":24,
"events":[
],
"frames":[
{
"res":"13497B6D",
"x":-45,
"y":-47
},
{
"res":"87CF8D85",
"x":-44,
"y":-47
},
{
"res":"2CDD23F0",
"x":-36,
"y":-47
},
{
"res":"D4BE6F6D",
"x":-23,
"y":-47
},
{
"res":"ECEC9D8A",
"x":-8,
"y":-47
},
{
"res":"4BC78864",
"x":-25,
"y":-47
},
{
"res":"F2156B7D",
"x":-38,
"y":-47
},
{
"res":"61BC53A",
"x":-45,
"y":-47
}
]
}},
"res":{
"61BC53A":{"x":0,"y":0,"w":93,"h":94},
"F2156B7D":{"x":95,"y":96,"w":78,"h":94},
"4BC78864":{"x":190,"y":0,"w":53,"h":94},
"13497B6D":{"x":95,"y":0,"w":93,"h":94},
"D4BE6F6D":{"x":0,"y":192,"w":53,"h":94},
"ECEC9D8A":{"x":55,"y":192,"w":20,"h":94},
"87CF8D85":{"x":0,"y":96,"w":93,"h":94},
"2CDD23F0":{"x":175,"y":96,"w":78,"h":94}
}}
\ No newline at end of file
{"mc":{
"blue":{
"frameRate":24,
"labels":[
{"name":"idle","frame":1,"end":30}
,{"name":"walk","frame":31,"end":54}
,{"name":"beginDig","frame":55,"end":65}
,{"name":"dig","frame":66,"end":78}
],
"events":[
],
"frames":[
{
"res":"5189086A",
"x":-57,
"y":-142
},
{
"res":"97242FCF",
"x":-57,
"y":-142
},
{
"res":"C49F43C1",
"x":-57,
"y":-142
},
{
"res":"D4F651E",
"x":-57,
"y":-142
},
{
"res":"1A704625",
"x":-57,
"y":-142
},
{
"res":"E01F0539",
"x":-57,
"y":-142
},
{
"res":"6D4869FF",
"x":-57,
"y":-142
},
{
"res":"945F4F46",
"x":-57,
"y":-142
},
{
"res":"4BF9DE6C",
"x":-57,
"y":-142
},
{
"res":"873FC56F",
"x":-57,
"y":-141
},
{
"res":"68F36F0E",
"x":-57,
"y":-141
},
{
"res":"D73D4742",
"x":-57,
"y":-141
},
{
"res":"288836AB",
"x":-57,
"y":-141
},
{
"res":"FE343B90",
"x":-57,
"y":-141
},
{
"res":"5043FDD3",
"x":-57,
"y":-141
},
{
"res":"EEC3DB85",
"x":-57,
"y":-141
},
{
"res":"5043FDD3",
"x":-57,
"y":-141
},
{
"res":"FE343B90",
"x":-57,
"y":-141
},
{
"res":"288836AB",
"x":-57,
"y":-141
},
{
"res":"D73D4742",
"x":-57,
"y":-141
},
{
"res":"68F36F0E",
"x":-57,
"y":-141
},
{
"res":"873FC56F",
"x":-57,
"y":-141
},
{
"res":"4BF9DE6C",
"x":-57,
"y":-142
},
{
"res":"945F4F46",
"x":-57,
"y":-142
},
{
"res":"6D4869FF",
"x":-57,
"y":-142
},
{
"res":"E01F0539",
"x":-57,
"y":-142
},
{
"res":"1A704625",
"x":-57,
"y":-142
},
{
"res":"D4F651E",
"x":-57,
"y":-142
},
{
"res":"C49F43C1",
"x":-57,
"y":-142
},
{
"res":"97242FCF",
"x":-57,
"y":-142
},
{
"res":"5DAA66FC",
"x":-57,
"y":-141
},
{
"res":"4DA31000",
"x":-57,
"y":-141
},
{
"res":"3CCA7F82",
"x":-57,
"y":-140
},
{
"res":"84B64357",
"x":-57,
"y":-140
},
{
"res":"6965B1B1",
"x":-57,
"y":-140
},
{
"res":"2D3CF7FB",
"x":-57,
"y":-140
},
{
"res":"AC70A367",
"x":-57,
"y":-139
},
{
"res":"8863AA2F",
"x":-57,
"y":-140
},
{
"res":"B65D47FB",
"x":-57,
"y":-140
},
{
"res":"17CEEA90",
"x":-57,
"y":-140
},
{
"res":"80713019",
"x":-57,
"y":-140
},
{
"res":"33238AA0",
"x":-57,
"y":-141
},
{
"res":"597B6520",
"x":-57,
"y":-141
},
{
"res":"B31A737B",
"x":-57,
"y":-141
},
{
"res":"8C4FE4E7",
"x":-57,
"y":-140
},
{
"res":"F9C19F52",
"x":-57,
"y":-140
},
{
"res":"C6C03213",
"x":-57,
"y":-140
},
{
"res":"FF992765",
"x":-57,
"y":-140
},
{
"res":"6ADCE5C0",
"x":-57,
"y":-139
},
{
"res":"1F627544",
"x":-57,
"y":-140
},
{
"res":"F5EAF507",
"x":-57,
"y":-140
},
{
"res":"1C2358D2",
"x":-57,
"y":-140
},
{
"res":"798C5805",
"x":-57,
"y":-140
},
{
"res":"30D91BED",
"x":-57,
"y":-141
},
{
"res":"1156A8F5",
"x":-57,
"y":-142
},
{
"res":"926BD52A",
"x":-57,
"y":-142
},
{
"res":"E5BB3541",
"x":-56,
"y":-141
},
{
"res":"8A64AD32",
"x":-57,
"y":-141
},
{
"res":"7173FABB",
"x":-60,
"y":-139
},
{
"res":"B4AC9FF4",
"x":-61,
"y":-138
},
{
"res":"221D4229",
"x":-61,
"y":-138
},
{
"res":"D88C2899",
"x":-60,
"y":-139
},
{
"res":"393A813D",
"x":-58,
"y":-140
},
{
"res":"1A0661BB",
"x":-55,
"y":-141
},
{
"res":"48858E9E",
"x":-57,
"y":-142
},
{
"res":"D57430D6",
"x":-57,
"y":-142
},
{
"res":"E4922D64",
"x":-57,
"y":-142
},
{
"res":"75ADD420",
"x":-56,
"y":-142
},
{
"res":"776BA669",
"x":-56,
"y":-141
},
{
"res":"83A2612F",
"x":-59,
"y":-140
},
{
"res":"2F2D4668",
"x":-61,
"y":-138
},
{
"res":"47998D86",
"x":-62,
"y":-138
},
{
"res":"944F2C72",
"x":-61,
"y":-139
},
{
"res":"48431A33",
"x":-58,
"y":-140
},
{
"res":"69F33EBA",
"x":-55,
"y":-141
},
{
"res":"16C2B2CB",
"x":-56,
"y":-142
},
{
"res":"8E12B400",
"x":-57,
"y":-142
},
{
"res":"78C90DA2",
"x":-57,
"y":-142
}
]
},"red":{
"frameRate":24,
"labels":[
{"name":"idle","frame":1,"end":30}
,{"name":"walk","frame":31,"end":54}
,{"name":"beginDig","frame":55,"end":65}
,{"name":"dig","frame":66,"end":77}
],
"events":[
],
"frames":[
{
"res":"A5E5DE06",
"x":-58,
"y":-145
},
{
"res":"8A029FC9",
"x":-58,
"y":-145
},
{
"res":"536B9DEC",
"x":-58,
"y":-145
},
{
"res":"E3C467C9",
"x":-58,
"y":-145
},
{
"res":"EB803920",
"x":-58,
"y":-145
},
{
"res":"1286BA8",
"x":-58,
"y":-145
},
{
"res":"7FD0F34F",
"x":-58,
"y":-145
},
{
"res":"4F82E49C",
"x":-58,
"y":-145
},
{
"res":"113B9138",
"x":-58,
"y":-145
},
{
"res":"9B5D1403",
"x":-58,
"y":-144
},
{
"res":"98C60BE8",
"x":-58,
"y":-144
},
{
"res":"69056F0D",
"x":-58,
"y":-144
},
{
"res":"B7734038",
"x":-58,
"y":-144
},
{
"res":"9EF29EE5",
"x":-58,
"y":-144
},
{
"res":"867C9CFF",
"x":-58,
"y":-144
},
{
"res":"9AF35C49",
"x":-58,
"y":-144
},
{
"res":"867C9CFF",
"x":-58,
"y":-144
},
{
"res":"9EF29EE5",
"x":-58,
"y":-144
},
{
"res":"B7734038",
"x":-58,
"y":-144
},
{
"res":"69056F0D",
"x":-58,
"y":-144
},
{
"res":"98C60BE8",
"x":-58,
"y":-144
},
{
"res":"9B5D1403",
"x":-58,
"y":-144
},
{
"res":"113B9138",
"x":-58,
"y":-145
},
{
"res":"4F82E49C",
"x":-58,
"y":-145
},
{
"res":"7FD0F34F",
"x":-58,
"y":-145
},
{
"res":"1286BA8",
"x":-58,
"y":-145
},
{
"res":"EB803920",
"x":-58,
"y":-145
},
{
"res":"E3C467C9",
"x":-58,
"y":-145
},
{
"res":"536B9DEC",
"x":-58,
"y":-145
},
{
"res":"8A029FC9",
"x":-58,
"y":-145
},
{
"res":"9A7FD271",
"x":-58,
"y":-144
},
{
"res":"81004BE2",
"x":-58,
"y":-144
},
{
"res":"43FFED26",
"x":-58,
"y":-143
},
{
"res":"A49968F",
"x":-58,
"y":-143
},
{
"res":"A23EA3F1",
"x":-58,
"y":-143
},
{
"res":"AECD8378",
"x":-58,
"y":-143
},
{
"res":"A8218D09",
"x":-58,
"y":-142
},
{
"res":"6BF31364",
"x":-58,
"y":-143
},
{
"res":"DF31C02",
"x":-58,
"y":-143
},
{
"res":"57006AC",
"x":-58,
"y":-143
},
{
"res":"D5DD0D09",
"x":-58,
"y":-143
},
{
"res":"1CF61B99",
"x":-58,
"y":-144
},
{
"res":"EEF34788",
"x":-58,
"y":-144
},
{
"res":"FA773A99",
"x":-58,
"y":-144
},
{
"res":"5A53E1DE",
"x":-58,
"y":-143
},
{
"res":"E261FEDE",
"x":-58,
"y":-143
},
{
"res":"580F8397",
"x":-58,
"y":-143
},
{
"res":"3444D97E",
"x":-58,
"y":-143
},
{
"res":"76F33075",
"x":-58,
"y":-142
},
{
"res":"1482B669",
"x":-58,
"y":-143
},
{
"res":"6C821542",
"x":-58,
"y":-143
},
{
"res":"5082DA1",
"x":-58,
"y":-143
},
{
"res":"A0576612",
"x":-58,
"y":-143
},
{
"res":"DEA2FF5B",
"x":-58,
"y":-144
},
{
"res":"7EE02AE5",
"x":-58,
"y":-145
},
{
"res":"F357F2C0",
"x":-57,
"y":-145
},
{
"res":"8D59120B",
"x":-56,
"y":-145
},
{
"res":"7F537E4",
"x":-57,
"y":-144
},
{
"res":"B5C88679",
"x":-60,
"y":-143
},
{
"res":"3431B2DB",
"x":-61,
"y":-142
},
{
"res":"A54480C9",
"x":-62,
"y":-141
},
{
"res":"BCF94871",
"x":-61,
"y":-142
},
{
"res":"E30B8A4E",
"x":-58,
"y":-144
},
{
"res":"2063C1AB",
"x":-56,
"y":-144
},
{
"res":"465BF7C3",
"x":-57,
"y":-145
},
{
"res":"E328CE1A",
"x":-58,
"y":-145
},
{
"res":"1D69CBDD",
"x":-58,
"y":-145
},
{
"res":"735FE0A6",
"x":-57,
"y":-145
},
{
"res":"72F137C8",
"x":-56,
"y":-144
},
{
"res":"D5BEB784",
"x":-59,
"y":-143
},
{
"res":"C32AABEC",
"x":-61,
"y":-142
},
{
"res":"46C6BBE2",
"x":-62,
"y":-141
},
{
"res":"BF370FC1",
"x":-61,
"y":-142
},
{
"res":"375409DB",
"x":-59,
"y":-143
},
{
"res":"3AD0679C",
"x":-55,
"y":-144
},
{
"res":"BE6C45E4",
"x":-57,
"y":-145
},
{
"res":"C4DDB608",
"x":-58,
"y":-145
}
]
}},
"res":{
"80713019":{"x":626,"y":470,"w":121,"h":152},
"EEC3DB85":{"x":794,"y":941,"w":100,"h":153},
"7173FABB":{"x":1616,"y":154,"w":132,"h":151},
"EB803920":{"x":581,"y":935,"w":98,"h":157},
"4DA31000":{"x":638,"y":315,"w":124,"h":153},
"72F137C8":{"x":917,"y":467,"w":120,"h":156},
"5DAA66FC":{"x":1170,"y":463,"w":123,"h":153},
"8A64AD32":{"x":0,"y":156,"w":128,"h":153},
"2063C1AB":{"x":242,"y":624,"w":114,"h":156},
"4BF9DE6C":{"x":681,"y":1089,"w":98,"h":154},
"A5E5DE06":{"x":1578,"y":941,"w":97,"h":157},
"43FFED26":{"x":1474,"y":304,"w":125,"h":155},
"597B6520":{"x":493,"y":622,"w":117,"h":153},
"1482B669":{"x":0,"y":626,"w":114,"h":155},
"F357F2C0":{"x":666,"y":156,"w":124,"h":157},
"9AF35C49":{"x":1624,"y":783,"w":100,"h":156},
"68F36F0E":{"x":1411,"y":1086,"w":99,"h":153},
"8E12B400":{"x":405,"y":1095,"w":98,"h":154},
"D88C2899":{"x":1213,"y":0,"w":134,"h":151},
"5082DA1":{"x":764,"y":469,"w":119,"h":155},
"B31A737B":{"x":612,"y":624,"w":116,"h":153},
"81004BE2":{"x":1176,"y":305,"w":124,"h":156},
"1A0661BB":{"x":1918,"y":627,"w":114,"h":153},
"798C5805":{"x":1801,"y":472,"w":120,"h":152},
"69F33EBA":{"x":374,"y":622,"w":117,"h":153},
"B5C88679":{"x":811,"y":0,"w":131,"h":155},
"1D69CBDD":{"x":805,"y":782,"w":100,"h":157},
"8D59120B":{"x":539,"y":155,"w":125,"h":157},
"113B9138":{"x":1477,"y":927,"w":99,"h":157},
"9EF29EE5":{"x":1375,"y":926,"w":100,"h":156},
"3CCA7F82":{"x":1044,"y":463,"w":124,"h":152},
"945F4F46":{"x":896,"y":1089,"w":98,"h":154},
"E3C467C9":{"x":437,"y":936,"w":98,"h":157},
"C4DDB608":{"x":1008,"y":930,"w":99,"h":157},
"3444D97E":{"x":116,"y":628,"w":112,"h":155},
"6D4869FF":{"x":537,"y":1094,"w":98,"h":154},
"6965B1B1":{"x":917,"y":313,"w":125,"h":152},
"A49968F":{"x":1347,"y":157,"w":125,"h":155},
"B65D47FB":{"x":1556,"y":462,"w":124,"h":152},
"1156A8F5":{"x":1729,"y":315,"w":123,"h":154},
"A0576612":{"x":378,"y":465,"w":121,"h":155},
"A23EA3F1":{"x":1877,"y":158,"w":125,"h":155},
"48858E9E":{"x":230,"y":782,"w":104,"h":154},
"DEA2FF5B":{"x":792,"y":311,"w":123,"h":156},
"1286BA8":{"x":1210,"y":939,"w":98,"h":157},
"C32AABEC":{"x":272,"y":0,"w":133,"h":154},
"FF992765":{"x":358,"y":777,"w":112,"h":152},
"EEF34788":{"x":122,"y":470,"w":118,"h":156},
"7FD0F34F":{"x":1826,"y":940,"w":98,"h":157},
"375409DB":{"x":1349,"y":0,"w":130,"h":155},
"D73D4742":{"x":304,"y":1089,"w":99,"h":153},
"926BD52A":{"x":384,"y":309,"w":125,"h":154},
"8A029FC9":{"x":102,"y":943,"w":97,"h":157},
"F9C19F52":{"x":1655,"y":629,"w":114,"h":152},
"C6C03213":{"x":1394,"y":772,"w":113,"h":152},
"465BF7C3":{"x":1269,"y":780,"w":104,"h":157},
"83A2612F":{"x":1617,"y":0,"w":132,"h":152},
"9A7FD271":{"x":1050,"y":305,"w":124,"h":156},
"873FC56F":{"x":1677,"y":1095,"w":98,"h":153},
"97242FCF":{"x":781,"y":1096,"w":97,"h":154},
"75ADD420":{"x":581,"y":779,"w":109,"h":154},
"1C2358D2":{"x":1157,"y":618,"w":118,"h":152},
"776BA669":{"x":251,"y":469,"w":121,"h":153},
"17CEEA90":{"x":501,"y":468,"w":123,"h":152},
"5043FDD3":{"x":0,"y":941,"w":100,"h":153},
"78C90DA2":{"x":996,"y":1089,"w":98,"h":154},
"6ADCE5C0":{"x":692,"y":780,"w":111,"h":151},
"7F537E4":{"x":1881,"y":0,"w":128,"h":156},
"9B5D1403":{"x":1109,"y":931,"w":99,"h":156},
"E5BB3541":{"x":1601,"y":307,"w":126,"h":153},
"30D91BED":{"x":1295,"y":468,"w":122,"h":153},
"3431B2DB":{"x":677,"y":0,"w":132,"h":154},
"33238AA0":{"x":1923,"y":472,"w":119,"h":153},
"221D4229":{"x":1077,"y":153,"w":133,"h":150},
"1A704625":{"x":1196,"y":1098,"w":97,"h":154},
"E30B8A4E":{"x":1751,"y":0,"w":128,"h":156},
"1F627544":{"x":1509,"y":773,"w":113,"h":152},
"48431A33":{"x":407,"y":155,"w":130,"h":152},
"DF31C02":{"x":0,"y":311,"w":124,"h":155},
"A8218D09":{"x":922,"y":157,"w":126,"h":154},
"867C9CFF":{"x":0,"y":783,"w":100,"h":156},
"84B64357":{"x":511,"y":314,"w":125,"h":152},
"AECD8378":{"x":130,"y":156,"w":126,"h":155},
"288836AB":{"x":1310,"y":1084,"w":99,"h":153},
"B7734038":{"x":1879,"y":782,"w":100,"h":156},
"46C6BBE2":{"x":542,"y":0,"w":133,"h":153},
"76F33075":{"x":1001,"y":774,"w":111,"h":154},
"E328CE1A":{"x":1726,"y":936,"w":98,"h":157},
"3AD0679C":{"x":1419,"y":614,"w":116,"h":156},
"6BF31364":{"x":1750,"y":158,"w":125,"h":155},
"D4F651E":{"x":201,"y":1097,"w":97,"h":154},
"16C2B2CB":{"x":1771,"y":780,"w":106,"h":154},
"5189086A":{"x":1777,"y":1099,"w":97,"h":154},
"735FE0A6":{"x":1157,"y":772,"w":110,"h":157},
"BF370FC1":{"x":0,"y":0,"w":134,"h":154},
"1CF61B99":{"x":0,"y":468,"w":120,"h":156},
"5A53E1DE":{"x":1039,"y":617,"w":116,"h":155},
"57006AC":{"x":126,"y":313,"w":123,"h":155},
"FA773A99":{"x":1682,"y":471,"w":117,"h":156},
"98C60BE8":{"x":336,"y":931,"w":99,"h":156},
"A54480C9":{"x":407,"y":0,"w":133,"h":153},
"4F82E49C":{"x":907,"y":930,"w":99,"h":157},
"BCF94871":{"x":136,"y":0,"w":134,"h":154},
"FE343B90":{"x":1926,"y":940,"w":100,"h":153},
"E01F0539":{"x":1096,"y":1089,"w":98,"h":154},
"D57430D6":{"x":0,"y":1096,"w":97,"h":154},
"AC70A367":{"x":1429,"y":461,"w":125,"h":151},
"69056F0D":{"x":102,"y":785,"w":100,"h":156},
"D5DD0D09":{"x":1854,"y":315,"w":122,"h":155},
"E261FEDE":{"x":1277,"y":623,"w":115,"h":155},
"944F2C72":{"x":1077,"y":0,"w":134,"h":151},
"B4AC9FF4":{"x":1212,"y":153,"w":133,"h":150},
"7EE02AE5":{"x":258,"y":156,"w":124,"h":157},
"2D3CF7FB":{"x":1302,"y":314,"w":125,"h":152},
"8863AA2F":{"x":251,"y":315,"w":125,"h":152},
"C49F43C1":{"x":1926,"y":1095,"w":97,"h":154},
"8C4FE4E7":{"x":1801,"y":626,"w":115,"h":152},
"393A813D":{"x":792,"y":157,"w":128,"h":152},
"6C821542":{"x":1537,"y":616,"w":116,"h":155},
"47998D86":{"x":1481,"y":152,"w":133,"h":150},
"BE6C45E4":{"x":472,"y":777,"w":107,"h":157},
"F5EAF507":{"x":730,"y":626,"w":116,"h":152},
"E4922D64":{"x":692,"y":933,"w":100,"h":154},
"2F2D4668":{"x":1481,"y":0,"w":134,"h":150},
"536B9DEC":{"x":204,"y":938,"w":98,"h":157},
"580F8397":{"x":885,"y":625,"w":114,"h":155},
"D5BEB784":{"x":944,"y":0,"w":131,"h":155}
}}
\ No newline at end of file
0100000 未登录
miningStart、pkFriends
0201150 积分不足
miningStart、pkFriends
0100017 活动已关闭
activityBaseInfo、miningStart、pkFriends
0100015 活动不存在
activityBaseInfo、miningStart、pkFriends
0100003 无权访问该活动
activityBaseInfo、miningStart、pkFriends
0100016 活动未开始
activityBaseInfo、miningStart、pkFriends
0100014 活动已结束
activityBaseInfo、miningStart、pkFriends
0201151 网络异常
activityBaseInfo、miningStart、pkFriends
0201152 订单查询异常
getOrderStatus
\ No newline at end of file
{
"background": "", //首页素材
"pk_button_normal": "", //PK按钮常态
"pk_button_disabled": "", //PK按钮禁用态
"pk_button_label_normal": "", //PK按钮文案字色常态
"pk_button_label_disabled": "", //PK按钮文案字色常态
"dig_button_normal": "", //挖矿按钮常态
"dig_button_disabled": "", //挖矿按钮禁用态
"dig_button_label_normal": "", //挖矿按钮文案字色常态
"dig_button_label_disabled": "", //挖矿按钮文案字色常态
"dialog_background": "", //弹窗背景
"dialog_text_color": "", //弹窗文案字色
"dialog_button": "", //弹窗按钮图片
"dialog_button_label": "" //弹窗按钮文案字色
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>super-miner</title>
<meta name="viewport"
content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="full-screen" content="true"/>
<meta name="screen-orientation" content="portrait"/>
<meta name="x5-fullscreen" content="true"/>
<meta name="360-fullscreen" content="true"/>
<style>
html, body, p {
padding: 0;
margin: 0;
border: 0;
}
html, body{
height: 100%;
background-color: #282C34;
}
#floatLayer::-webkit-scrollbar {display:none}
</style>
<!--<script src="https://cdn.bootcss.com/fetch/3.0.0/fetch.min.js"></script>-->
<script src="https://cdn.bootcss.com/fetch-jsonp/1.1.3/fetch-jsonp.min.js"></script>
</head>
<body>
<div id="gameContainer" style="width: 100%;height: 100%;overflow: hidden;"></div>
<div id="loading" style="position:absolute;left:0;right:0;top:0;bottom:0;display:flex;justify-content:center;align-items:center;">
<img src="loading.gif"/>
</div>
<script src="debug/bundle.js"></script>
<script>
var CFG = {
callUpRegistH5Code: function () { //唤起登陆方法
console.log('callUpRegistH5Code')
},
appId: '1',
opActivityId: '83139', //活动长id
hdToolId: '24', //活动短id
title: '', //活动标题
rule: '<p><span style="color: rgb(51, 51, 51);">活动规则活动规则活动规则活动规则活动规则活动规则活动规则活动规则活动规则</span></p><p>hello</p><p>hello</p><p>hello</p><p>hello</p><p>hello</p><p>hello</p><p>hello</p><p>hello</p><p>hello</p><p>hello</p><p>hello</p><p>hello end</p>', //规则
loginFlag: false, //是否登录 true是为登录
earnCreditsUrl: 'http://www.baidu.com', //加积分接口
unitName: '贝壳', //积分单位
userNickname: '超级登山包', //用户昵称
showCredits: 1, //是否展示积分 1:展示 2:不展示
activityCode: '', //活动代码
configJson: '{"background":"//yun.duiba.com.cn/h5/miningMachine/home-bg.jpg","pk_button_normal":"//yun.duiba.com.cn/h5/miningMachine/pk-btn.png","pk_button_disabled":"//yun.duiba.com.cn/h5/miningMachine/pk-filter-btn.png","dig_button_normal":"//yun.duiba.com.cn/h5/miningMachine/mining-btn.png","dig_button_disabled":"//yun.dui88.com/h5/miningMachine/mining-filter-btn.png","dialog_background":"//yun.duiba.com.cn/h5/miningMachine/modal-bg.png","dialog_button":"//yun.duiba.com.cn/h5/miningMachine/modal-btn.png","pk_button_label_normal":"#FFF591","pk_button_label_disabled":"#666666","dig_button_label_normal":"#D12C00","dig_button_label_disabled":"#666666","dialog_text_color":"#AB5400","dialog_button_label":"#FFF591"}'
};
function requirelogin(){
console.log('requirelogin');
}
setTimeout(function () {
var loadingEl = document.getElementById('loading');
function onProcess(p){
if(p >= 1){
loadingEl.style.display = 'none';
}
}
var options = {};//window['inputOptions'] ||
window['super-miner'].startup(document.getElementById('gameContainer'), options, onProcess);
}, 100);
</script>
</body>
</html>
loading.gif

9.21 KB

{
"name": "super-miner",
"engineConfig": {
"fps": 60,
"designWidth": 750,
"designHeight": 1334,
"scaleMode": "fixedWidth",
"modifyCanvasSize": false,
"resPath": ""
},
"customConfig": {
"scene": {
"scenes": {
"main": "scenes/main.scene"
},
"entryScene": "main"
},
"webServiceUrl-": "http://10.10.93.204:7555 http://localhost:3010",
"webServiceUrl": ""
},
"dataCenterConfig": {
"dataCenterRoot": [
"API",
"CFG"
]
}
}
{
"success":true,
"code":"0000000",
"desc":"成功",
"timestamp":1556194177743,
"data":{
"curCredits":300,
"heapCredits":400,
"miningExpend":100,
"pkExpend":100,
"machineNickname1":"机器人昵称"
}
}
\ No newline at end of file
{
"success": true,
"code": "0000000",
"desc": "成功",
"data": 2
}
\ No newline at end of file
{
"success": true,
"code": "0201150",
"desc": "成功",
"data": {
"actOrderNum": 66,
"receiveCredits": 100,
"multipleCard": 2,
"finalCredits": 200,
"operationType": 1
}
}
\ No newline at end of file
{
"success":true,
"code":"0000000",
"desc":"成功",
"data":[
"恭喜simba获得300积分",
"恭喜鹏飞中奖318积分",
"恭喜劳奇峰中奖678积分"
]
}
\ No newline at end of file
const obj = {
success :true,
code :"0000000",
desc :"成功",
data :[]
};
const names = [
'simba',
'鹏飞中',
'登山包',
'王剑锋',
'郑明',
'崔立强',
];
let i = 0;
module.exports = function(){
obj.data.splice(0);
if(i++ > 1){
for(let i = 0; i < 50; i++){
obj.data.push(`恭喜${names[Math.floor(Math.random() * names.length)]}中奖获得${Math.floor(Math.random() * 500 + 100)}积分`)
}
}
return obj;
};
{
"success":true,
"code":"0000000",
"desc":"成功",
"data":{
"actOrderNum":66,
"userReceiveCredits":100,
"userMultipleCard":2,
"userFinalCredits":200,
"machineReceiveCredits":50,
"machineMultipleCard":2,
"machineFinalCredits":100,
"machineNickname":"simba",
"machineAvatar":"Avengers",
"operationType":1
}
}
\ No newline at end of file
{
"code": "0000000000",
"data": {
"creditsConf": {
"creditsUp": 100,
"creditsType": "virtual",
"creditsDown": 50,
"prize": [
{
"img": "adsfsadf",
"credits": 20,
"id": 4,
"title": "0.3"
},
{
"img": "sadfasdf",
"credits": 150,
"id": 3,
"title": "1.5倍"
},
{
"img": "sadfasdf",
"credits": 100,
"id": 2,
"title": "1倍"
},
{
"img": "sadfasdf",
"credits": 50,
"id": 1,
"title": "0.5倍"
}
]
},
"floating": {
"jsTest": "//yun1.duiba.com.cn/h5/showCouponPrize/4.0.0/index_201710191434.js",
"cssTest": "//yun1.duiba.com.cn/h5/showCouponPrize/4.0.0/index_201710191440.css"
},
"options": [
{
"hidden": false,
"prizeType": "thanks",
"name": "谢谢参与",
"description": "",
"logo": "//yun1.duiba.com.cn/upload/uP99F1462438316972.png",
"id": 15581
},
{
"hidden": false,
"prizeType": "lucky",
"name": "幸运福袋",
"description": "",
"logo": "//yun1.duiba.com.cn/webapp/img/luckynewn.png",
"id": 15582
},
{
"itemId": 47861,
"scoreArea": "",
"hidden": false,
"prizeType": "alipay",
"name": "支付宝1",
"description": "",
"logo": "//yun1.duiba.com.cn/developer/img/activityTool/slotMachine/alipay.png",
"id": 15585
}
],
"rule": "adsfasdf",
"type": "hdtool",
"element": {
"isCreditsTypeOpen": false,
"myCreditsLong": 999999632167,
"freeLimit": -1,
"success": false,
"myCredits": "999999632167",
"needCredits": "100",
"freeEmpty": true,
"needCreditsLong": 100,
"status": 1
}
},
"success": true,
"desc": "OK",
"timestamp": 1548832971636
}
\ No newline at end of file
{
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1550564744291,
"data": {
"skincontent": "f2fcc331f44c98883f3a5b4868d7d7f4",
"throughInfo": [
{
"step": 3,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 4,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 5,
"prizeType": 2,
"description": null,
"img": ""
},
{
"step": 6,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 7,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 9,
"prizeType": 2,
"description": null,
"img": ""
},
{
"step": 10,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 11,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 13,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 15,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 16,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 18,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 19,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 21,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 22,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 24,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 27,
"prizeType": 4,
"description": null,
"img": ""
}
]
}
}
\ No newline at end of file
{
"success":true,
"code":"0000000000",
"desc":"OK",
"timestamp":1548915321930,
"data":1
}
\ No newline at end of file
{"success":true,"code":"0000000000","desc":"OK","timestamp":1548915321930,"data":123456}
{
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1550569853824,
"data": {
"prizeType": "alipay",
"facePrice": "100",
"title": "1"
}
}
\ No newline at end of file
{
"success":true,
"code": 1,
"desc":"L(*ythj",
"timestamp":1548923950498
}
\ No newline at end of file
{"success":true,"code":"0000000000","desc":"OK","timestamp":1548923950498,"data":{"element":{"success":false,"isCreditsTypeOpen":false,"needCredits":"100","myCredits":"999999630434","myCreditsLong":999999630434,"needCreditsLong":100,"freeLimit":-1,"status":1,"freeEmpty":true},"lottery":{"id":null,"type":"thanks","imgUrl":null,"link":null,"title":null,"itemId":null,"appItemId":null,"bonus":null,"bonusMin":null,"bonusMax":null,"needAccount":null,"appLucky":null,"tip":null,"useBtnText":null,"validate":null,"couponCode":null,"couponKey":null,"stInfoDpmImg":null,"stInfoDpmClose":null,"stInfoDpmGoUse":null,"showUse":null,"openUrl":null,"iosDownloadUrl":null,"androidDownloadUrl":null,"isDownloadUrl":null,"confirm":null,"phaseNumber":null,"happyCode":null,"appHidden":true,"zybangJson":null},"exposure":null,"creditsInfo":{"activityId":82567,"prizeId":4,"orderNum":null,"developerBizId":"3029576","score":null,"recordStatus":1,"errorMsg":null},"againTag":null}}
{
"success":true,
"code":"0000000000",
"desc":"OK",
"timestamp":1548915321930,
"data":1
}
\ No newline at end of file
{
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1550570639368,
"data": {
"orderId": "883006813674240289",
"submitToken": "d895deb9118f4b938d0b70a3dd2ace19",
"credits": "999999491765",
"unitName": "金币",
"consumerCredits": 999999491765
}
}
\ No newline at end of file
{
"success":true,
"code":"0000000000",
"desc":"OK",
"timestamp":1548915321930,
"data":123456
}
{
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1550646190489,
"data": {
"score": 100,
"maxScore": 100
}
}
\ No newline at end of file
{
"success": true,
"code": 1,
"desc": "Hl7&L",
"timestamp": "1548915321930",
"data": "123123123"
}
\ No newline at end of file
{
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1551066205001,
"data": {
"resurrectionStatus": true,
"resurrectionCount": 2,
"resurrectionCredits": 300
}
}
\ No newline at end of file
{
"success": true,
"code": 0,
"desc": "ok",
"timestamp": "1519442544000",
"data": {
"valiDate": "2019-04-11 11:11:11",
"description": "xxx",
"title": "title",
"img": "//yun1.duiba.com.cn/upload/uP99F1462438316972.png"
}
}
\ No newline at end of file
{
"success":true,
"code":"0000000000",
"desc":"OK",
"timestamp":1548915321930,
"data":1
}
\ No newline at end of file
{
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1550647892216,
"data": "扣积分成功"
}
\ No newline at end of file
{
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1550568405622,
"data": {
"needPrize": true,
"lastThrough": null,
"currentLocation": 6,
"prizeType": 5,
"retreat": null,
"forward": null,
"url": null,
"plginOrderId": null,
"point": 5
}
}
\ No newline at end of file
{}
\ No newline at end of file
{
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1552025592298,
"data": {
"element": null,
"rule": null,
"questions": [
{
"id": 1,
"type": "text",
"name": "题目1",
"options": [
{
"optionId": 1,
"option": "1"
},
{
"optionId": 2,
"option": "2"
},
{
"optionId": 3,
"option": "3"
},
{
"optionId": 4,
"option": "4"
}
]
},
{
"id": 3,
"type": "text",
"name": "题目3",
"options": [
{
"optionId": 1,
"option": "1"
},
{
"optionId": 2,
"option": "2"
},
{
"optionId": 3,
"option": "3"
},
{
"optionId": 4,
"option": "4"
}
]
}
]
}
}
\ No newline at end of file
{
"name": "super-miner",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"mock": "game-cli m -p 4001 -f './mock' "
},
"build": {
"build-process": "scilla",
"release-path": "./dist",
"remote-path": "activity/super-miner",
"version": ""
},
"dependencies": {
"scilla": "git+http://gitlab2.dui88.com/laoqifeng/scilla-core#dev",
"scilla-components": "git+http://gitlab2.dui88.com/laoqifeng/scilla-components#dev",
"scilla-launcher": "git+http://gitlab2.dui88.com/laoqifeng/scilla-launcher#dev"
},
"devDependencies": {}
}
/**
* Created by rockyl on 2018-12-12.
*/
import {EventEmitter} from 'scilla'
const eventEmitter = new EventEmitter();
export default eventEmitter;
declare const DEBUG: boolean;
declare const RELEASE: boolean;
\ No newline at end of file
/**
* THIS FILE WAS GENERATE BY COMPILER
* DO NOT MODIFY THIS FILE
*/
import {registerDef} from 'scilla'
import component0 from 'components/other/CameraController';
registerDef('components/other/CameraController', component0);
import component1 from 'components/base/Transform';
registerDef('components/base/Transform', component1);
import component2 from 'components/renderer/TextureRenderer';
registerDef('components/renderer/TextureRenderer', component2);
import component3 from 'components/other/RelativeLayout';
registerDef('components/other/RelativeLayout', component3);
import component4 from 'components/renderer/RectRenderer';
registerDef('components/renderer/RectRenderer', component4);
import component5 from 'components/animation/Wave';
registerDef('components/animation/Wave', component5);
import component6 from 'components/animation/TouchZoom';
registerDef('components/animation/TouchZoom', component6);
import component7 from 'components/other/FullStageSize';
registerDef('components/other/FullStageSize', component7);
import component8 from 'components/base/TouchInterrupt';
registerDef('components/base/TouchInterrupt', component8);
import component9 from 'components/ui/ScrollView';
registerDef('components/ui/ScrollView', component9);
import component10 from 'components/renderer/HtmlRenderer';
registerDef('components/renderer/HtmlRenderer', component10);
import component11 from 'components/renderer/CircleRenderer';
registerDef('components/renderer/CircleRenderer', component11);
import component12 from 'components/animation/Zoom';
registerDef('components/animation/Zoom', component12);
import component13 from 'components/renderer/FrameAnimationRenderer';
registerDef('components/renderer/FrameAnimationRenderer', component13);
import component14 from 'components/renderer/TextRenderer';
registerDef('components/renderer/TextRenderer', component14);
import component15 from '../../assets/scripts/game/CustomTextRenderer';
registerDef('./scripts/game/CustomTextRenderer', component15);
import component16 from '../../assets/scripts/common/RunNumber';
registerDef('./scripts/common/RunNumber', component16);
import component17 from '../../assets/scripts/common/LabelCarousel';
registerDef('./scripts/common/LabelCarousel', component17);
import component18 from '../../assets/scripts/game/NoticeBar';
registerDef('./scripts/game/NoticeBar', component18);
import component19 from '../../assets/scripts/game/BottomButtonController';
registerDef('./scripts/game/BottomButtonController', component19);
import component20 from '../../assets/scripts/common/BuriedPoint';
registerDef('./scripts/common/BuriedPoint', component20);
import component21 from '../../assets/scripts/game/TwoLinesButton';
registerDef('./scripts/game/TwoLinesButton', component21);
import component22 from '../../assets/scripts/game/Hole';
registerDef('./scripts/game/Hole', component22);
import component23 from '../../assets/scripts/common/WaveController';
registerDef('./scripts/common/WaveController', component23);
import component24 from '../../assets/scripts/MainController';
registerDef('./scripts/MainController', component24);
import component25 from '../../assets/scripts/game/CustomButton';
registerDef('./scripts/game/CustomButton', component25);
import component26 from '../../assets/scripts/scenes/SceneStart';
registerDef('./scripts/scenes/SceneStart', component26);
import component27 from '../../assets/scripts/popup/Popup';
registerDef('./scripts/popup/Popup', component27);
import component28 from '../../assets/scripts/game/GameStage';
registerDef('./scripts/game/GameStage', component28);
import component29 from '../../assets/scripts/dialogs/AlertDialogContent';
registerDef('./scripts/dialogs/AlertDialogContent', component29);
import component30 from '../../assets/scripts/dialogs/RuleDialogContent';
registerDef('./scripts/dialogs/RuleDialogContent', component30);
import component31 from '../../assets/scripts/game/ApiProcess';
registerDef('./scripts/game/ApiProcess', component31);
import component32 from '../../assets/scripts/api/SamplePollingApi';
registerDef('./scripts/api/SamplePollingApi', component32);
import component33 from '../../assets/scripts/dialogs/PKMatching';
registerDef('./scripts/dialogs/PKMatching', component33);
import component34 from '../../assets/scripts/common/DotWaiting';
registerDef('./scripts/common/DotWaiting', component34);
import component35 from '../../assets/scripts/game/ItemLayer';
registerDef('./scripts/game/ItemLayer', component35);
import component36 from '../../assets/scripts/dialogs/PKChallenge';
registerDef('./scripts/dialogs/PKChallenge', component36);
import component37 from '../../assets/scripts/dialogs/PKResult';
registerDef('./scripts/dialogs/PKResult', component37);
import component38 from '../../assets/scripts/dialogs/pkresult/AnimLayer';
registerDef('./scripts/dialogs/pkresult/AnimLayer', component38);
import component39 from '../../assets/scripts/game/PKResultAnimSide';
registerDef('./scripts/game/PKResultAnimSide', component39);
import component40 from '../../assets/scripts/game/TimesCard';
registerDef('./scripts/game/TimesCard', component40);
import component41 from '../../assets/scripts/dialogs/pkresult/ResultLayer';
registerDef('./scripts/dialogs/pkresult/ResultLayer', component41);
import component42 from '../../assets/scripts/game/PKResultSide';
registerDef('./scripts/game/PKResultSide', component42);
import component43 from '../../assets/scripts/api/SampleApi';
registerDef('./scripts/api/SampleApi', component43);
import component44 from '../../assets/scripts/dialogs/SingleResult';
registerDef('./scripts/dialogs/SingleResult', component44);
import component45 from '../../assets/scripts/common/FlySequence';
registerDef('./scripts/common/FlySequence', component45);
import component46 from '../../assets/scripts/common/Toast';
registerDef('./scripts/common/Toast', component46);
import component47 from '../../assets/scripts/navigator/SingleSceneNavigator';
registerDef('./scripts/navigator/SingleSceneNavigator', component47);
import component48 from '../../assets/scripts/game/Item';
registerDef('./scripts/game/Item', component48);
import component49 from '../../assets/scripts/common/FloatMissing';
registerDef('./scripts/common/FloatMissing', component49);
import component50 from '../../assets/scripts/game/CreditsBar';
registerDef('./scripts/game/CreditsBar', component50);
import component51 from '../../assets/scripts/game/Miner';
registerDef('./scripts/game/Miner', component51);
import component52 from '../../assets/scripts/common/CountDown';
registerDef('./scripts/common/CountDown', component52);
/**
* Created by rockyl on 2018/11/5.
*
* 游戏入口
*/
import {modifyEngineConfig} from 'scilla'
import ScillaLauncher from 'launcher'
import './generated/MustCompile'
let launcher: ScillaLauncher;
modifyEngineConfig({
lineHeightRatio: 1.0,
entityEnabled: false,
awakeComponentWhenAdded: false,
sleepComponentWhenRemoved: false,
drawRenderRect: false,
});
export async function startup(containerElement, options: any = {}, onProgress: Function) {
launcher = new ScillaLauncher();
const config = window['configJson'] = JSON.parse(window['CFG'].configJson);
options.resReplaceConfigs = {
'scenes/main.scene': {
'singles/bg.jpg': config['background'],
'singles/btn-start-dig-disabled.png': config['dig_button_disabled'],
'singles/btn-start-dig.png': config['dig_button_normal'],
'singles/btn-start-pk-disabled.png': config['pk_button_disabled'],
'singles/btn-start-pk.png': config['pk_button_normal'],
'singles/button-red.png': config['dialog_button'],
'singles/dialog-bg.png': config['dialog_background'],
}
};
await launcher.launch(containerElement, options, onProgress);
}
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
{
"replaces": {
"constants": {
"projectName": null
},
"contentInFiles": [
"index.html",
"manifest.json",
"package.json"
],
"nameOfFiles": []
}
}
{
"compilerOptions": {
"target": "es5",
"experimentalDecorators": true,
"removeComments": true,
"sourceMap": true,
"importHelpers": true,
"noImplicitAny": false,
"noEmitOnError": false,
"downlevelIteration": true,
"lib": [
"es5",
"es6",
"dom",
"es2015.promise"
],
"baseUrl": "./",
"paths": {
"scilla": ["node_modules/scilla/src/index"],
"launcher": ["node_modules/scilla-launcher/src/index"],
"components/*": ["node_modules/scilla-components/src/*"],
"lang": ["src/lang.ts"],
"globalEvent": ["src/GlobalEvent.ts"]
}
},
"include": [
"src",
"assets",
"node_modules/scilla/src",
"node_modules/scilla-components/src"
]
}
\ No newline at end of file
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"scilla-components@git+http://gitlab2.dui88.com/laoqifeng/scilla-components#dev":
version "1.0.2"
resolved "git+http://gitlab2.dui88.com/laoqifeng/scilla-components#61b7ca17b74be5e8b77a1e9c90f4847140be6655"
"scilla-launcher@git+http://gitlab2.dui88.com/laoqifeng/scilla-launcher#dev":
version "1.0.1"
resolved "git+http://gitlab2.dui88.com/laoqifeng/scilla-launcher#40cb0087c6df55c07a4e86c28b703973f6b6fd58"
"scilla@git+http://gitlab2.dui88.com/laoqifeng/scilla-core#dev":
version "1.0.2"
resolved "git+http://gitlab2.dui88.com/laoqifeng/scilla-core#8e6542a18c63e426362cd2deb960432f17a9b2e8"
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