Commit d2b6c858 authored by LikG21's avatar LikG21

更改切换时间为3s

parent bc5295c6
......@@ -158,8 +158,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
nextQuestion() {
// 游戏所需的初始化数据
this.currentId = 0
this.time = this.data.options.length * 5
console.log(this.time, '456')
this.time = this.data.options.length * 3
this.startTime = this.time * 1000 + Date.now()
this.countdownTime = "60.00"
this.lengthProgress = 0
......@@ -185,7 +184,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
countdownQuestion(topQuestion) {
let countdown = pg.view.find(this, 'layer_game/countdown');
var chil = countdown.children
var b = this.time - 5
var b = this.time - 3
chil[0].active = true
chil[1].active = false
var timer = setInterval(() => {
......@@ -203,11 +202,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
//每隔五秒
if (Number(this.countdownTime) - b <= 0) {
console.log(Number(this.countdownTime) - b)
/* console.log(Number(this.countdownTime) - b) */
//等待用户回答问题
this.whetherQuestions(topQuestion)
b -= 5
b -= 3
//下一题
setTimeout(() => {
this.titleOptions(topQuestion)
......@@ -228,6 +227,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
var options = this.data.options
pg.view.setNetImg(topQuestion.children[1], options[this.currentId].image, { w: 700, h: 360 })
pg.view.setString(topQuestion.children[2], options[this.currentId].text)
console.log('next')
}
//题目数分配
questionNuber() {
......@@ -259,7 +259,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
//用户回答问题
whetherQuestions(topQuestion) {
var answer = this.currentId > 0
var answer = this.currentId >= 0
this.whetherAnswer(topQuestion, answer)
}
//用户回答结果
......@@ -312,7 +312,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
row.children[0].active = true
}
addAnimation(row, topQuestion) {
if (this.currentId < (this.time / 5) - 1) {
if (this.currentId < (this.time / 3) - 1) {
//初始化
setTimeout(() => {
row.children[0].active = false
......
export const defaultData =
{ "onlineFlg": false, "title": "钓鱼大作战", "questionText": "海洋里有很多鱼,每条鱼身上都藏着魔法信息!亲爱的小玩家,请仔细听游戏指令,找到含有正确魔法信息的鱼,快速完成钓鱼。 在本次的游戏中,你将和其他玩家进行PK,游戏结束,钓鱼数量最多的玩家,将获得胜利。最后根据钓鱼的数量,你将获得相应的能量石奖励!开始挑战吧!", "questionTextAudio": "http://staging-teach.cdn.ireadabc.com/e422c682ff3304a532937db64573caa4.mp3", "questions": [{ "questionAudio": "http://staging-teach.cdn.ireadabc.com/6d742645880f902efae878facc78da07_l.mp3", "duration": 120, "options": [{ "type": "img", "image": "http://staging-teach.cdn.ireadabc.com/5e0afcb2626cb97395fa80688d0da26e.png", "audio": "http://staging-teach.cdn.ireadabc.com/a5fb06cfafd5c74d143d00b8cafbed2e_l.mp3", "text": "push", "right": false, "audioName": "正确.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/d1905036a1cbe59e269641576bf025cb.png", "audio": "http://staging-teach.cdn.ireadabc.com/141bd6c7ce281deb3c2a6ceb66e2148e_l.mp3", "text": "yun", "right": false, "audioName": "错误.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/65732948abd635b143bcca6bf30e1ae3.png", "audio": "http://staging-teach.cdn.ireadabc.com/5eeac1448c75db6dda78519ae7986dd2_l.mp3", "text": "right", "right": false, "audioName": "星星变虎头.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/017549d06d93f449af1ca4e1306cc970.png", "audio": "http://staging-teach.cdn.ireadabc.com/6d742645880f902efae878facc78da07_l.mp3", "text": "star", "right": false, "audioName": "请在5秒内说出正确答案.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/5e0afcb2626cb97395fa80688d0da26e.png", "audio": "", "text": "123", "right": false }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/e6ea7e0efa41ddfbcbbd6e01581a1d2f.png", "audio": "", "text": "123", "right": false }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/e6ea7e0efa41ddfbcbbd6e01581a1d2f.png", "audio": "", "text": "123", "right": false }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/5e0afcb2626cb97395fa80688d0da26e.png", "audio": "", "text": "123", "right": false }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/e6ea7e0efa41ddfbcbbd6e01581a1d2f.png", "audio": "", "text": "123", "right": false }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/5e0afcb2626cb97395fa80688d0da26e.png", "audio": "", "text": "123", "right": false }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/65732948abd635b143bcca6bf30e1ae3.png", "audio": "http://staging-teach.cdn.ireadabc.com/5eeac1448c75db6dda78519ae7986dd2_l.mp3", "text": "right", "right": false, "audioName": "星星变虎头.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/d1905036a1cbe59e269641576bf025cb.png", "audio": "http://staging-teach.cdn.ireadabc.com/141bd6c7ce281deb3c2a6ceb66e2148e_l.mp3", "text": "yun", "right": false, "audioName": "错误.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/65732948abd635b143bcca6bf30e1ae3.png", "audio": "http://staging-teach.cdn.ireadabc.com/5eeac1448c75db6dda78519ae7986dd2_l.mp3", "text": "right", "right": false, "audioName": "星星变虎头.mp3" }], "audioName": "请在5秒内说出正确答案.mp3" }], "bgAudio": "", "bgAudioName": "", "audioName": "" }
{ "onlineFlg": false, "title": "钓鱼大作战", "questionText": "海洋里有很多鱼,每条鱼身上都藏着魔法信息!亲爱的小玩家,请仔细听游戏指令,找到含有正确魔法信息的鱼,快速完成钓鱼。 在本次的游戏中,你将和其他玩家进行PK,游戏结束,钓鱼数量最多的玩家,将获得胜利。最后根据钓鱼的数量,你将获得相应的能量石奖励!开始挑战吧!", "questionTextAudio": "http://staging-teach.cdn.ireadabc.com/e422c682ff3304a532937db64573caa4.mp3", "questions": [{ "questionAudio": "http://staging-teach.cdn.ireadabc.com/cb76dbc838567b58e2af36e2d2faa923_l.mp3", "duration": 120, "options": [{ "type": "", "image": "http://staging-teach.cdn.ireadabc.com/3a7fdd71c900985e8f493d8e4035bf84.png", "audio": "http://staging-teach.cdn.ireadabc.com/c9db9c8f9c256b928a7f0e1498963404_l.mp3", "text": "111", "right": false, "audioName": "ready go.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/017549d06d93f449af1ca4e1306cc970.png", "audio": "http://staging-teach.cdn.ireadabc.com/c9db9c8f9c256b928a7f0e1498963404_l.mp3", "text": "222", "right": false, "audioName": "ready go.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/65732948abd635b143bcca6bf30e1ae3.png", "audio": "http://staging-teach.cdn.ireadabc.com/5eeac1448c75db6dda78519ae7986dd2_l.mp3", "text": "333", "right": false, "audioName": "星星变虎头.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/c08d44585d0846bfe0fd8e923425d6a2.png", "audio": "http://staging-teach.cdn.ireadabc.com/5eeac1448c75db6dda78519ae7986dd2_l.mp3", "text": "444", "right": false, "audioName": "星星变虎头.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/e6ea7e0efa41ddfbcbbd6e01581a1d2f.png", "audio": "http://staging-teach.cdn.ireadabc.com/cb76dbc838567b58e2af36e2d2faa923_l.mp3", "text": "555", "right": false, "audioName": "图片卡片出现.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/3a7fdd71c900985e8f493d8e4035bf84.png", "audio": "http://staging-teach.cdn.ireadabc.com/c9db9c8f9c256b928a7f0e1498963404_l.mp3", "text": "111", "right": false, "audioName": "ready go.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/017549d06d93f449af1ca4e1306cc970.png", "audio": "http://staging-teach.cdn.ireadabc.com/c9db9c8f9c256b928a7f0e1498963404_l.mp3", "text": "222", "right": false, "audioName": "ready go.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/65732948abd635b143bcca6bf30e1ae3.png", "audio": "http://staging-teach.cdn.ireadabc.com/5eeac1448c75db6dda78519ae7986dd2_l.mp3", "text": "333", "right": false, "audioName": "星星变虎头.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/c08d44585d0846bfe0fd8e923425d6a2.png", "audio": "http://staging-teach.cdn.ireadabc.com/5eeac1448c75db6dda78519ae7986dd2_l.mp3", "text": "444", "right": false, "audioName": "星星变虎头.mp3" }, { "type": "", "image": "http://staging-teach.cdn.ireadabc.com/e6ea7e0efa41ddfbcbbd6e01581a1d2f.png", "audio": "http://staging-teach.cdn.ireadabc.com/cb76dbc838567b58e2af36e2d2faa923_l.mp3", "text": "555", "right": false, "audioName": "图片卡片出现.mp3" }], "audioName": "图片卡片出现.mp3" }], "bgAudio": "", "bgAudioName": "", "audioName": "" }
// {
// "recordFlag": true,
......
......@@ -204,7 +204,7 @@
</div>
</div>
<div class="option-text">
<div style="width: 200px">
<div style="width: 200px">
<span style="font-size: 20px;">文本</span>
<input type="text" nz-input [(ngModel)]="option.text" (blur)="save()">
</div>
......@@ -249,8 +249,8 @@
</div>
<!-- <button class="btn-blue" style="margin-top:10px;width: 1000px; height: 50px;" nz-button nzType="default" nzDanger
(click)="addquestion()">+增加题目</button> -->
<!-- <button class="btn-blue" style="margin-top:10px;width: 1000px; height: 50px;"
nz-button nzType="default" nzDanger (click)="addquestion()">+增加题目</button> -->
</div>
......
......@@ -16,7 +16,11 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
title: "钓鱼大作战",
questionText: "海洋里有很多鱼,每条鱼身上都藏着魔法信息!亲爱的小玩家,请仔细听游戏指令,找到含有正确魔法信息的鱼,快速完成钓鱼。 在本次的游戏中,你将和其他玩家进行PK,游戏结束,钓鱼数量最多的玩家,将获得胜利。最后根据钓鱼的数量,你将获得相应的能量石奖励!开始挑战吧!",
questionTextAudio: "http://staging-teach.cdn.ireadabc.com/e422c682ff3304a532937db64573caa4.mp3",
questions: [],
questions: [{
questionAudio: "",
duration: 120,
options: []
}],
bgAudio: "",
bgAudioName: "",
audioName: ""
......
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