Commit 8626539e authored by linzhiguo's avatar linzhiguo

+ 增加当前题,错误题标识

+ >=0.6 动画
parent ef209f46
......@@ -3931,7 +3931,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
240,
280,
322,
0,
0,
......@@ -4576,7 +4576,7 @@
"_target": null,
"_alignFlags": 33,
"_left": 0,
"_right": 50,
"_right": 10,
"_top": 18,
"_bottom": 0,
"_verticalCenter": 0,
......@@ -5034,7 +5034,7 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "d175e9c9-f9de-4dbc-8759-652357567489"
......@@ -5250,7 +5250,7 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "d175e9c9-f9de-4dbc-8759-652357567489"
......@@ -6398,10 +6398,10 @@
"__id__": 133
},
{
"__id__": 138
"__id__": 142
},
{
"__id__": 153
"__id__": 157
}
],
"_active": true,
......@@ -6526,12 +6526,18 @@
"_children": [
{
"__id__": 135
},
{
"__id__": 137
},
{
"__id__": 139
}
],
"_active": true,
"_components": [
{
"__id__": 137
"__id__": 141
}
],
"_prefab": null,
......@@ -6676,6 +6682,194 @@
"_atlas": null,
"_id": "e4OZK2LL5Gi7Um5nQUO1lo"
},
{
"__type__": "cc.Node",
"_name": "icon_incorrect",
"_objFlags": 0,
"_parent": {
"__id__": 134
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 138
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 37,
"height": 51
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "495iSCROFCw4/BOesejbYn"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 137
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "aa4b89fb-61ee-4c70-98a3-c453a3d08ebf"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "dbO6aFE+xCCpWjpYuWBizE"
},
{
"__type__": "cc.Node",
"_name": "icon_correct",
"_objFlags": 0,
"_parent": {
"__id__": 134
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 140
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 37,
"height": 51
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "889UjxpxNHUYxLbPr3vVgJ"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 139
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "8ff1d8dd-d6a3-40a0-9af2-32daae1da95e"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "11NvX0TWdLq6AZ09C/JdwG"
},
{
"__type__": "cc.Sprite",
"_name": "",
......@@ -6716,12 +6910,6 @@
"__id__": 132
},
"_children": [
{
"__id__": 139
},
{
"__id__": 141
},
{
"__id__": 143
},
......@@ -6736,6 +6924,12 @@
},
{
"__id__": 151
},
{
"__id__": 153
},
{
"__id__": 155
}
],
"_active": true,
......@@ -6793,13 +6987,13 @@
"_name": "correct",
"_objFlags": 0,
"_parent": {
"__id__": 138
"__id__": 142
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 140
"__id__": 144
}
],
"_prefab": null,
......@@ -6855,7 +7049,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 139
"__id__": 143
},
"_enabled": true,
"_clip": {
......@@ -6874,13 +7068,13 @@
"_name": "dizzy",
"_objFlags": 0,
"_parent": {
"__id__": 138
"__id__": 142
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 142
"__id__": 146
}
],
"_prefab": null,
......@@ -6936,7 +7130,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 141
"__id__": 145
},
"_enabled": true,
"_clip": {
......@@ -6955,13 +7149,13 @@
"_name": "incorrect",
"_objFlags": 0,
"_parent": {
"__id__": 138
"__id__": 142
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 144
"__id__": 148
}
],
"_prefab": null,
......@@ -7017,7 +7211,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 143
"__id__": 147
},
"_enabled": true,
"_clip": {
......@@ -7036,13 +7230,13 @@
"_name": "time321",
"_objFlags": 0,
"_parent": {
"__id__": 138
"__id__": 142
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 146
"__id__": 150
}
],
"_prefab": null,
......@@ -7098,7 +7292,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 145
"__id__": 149
},
"_enabled": true,
"_clip": {
......@@ -7117,13 +7311,13 @@
"_name": "victory",
"_objFlags": 0,
"_parent": {
"__id__": 138
"__id__": 142
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 148
"__id__": 152
}
],
"_prefab": null,
......@@ -7179,7 +7373,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 147
"__id__": 151
},
"_enabled": true,
"_clip": {
......@@ -7198,13 +7392,13 @@
"_name": "lose",
"_objFlags": 0,
"_parent": {
"__id__": 138
"__id__": 142
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 150
"__id__": 154
}
],
"_prefab": null,
......@@ -7260,7 +7454,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 149
"__id__": 153
},
"_enabled": true,
"_clip": {
......@@ -7279,13 +7473,13 @@
"_name": "fall",
"_objFlags": 0,
"_parent": {
"__id__": 138
"__id__": 142
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 152
"__id__": 156
}
],
"_prefab": null,
......@@ -7341,7 +7535,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 151
"__id__": 155
},
"_enabled": true,
"_clip": {
......
......@@ -427,7 +427,10 @@ cc.Class({
area.addChild(item);
item.y = 0;
item.scale = this.between(0.5, (width/len - padding_x)/item.width, 1);
item.children[0].active = false;
item.flag = item.getComponent(cc.Sprite);
item.flag1 = item.getChildByName('icon_1');
item.correct = item.getChildByName('icon_correct');
item.incorrect = item.getChildByName('icon_incorrect');
}
this._index = 0;
},
......@@ -449,6 +452,8 @@ cc.Class({
// info.correct.length = Math.min(info.correct.length, 3);
// info.incorrect.length = Math.min(info.incorrect.length, 3);
this.currentOutline();
this._correct_index = 0;
let idxs = [info.correct, info.incorrect];
if (RandomInt(2) == 0){
......@@ -488,20 +493,33 @@ cc.Class({
if (this._index >= this.data.length)
return;
let idx = this.data.length - this._index - 1;
let area = this._area
let flag = area.children[idx].getComponent(cc.Sprite);
flag.enabled = false;
let item = this.currentFlag();
item.flag.enabled = false;
let flag1 = flag.node.children[0];
flag1.active = true;
cc.tween(flag1)
item.flag1.active = true;
item.correct.active = false;
item.incorrect.active = false;
cc.tween(item.flag1)
.to(0.1, {scale: 1.2},{ easing: 'quadIn' })
.to(0.2, {scale: 0.8},{ easing: 'quadOut' })
.to(0.1, {scale: 1},{ easing: 'quadIn' })
.start();
},
currentFlag(){
let idx = this.data.length - this._index - 1;
let area = this._area;
return area.children[idx];
},
currentOutline(correct = true){
let item = this.currentFlag(this._index);
item.flag.enabled = true;
item.flag1.active = false;
item.correct.active = correct;
item.incorrect.active = !correct;
},
tryFinish(){
if (this._finished == true)
return;
......@@ -517,7 +535,7 @@ cc.Class({
if (this._index >= this.data.length){
this._finished = true;
if (this.allWrong() == true){
if (this.failure() == true){
this.playAudioByName('lose');
this._comeon.active = true;
playDragonBoneAnimation(this._comeon, 'newAnimation', 1, ()=>{
......@@ -589,6 +607,7 @@ cc.Class({
this._sound_button._sprite.active = false;
this._can_hitted = false;
this.cleanTimer();
this.currentOutline(false);
for(let i = 0; i < 2; i++){
this.flyVirus[i].active = false;
......@@ -643,6 +662,8 @@ cc.Class({
this._can_hitted = false;
if (correct == true)
this.updateFlag();
else
this.currentOutline(false);
let fly;
for(let i = 0; i < 2; i++){
......@@ -652,7 +673,7 @@ cc.Class({
fly._recount_timer = null;
}
if (i == this._correct_index){
if (correct == (i == this._correct_index)){
playDragonBoneAnimation(fly, 'dizzy', -1);
fly._fall_ani = cc.tween(fly)
.to(1, {y: fly._x - this._frameSize.height*1.5})
......@@ -706,14 +727,16 @@ cc.Class({
.start();
},
allWrong(){
failure(){
let item, len = this._area.childrenCount;
let count = 0;
for(let i = 0; i <len; i++){
item = this._area.children[i];
if (item.children[0].active == true)
return false;
if (item.incorrect.active == true)
count ++;
}
return true;
console.log(count/len);
return count/len >= 0.4;
},
......
{
"ver": "2.3.5",
"uuid": "936c2fda-6df3-4146-97e8-f6455a329d7b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 37,
"height": 51,
"platformSettings": {},
"subMetas": {
"icon_correct": {
"ver": "1.0.4",
"uuid": "8ff1d8dd-d6a3-40a0-9af2-32daae1da95e",
"rawTextureUuid": "936c2fda-6df3-4146-97e8-f6455a329d7b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 37,
"height": 51,
"rawWidth": 37,
"rawHeight": 51,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "db1907bd-a766-4e24-8fdb-98cf2e14a63d",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 37,
"height": 51,
"platformSettings": {},
"subMetas": {
"icon_incorrect": {
"ver": "1.0.4",
"uuid": "aa4b89fb-61ee-4c70-98a3-c453a3d08ebf",
"rawTextureUuid": "db1907bd-a766-4e24-8fdb-98cf2e14a63d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 37,
"height": 51,
"rawWidth": 37,
"rawHeight": 51,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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