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

feat: 给文件夹改名

parent 64a3eaee
......@@ -3024,7 +3024,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "bagTcaqMJGN4a4Ur1EiS/x"
"_id": "aeTyUK3DdKgKoEP+WXUczM"
},
{
"__type__": "cc.Label",
......@@ -3059,7 +3059,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "42TULR5yFDtp2yRPbaPPVE"
"_id": "307SbmsyVNm5QHA5W2rsgL"
},
{
"__type__": "cc.RichText",
......
import { onHomeworkFinish } from "./util";
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({
......@@ -162,7 +162,7 @@ cc.Class({
for (let i = 0; i < this.data.questionList.length; i++) {
const starBase = cc.instantiate(cc.find('StarBase'));
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;
}
},
......@@ -216,7 +216,24 @@ cc.Class({
// answerImg
// rightAnswer
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) {
......
......@@ -6,7 +6,7 @@ export const defaultData = {
answerList: [{
answerAudio: '',
answerTxt: 'cat',
answerImg: '',
answerImg: 'http://staging-teach.cdn.ireadabc.com/d87dd698252e6f2c53d0e8c761b065c5.png',
rightAnswer: true
}, {
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