Commit 27b75e0c authored by 范雪寒's avatar 范雪寒

feat: 给文件夹改名

parent 64a3eaee
...@@ -3024,7 +3024,7 @@ ...@@ -3024,7 +3024,7 @@
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"showInEditor": false, "showInEditor": false,
"_id": "bagTcaqMJGN4a4Ur1EiS/x" "_id": "aeTyUK3DdKgKoEP+WXUczM"
}, },
{ {
"__type__": "cc.Label", "__type__": "cc.Label",
...@@ -3059,7 +3059,7 @@ ...@@ -3059,7 +3059,7 @@
"_N$fontFamily": "Arial", "_N$fontFamily": "Arial",
"_N$overflow": 0, "_N$overflow": 0,
"_N$cacheMode": 0, "_N$cacheMode": 0,
"_id": "42TULR5yFDtp2yRPbaPPVE" "_id": "307SbmsyVNm5QHA5W2rsgL"
}, },
{ {
"__type__": "cc.RichText", "__type__": "cc.RichText",
......
import { onHomeworkFinish } from "./util"; import { onHomeworkFinish } from "./util";
import { defaultData } from '../script/defaultData.js'; import { defaultData } from '../script/defaultData.js';
import { addBtnListener, asyncTweenTo, Between, jelly, playAudioByUrl, playAudioByUrlSync, RandomInt } from "../script/util"; import { addBtnListener, asyncTweenTo, Between, getSpriteFrimeByUrl, jelly, playAudioByUrl, playAudioByUrlSync, RandomInt } from "../script/util";
cc.Class({ cc.Class({
...@@ -162,7 +162,7 @@ cc.Class({ ...@@ -162,7 +162,7 @@ cc.Class({
for (let i = 0; i < this.data.questionList.length; i++) { for (let i = 0; i < this.data.questionList.length; i++) {
const starBase = cc.instantiate(cc.find('StarBase')); const starBase = cc.instantiate(cc.find('StarBase'));
starBase.name = `starBase_${i}`; starBase.name = `starBase_${i}`;
starBase.scale = Between(0.5, ((starLayout.height - paddingY * (length - 1)) / length) / starBase.height, 1); starBase.scale = Between(0.5, (starLayout.height / length - paddingY) / starBase.height, 1);
starBase.parent = starLayout; starBase.parent = starLayout;
} }
}, },
...@@ -216,7 +216,24 @@ cc.Class({ ...@@ -216,7 +216,24 @@ cc.Class({
// answerImg // answerImg
// rightAnswer // rightAnswer
createImgBall(answer) { createImgBall(answer) {
const bg = cc.find('Canvas/bg');
const ball = cc.instantiate(cc.find('BallImg'));
ball.x = bg.width / 4 * RandomInt(-1, 1 + 1) + RandomInt(-50, 50);
ball.y = bg.height;
ball.parent = bg;
const img = cc.find('Mask/AnsterImg', ball);
getSpriteFrimeByUrl(answer.answerImg, (spriteFrame) => {
img.getComponent(cc.Sprite).spriteFrame = spriteFrame;
});
const currentQuestion = this.data.questionList[this._status.currentQuestionIdx];
const timeList = [5, 5, 4, 4, 3.2, 3.2, 2.56, 2.56, 2.048, 2.048];
const time = timeList[currentQuestion.speedLevel];
cc.tween(ball)
.to(time, { y: -bg.height })
.removeSelf()
.start();
}, },
createTextBall(answer) { createTextBall(answer) {
......
...@@ -6,7 +6,7 @@ export const defaultData = { ...@@ -6,7 +6,7 @@ export const defaultData = {
answerList: [{ answerList: [{
answerAudio: '', answerAudio: '',
answerTxt: 'cat', answerTxt: 'cat',
answerImg: '', answerImg: 'http://staging-teach.cdn.ireadabc.com/d87dd698252e6f2c53d0e8c761b065c5.png',
rightAnswer: true rightAnswer: true
}, { }, {
answerAudio: '', answerAudio: '',
......
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