Commit 6a447bde authored by yu's avatar yu

10.13调整

parent 1841778a
This diff is collapsed.
......@@ -2,7 +2,6 @@ import { asyncDelay, onHomeworkFinish, RandomInt } from "../script/util";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent";
import Game, { FISH_OUT, GAME_STATE, Option } from "./tool/Game";
import pg from "./tool/pg";
import { count } from "console";
const { ccclass, property } = cc._decorator;
......@@ -125,7 +124,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
private onAgain() {
this.layout_finish.active = false;
this.onLoadEnd();
this.initData();
pg.event.emit("mouse_num", Game.getIns().getCardInfo().length);
this.gameStart();
}
private onNext() {
......@@ -182,11 +183,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
private chipPos = [];
private showQuestion() {
this.chipPos = [
{ x: -260, y: -44, angle: 130 }, { x: -190, y: -24, angle: 130 }, { x: 17, y: 104, angle: 120 },
{ x: 35, y: 39, angle: 65 }, { x: -172, y: 43, angle: 130 }, { x: -64, y: -6, angle: 130 },
{ x: 208, y: 112, angle: 50 }, { x: -26, y: 28, angle: 120 }, { x: 245, y: -18, angle: 55 },
{ x: 190, y: -15, angle: 60 }, { x: 130, y: -18, angle: 65 }, { x: 112, y: 83, angle: 65 }
{ x: -260, y: -44, angle: 130, zIndex: 0 }, { x: 245, y: -18, angle: 55, zIndex: 8 }, { x: -190, y: -24, angle: 130, zIndex: 1 },
{ x: 190, y: -15, angle: 60, zIndex: 9 }, { x: -172, y: 43, angle: 130, zIndex: 4 }, { x: 130, y: -18, angle: 65, zIndex: 10 },
{ x: -64, y: -6, angle: 130, zIndex: 5 }, { x: -26, y: 28, angle: 120, zIndex: 7 }, { x: 112, y: 83, angle: 65, zIndex: 11 },
{ x: 35, y: 39, angle: 65, zIndex: 3 }, { x: 17, y: 104, angle: 120, zIndex: 2 }, { x: 208, y: 112, angle: 50, zIndex: 6 }
];
// this.chipPos = [
// { x: -260, y: -44, angle: 130 }, { x: -190, y: -24, angle: 130 }, { x: 17, y: 104, angle: 120 },
// { x: 35, y: 39, angle: 65 }, { x: -172, y: 43, angle: 130 }, { x: -64, y: -6, angle: 130 },
// { x: 208, y: 112, angle: 50 }, { x: -26, y: 28, angle: 120 }, { x: 245, y: -18, angle: 55 },
// { x: 190, y: -15, angle: 60 }, { x: 130, y: -18, angle: 65 }, { x: 112, y: 83, angle: 65 }
// ];
this.layout_card.removeAllChildren();
let chipNode = cc.find("chips", this.layout_game);
this.wordItams = [];
......@@ -197,11 +204,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
let word = cc.find("word", chip);
word.getComponent(cc.Label).string = ch.txt;
chip.data = ch;
chip.data.zIndex = idx;
chip.data.zIndex = this.chipPos[idx].zIndex;
chip.x = this.chipPos[idx].x;
chip.y = this.chipPos[idx].y;
chip.angle = this.chipPos[idx].angle;
this.layout_card.addChild(chip, idx);
this.layout_card.addChild(chip, this.chipPos[idx].zIndex);
chip.off(cc.Node.EventType.TOUCH_START, this.onItemTouchStart, this);
chip.off(cc.Node.EventType.TOUCH_MOVE, this.onItemTouchMove, this);
......@@ -260,10 +267,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
if (!itemBg) {
target.parent = null;
this.layout_card.addChild(target, data.zIndex);
target.x = this.chipPos[data.zIndex].x;
target.y = this.chipPos[data.zIndex].y;
target.angle = this.chipPos[data.zIndex].angle;
let chipPos = this.getChipPos(data.zIndex)
this.layout_card.addChild(target, chipPos.zIndex);
target.x = chipPos.x;
target.y = chipPos.y;
target.angle = chipPos.angle;
this.playLocalAudio("error");
return;
}
......@@ -291,6 +299,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
e.target.setPosition(pos)
}
}
private getChipPos(zIndex) {
for (let i = 0; i < this.chipPos.length; i++) {
let chip = this.chipPos[i];
if (chip.zIndex == zIndex) {
return chip;
}
}
return null;
}
private getDistances(p1, p2) {
//转换世界坐标查看距离
let ps2 = p2.convertToWorldSpaceAR(cc.v2(0, 0));
......@@ -335,6 +352,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
let finish_db = cc.find("finish_db", layout_finish);
let btn_again = cc.find("btn_again", layout_finish);
let btn_next = cc.find("btn_next", layout_finish);
finish_db.active = true;
btn_again.active = false;
btn_next.active = false;
finish_db.getComponent(dragonBones.ArmatureDisplay).playAnimation("newAnimation", 1);
this.playLocalAudio("finish").then(() => {
finish_db.active = false;
btn_again.active = true;
......
......@@ -93,6 +93,7 @@ export default class NewClass extends cc.Component {
this.bigStarArr.push(starBg);
}
this.bigStarArr = this.bigStarArr.reverse();
console.log("bigStarArr: ", this.bigStarArr);
}
......
export const defaultData ={
"imgAni": {
"ske": {
"url": "http://staging-teach.cdn.ireadabc.com/62eb732be39e0a514dcd61b2f215141c.json",
"name": "niao_ske.json"
"url": "http://staging-teach.cdn.ireadabc.com/a7dc36aa85121807bb7e049642192cec.json",
"name": "niao_ske.json"
},
"tex": {
"url": "http://staging-teach.cdn.ireadabc.com/9e789079ec5355fb1ee28e362e9cb92d.json",
"name": "niao_tex.json"
"url": "http://staging-teach.cdn.ireadabc.com/c635daaa86b4c5c39f4af88e826d3433.json",
"name": "niao_tex.json"
},
"png": {
"url": "http://staging-teach.cdn.ireadabc.com/609b0aba832294d17fafdb7587773bc3.png",
"name": "niao_tex.png"
"url": "http://staging-teach.cdn.ireadabc.com/75c87beb2b7d79033ace8978edc91a12.png",
"name": "niao_tex.png"
}
},
"questionTextAudio": "http://staging-teach.cdn.ireadabc.com/c3b69ad3d51385eac7d4195773ef59f7_l.mp3",
......
{
"ver": "2.3.5",
"uuid": "c049810d-17a6-4f9e-b81d-1aef551c9dfd",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 150,
"height": 150,
"platformSettings": {},
"subMetas": {
"icon_right2": {
"ver": "1.0.4",
"uuid": "7d20a4d1-bc99-4d20-a15a-38163399246d",
"rawTextureUuid": "c049810d-17a6-4f9e-b81d-1aef551c9dfd",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 13,
"trimY": 0,
"width": 124,
"height": 150,
"rawWidth": 150,
"rawHeight": 150,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
......@@ -4588,6 +4588,8 @@ declare namespace cc {
/** !#en Returns a normalized vector representing the forward direction (Z axis) of the node in world space.
!#zh 获取节点正前方(z 轴)面对的方向,返回值为世界坐标系下的归一化向量 */
forward: Vec3;
pageIdx: any;
data: any;
/**
@param name name
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