Commit 706fc6c4 authored by linzhiguo's avatar linzhiguo

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

+ >=0.6 动画
parent 56bb24db
......@@ -12215,7 +12215,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-50,
-30,
0,
0,
0,
......@@ -12309,7 +12309,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-93,
-79,
-1,
0,
0,
......@@ -12418,10 +12418,10 @@
},
"_N$startAxis": 0,
"_N$paddingLeft": 0,
"_N$paddingRight": 30,
"_N$paddingRight": 10,
"_N$paddingTop": 0,
"_N$paddingBottom": 0,
"_N$spacingX": 2,
"_N$spacingX": 8,
"_N$spacingY": 0,
"_N$verticalDirection": 1,
"_N$horizontalDirection": 1,
......@@ -13677,7 +13677,7 @@
"__id__": 255
},
{
"__id__": 260
"__id__": 264
}
],
"_active": true,
......@@ -13802,12 +13802,18 @@
"_children": [
{
"__id__": 257
},
{
"__id__": 259
},
{
"__id__": 261
}
],
"_active": true,
"_components": [
{
"__id__": 259
"__id__": 263
}
],
"_prefab": null,
......@@ -13933,7 +13939,7 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a7afe200-f143-4c66-a290-3756e1cc5c49"
......@@ -13952,6 +13958,194 @@
"_atlas": null,
"_id": "76ASsItQpBOLgqPb+9Mf8Y"
},
{
"__type__": "cc.Node",
"_name": "icon_correct",
"_objFlags": 0,
"_parent": {
"__id__": 256
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 260
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 48,
"height": 38
},
"_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": "60XrwztK9BL5PhHRZxIr2t"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 259
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "96645cf3-a876-47ac-ad49-312ee48828d4"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "6aHAwY3xVFn7EPd2Nj9ml1"
},
{
"__type__": "cc.Node",
"_name": "icon_incorrect",
"_objFlags": 0,
"_parent": {
"__id__": 256
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 262
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 48,
"height": 38
},
"_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": "abaSgnfylAw7qDBpK7Db+9"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 261
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "82aa2e57-d4c3-40cd-a146-3628d1ce28ea"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "14opiJhTZBUoU0JvvuETEh"
},
{
"__type__": "cc.Sprite",
"_name": "",
......@@ -13965,7 +14159,7 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "f621cffd-d037-44bf-9a08-6255948a6102"
......@@ -13992,12 +14186,6 @@
"__id__": 254
},
"_children": [
{
"__id__": 261
},
{
"__id__": 263
},
{
"__id__": 265
},
......@@ -14015,6 +14203,12 @@
},
{
"__id__": 275
},
{
"__id__": 277
},
{
"__id__": 279
}
],
"_active": true,
......@@ -14072,13 +14266,13 @@
"_name": "correct",
"_objFlags": 0,
"_parent": {
"__id__": 260
"__id__": 264
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 262
"__id__": 266
}
],
"_prefab": null,
......@@ -14134,7 +14328,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 261
"__id__": 265
},
"_enabled": true,
"_clip": {
......@@ -14153,13 +14347,13 @@
"_name": "dizzy",
"_objFlags": 0,
"_parent": {
"__id__": 260
"__id__": 264
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 264
"__id__": 268
}
],
"_prefab": null,
......@@ -14215,7 +14409,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 263
"__id__": 267
},
"_enabled": true,
"_clip": {
......@@ -14234,13 +14428,13 @@
"_name": "incorrect",
"_objFlags": 0,
"_parent": {
"__id__": 260
"__id__": 264
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 266
"__id__": 270
}
],
"_prefab": null,
......@@ -14296,7 +14490,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 265
"__id__": 269
},
"_enabled": true,
"_clip": {
......@@ -14315,13 +14509,13 @@
"_name": "laugh",
"_objFlags": 0,
"_parent": {
"__id__": 260
"__id__": 264
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 268
"__id__": 272
}
],
"_prefab": null,
......@@ -14377,7 +14571,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 267
"__id__": 271
},
"_enabled": true,
"_clip": {
......@@ -14396,13 +14590,13 @@
"_name": "lose",
"_objFlags": 0,
"_parent": {
"__id__": 260
"__id__": 264
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 270
"__id__": 274
}
],
"_prefab": null,
......@@ -14458,7 +14652,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 269
"__id__": 273
},
"_enabled": true,
"_clip": {
......@@ -14477,13 +14671,13 @@
"_name": "missed",
"_objFlags": 0,
"_parent": {
"__id__": 260
"__id__": 264
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 272
"__id__": 276
}
],
"_prefab": null,
......@@ -14539,7 +14733,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 271
"__id__": 275
},
"_enabled": true,
"_clip": {
......@@ -14558,13 +14752,13 @@
"_name": "time321",
"_objFlags": 0,
"_parent": {
"__id__": 260
"__id__": 264
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 274
"__id__": 278
}
],
"_prefab": null,
......@@ -14620,7 +14814,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 273
"__id__": 277
},
"_enabled": true,
"_clip": {
......@@ -14639,13 +14833,13 @@
"_name": "victory",
"_objFlags": 0,
"_parent": {
"__id__": 260
"__id__": 264
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 276
"__id__": 280
}
],
"_prefab": null,
......@@ -14701,7 +14895,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 275
"__id__": 279
},
"_enabled": true,
"_clip": {
......
......@@ -206,6 +206,9 @@ cc.Class({
if (this.hit_result != false){
this.updateFlag();
}
else{
this.currentOutline(this.mouse_id, false);
}
cc.tween(item)
.delay(0.5)
.call(()=>{
......@@ -268,6 +271,10 @@ cc.Class({
flag_area.addChild(item);
item.y = 0;
item.scale = this.Between(0.5, (width/len - padding_x)/item.width, 1);
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._mouse_index = 0;
cb && cb();
......@@ -291,6 +298,8 @@ cc.Class({
this.hit_result = info.correct;
this._astr = info.word;
this.currentOutline(this._mouse_index);
for(let i = 0; i < len; i++){
item = this.mouses[i];
item.y = item._y1;
......@@ -315,6 +324,7 @@ cc.Class({
}
else{
this.sendAnswer();
this.currentOutline(this.mouse_id, false);
}
this.moveDown(mouse.node, ()=>{
......@@ -368,21 +378,34 @@ cc.Class({
},
updateFlag(){
let item = this.currentFlag();
item.flag.enabled = false;
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 flag_number = this.data.mouses.length;
let flag_index = this._mouse_index;
let idx = flag_number- flag_index- 1;
let area = cc.find('Canvas/flag_area');
let flag = area.children[idx].getComponent(cc.Sprite);
flag.enabled = false;
return area.children[idx];
},
let flag1 = flag.node.children[0];
flag1.active = true;
cc.tween(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();
currentOutline(idx, correct = true){
let item = this.currentFlag(idx);
item.flag.enabled = true;
item.flag1.active = false;
item.correct.active = correct;
item.incorrect.active = !correct;
},
tryFinished(){
......@@ -398,7 +421,7 @@ cc.Class({
if (this._mouse_index >= this.data.mouses.length){
this._finished = true;
if (this.allWrong() == true){
if (this.failure() == true){
this.playAudioByName('lose');
this._comeon.active = true;
playDragonBoneAnimation(this._comeon, 'newAnimation', 1, ()=>{
......@@ -467,14 +490,17 @@ cc.Class({
this.timer1.string = str;
},
allWrong(){
failure(){
let area = cc.find('Canvas/flag_area');
let len = area.childrenCount;
let count = 0;
for(let i = 0; i < len; i++){
if (area.children[i].children[0].active == true)
return false;
if (area.children[i].incorrect.active == true)
count++;
}
return true;
console.log(count/len);
return count/len >= 0.4;
},
// update (dt) {},
......
......@@ -4,7 +4,7 @@
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 40,
......
......@@ -4,7 +4,7 @@
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 42,
......
{
"ver": "2.3.5",
"uuid": "fba9c797-714c-452d-aae6-70dc4a60e1f3",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 48,
"height": 38,
"platformSettings": {},
"subMetas": {
"icon_correct": {
"ver": "1.0.4",
"uuid": "96645cf3-a876-47ac-ad49-312ee48828d4",
"rawTextureUuid": "fba9c797-714c-452d-aae6-70dc4a60e1f3",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 48,
"height": 38,
"rawWidth": 48,
"rawHeight": 38,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "593f6570-56b3-4259-9a22-82a8523f8d5b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 48,
"height": 38,
"platformSettings": {},
"subMetas": {
"icon_incorrect": {
"ver": "1.0.4",
"uuid": "82aa2e57-d4c3-40cd-a146-3628d1ce28ea",
"rawTextureUuid": "593f6570-56b3-4259-9a22-82a8523f8d5b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 48,
"height": 38,
"rawWidth": 48,
"rawHeight": 38,
"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