Commit b9432137 authored by Tt's avatar Tt

修改文件名称

parent 5b9a217b
This diff is collapsed.
{
"ver": "1.0.1",
"uuid": "6ea0dfe1-ab9d-4740-95c8-fc2e42be839a",
"subMetas": {}
}
\ No newline at end of file
{"name":"ship","SubTexture":[{"name":"飞船/阴影","x":298,"height":91,"y":159,"width":196},{"name":"飞船/火2","x":99,"height":59,"y":292,"width":42},{"name":"飞船/车","x":1,"height":177,"y":1,"width":295},{"name":"飞船/脸","x":298,"height":156,"y":1,"width":122},{"name":"飞船/眼睛","x":422,"height":18,"y":117,"width":49},{"name":"飞船/嘴-_正确","x":473,"height":15,"y":117,"width":27},{"name":"飞船/嘴-错误","x":488,"height":9,"y":134,"width":7},{"name":"飞船/眉毛","x":422,"height":8,"y":137,"width":64},{"name":"飞船/眼镜","x":1,"height":48,"y":292,"width":96},{"name":"飞船/头发","x":1,"height":110,"y":180,"width":154},{"name":"飞船/窗户","x":157,"height":66,"y":252,"width":147},{"name":"飞船/助推","x":422,"height":68,"y":1,"width":65},{"name":"飞船/挡板","x":157,"height":67,"y":180,"width":110},{"name":"飞船/火","x":422,"height":44,"y":71,"width":57}],"imagePath":"ship_tex.png","height":512,"width":512}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "8db46c95-192d-4dcd-acd1-e8f30a67f5e1",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "a28026a4-ec03-44b5-9988-d98f811bc24b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 512,
"height": 512,
"platformSettings": {},
"subMetas": {
"ship_tex": {
"ver": "1.0.4",
"uuid": "98276cff-983b-45d9-bf31-b92d8c21d7ec",
"rawTextureUuid": "a28026a4-ec03-44b5-9988-d98f811bc24b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -5.5,
"offsetY": 80,
"trimX": 1,
"trimY": 1,
"width": 499,
"height": 350,
"rawWidth": 512,
"rawHeight": 512,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{"name":"speak","version":"5.5","armature":[{"name":"Armature","slot":[{"name":"椭圆_11","color":{},"parent":"big"},{"name":"椭圆_11_拷贝","color":{},"z":1,"parent":"small"},{"name":"组_1","color":{},"z":2,"parent":"root"}],"defaultActions":[{"gotoAndPlay":"newAnimation"}],"aabb":{"x":-101.5312185134179,"height":204,"y":-101.03171071912247,"width":205},"skin":[{"name":"","slot":[{"name":"组_1","display":[{"name":"提示/组_1","transform":{"x":1.0034,"y":-5.0077},"type":"image","path":"提示/组_1"}]},{"name":"椭圆_11","display":[{"name":"提示/椭圆_11","transform":{"x":1.4845,"skY":-90,"y":-0.9839,"skX":-90},"type":"image","path":"提示/椭圆_11"}]},{"name":"椭圆_11_拷贝","display":[{"name":"提示/椭圆_11_拷贝","transform":{"x":-0.0038,"skY":-179.9215,"y":5.8107,"skX":-179.9215},"type":"image","path":"提示/椭圆_11_拷贝"}]}]}],"animation":[{"name":"newAnimation","frame":[],"bone":[{"name":"root","rotateFrame":[],"translateFrame":[],"scaleFrame":[]},{"name":"big","rotateFrame":[],"translateFrame":[],"scaleFrame":[{"tweenEasing":0,"duration":18},{"x":1.5,"y":1.5,"duration":0}]},{"name":"small","rotateFrame":[],"translateFrame":[],"scaleFrame":[{"tweenEasing":0,"duration":18},{"x":1.4,"y":1.4,"duration":0}]}],"playTimes":0,"ffd":[],"ik":[],"slot":[{"name":"椭圆_11","displayFrame":[],"colorFrame":[{"duration":18,"tweenEasing":0},{"duration":0,"color":{"aM":0}}]},{"name":"椭圆_11_拷贝","displayFrame":[],"colorFrame":[{"duration":18,"tweenEasing":0},{"duration":0,"color":{"aM":12}}]},{"name":"组_1","displayFrame":[],"colorFrame":[]}],"duration":18}],"bone":[{"name":"root","transform":{"x":0.4842,"skY":-0.0188,"y":0.4842,"skX":-0.0188}},{"name":"big","transform":{"x":-0.5,"skY":89.9812,"y":-1,"skX":89.9812},"parent":"root"},{"name":"small","transform":{"x":1.9369,"skY":179.9812,"y":0.0006,"skX":179.9812},"parent":"root"}],"frameRate":24,"type":"Armature","ik":[]}],"frameRate":24,"isGlobal":0}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "76be8bca-84d4-4019-a02a-835019928e37",
"subMetas": {}
}
\ No newline at end of file
{"name":"speak","imagePath":"speak_tex.png","SubTexture":[{"name":"提示/椭圆_11","x":1,"height":204,"y":1,"width":205},{"name":"提示/椭圆_11_拷贝","x":1,"height":156,"y":207,"width":156},{"name":"提示/组_1","x":159,"height":130,"y":207,"width":90}],"height":512,"width":256}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "724cd693-1645-416d-ac29-397389ead319",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "76563d14-5085-45bb-8270-29b75c486951",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 256,
"height": 512,
"platformSettings": {},
"subMetas": {
"speak_tex": {
"ver": "1.0.4",
"uuid": "f209e359-54f1-4bf0-acd9-54bb7bff5bda",
"rawTextureUuid": "76563d14-5085-45bb-8270-29b75c486951",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -3,
"offsetY": 74,
"trimX": 1,
"trimY": 1,
"width": 248,
"height": 362,
"rawWidth": 256,
"rawHeight": 512,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "7a607272-5b59-4724-b784-0beb57493e76",
"downloadMode": 0,
"duration": 0.470204,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "cf96d38a-46f8-4c6c-8e8f-3c474d25aa6a",
"downloadMode": 0,
"duration": 0.313469,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "1adfbf9a-97c7-4213-a661-24d67f5eecb5",
"downloadMode": 0,
"duration": 4.231837,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "a26c5dc8-46ef-4f7a-845e-13409f150262",
"downloadMode": 0,
"duration": 0.809796,
"subMetas": {}
}
\ No newline at end of file
import { asyncDelay, onHomeworkFinish, RandomInt } from "../script/util";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent";
import Game, { FISH_OUT, GAME_STATE, Option, Question } from "./tool/Game";
import Game, { GAME_STATE, Option, Question } from "./tool/dg10Game";
import pg from "./tool/pg";
const { ccclass, property } = cc._decorator;
......@@ -173,8 +173,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
Game.getIns().state = GAME_STATE.OVER;
let data: any = {};
data.total = Game.getIns().total;
data.right = Game.getIns().player.right;
data.scores = Game.getIns().player.voices;
data.stone = Math.floor(10 * data.right / data.total);
this.log("total: " + data.total + " right: " + data.right + " stone: " + data.stone);
onHomeworkFinish(data)
......@@ -202,18 +200,21 @@ export default class SceneComponent extends MyCocosSceneComponent {
list.forEach((li, index) => {
let targetPos = pg.view.coverPosition(layouts.children[index], layout_play);
// 获取设置item位置
let it = cc.instantiate(item);
let it = cc.instantiate(item)
it.active = true;
it.opacity = 0;
it.scale = 0.2;
layout_play.addChild(it);
layout_play.addChild(it)
it.x = startPos.x;
it.y = startPos.y;
this.updateItem(it, li);
this.updateItem(it, li)
cc.tween(it)
.delay(index * 0.2)
.call(() => {
this.playLocalAudio('fish_bubble')
})
.to(0.3, { x: targetPos.x, y: targetPos.y, scale: 1, opacity: 255 })
.start();
.start()
})
}
updateItem(item, data: Option) {
......@@ -261,12 +262,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg.view.visible(btn_poper, false);
pg.view.visible(btn_poper_break, true);
this.starData.addRight(data);
this.playLocalAudio('fish_right')
if (this.starData.checkRight()) {
setTimeout(() => {
this.nextstar();
}, 1000);
}
} else {
this.playLocalAudio('fish_error')
cc.tween(item).by(0.1, { x: -10 }).by(0.1, { x: 10 }).by(0.1, { x: 10 }).by(0.1, { x: -10 }).start();
}
}
......@@ -311,6 +314,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
Game.getIns().addPage();
this.starData = Game.getIns().getCurrentPage();
if (this.starData) {
this.playLocalAudio('fish_next')
this.gameStart()
} else {
this.startSecond = false;
......@@ -381,12 +385,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
private async startTime() {
// for (let i = 3; i >= 0; i--) {
// let target = cc.find("layout_start/text_" + i, this.node);
// if (i == 0) this.playLocalAudio("go")
// else this.playLocalAudio("count")
// await this.startTextAction(target);
// }
for (let i = 3; i >= 0; i--) {
let target = cc.find("layout_start/text_" + i, this.node);
if (i == 0) this.playLocalAudio("go")
else this.playLocalAudio("count")
await this.startTextAction(target);
}
this.gameStart();
}
private startTextAction(target) {
......
export enum FISH_OUT {
RUNNING,
TOUCH,
CATCH,
ESCAP,
OUT
}
export class Fish {
public isOut: number;
public node: cc.Node;
public isLeft: boolean;//在左侧 向右运动
constructor() {
this.isOut = 0;
this.isLeft = Math.random() < 0.5;
}
}
export class Option {
public type: string;
public image: string;
......@@ -43,13 +26,10 @@ export class Question {
public rights: Array<Option>;
constructor(data, id) {
this.id = id;
// this.type = data.type;
this.count = 0;
this.txt = data.text;
this.time = data.duration;
// this.picUrl = data.image;
this.audioUrl = data.audio;
// this.right = data.right;
this.touchRight = false;
this.rights = [];
this.options = data.options.map(op => new Option(op))
......@@ -62,79 +42,6 @@ export class Question {
return this.rights.length >= rights.length
}
}
export class Item {
public page;
public audio;
public duration;
public optionList;
public checkMore: boolean;
public rNum: number;
constructor(data, page) {
this.audio = data.questionAudio;
this.duration = data.duration;
let id = 0;
// this.optionList = data.options.map(o => {
// return new Option(o);
// })
this.optionList.sort(function () {
return (0.5 - Math.random());
});
this.rNum = 0;
for (let i = 0; i < this.optionList.length; i++) {
if (this.optionList[i].right) this.rNum++;
}
this.checkMore = this.rNum > 1;
this.page = page;
}
}
class Role {
public score: number;
public right: number;
public error: number;
public voices: Array<any>;
constructor() {
this.score = 0;
this.error = 0;
this.right = 0;
this.voices = [];
}
addScore(score: number = 1) {
this.score += score;
}
addError(score: number = 1) {
this.error += score;
}
addRight() {
this.right += 1;
}
addVoice(obj: any) {
this.voices.push(obj);
}
}
export class Player extends Role {
constructor() {
super();
}
reset() {
this.score = 0;
this.error = 0;
this.right = 0;
this.voices = [];
}
}
export class Robot extends Role {
constructor() {
super();
}
reset() {
this.score = 0;
this.error = 0;
this.right = 0;
this.voices = [];
}
}
export enum GAME_STATE {
WAIT,
RUNNING,
......@@ -148,16 +55,12 @@ export default class Game {
}
private data: any;
private lists: Array<Question>
public player: Player;
public robot: Robot;
public state: GAME_STATE;
public total: number;
constructor() {
this.start = false;
this.lists = [];
this.player = new Player();
this.robot = new Robot();
this.state = GAME_STATE.WAIT;
}
get len() {
......@@ -181,8 +84,6 @@ export default class Game {
public start: boolean;
public idx: number;
reset() {
this.player.reset();
this.robot.reset();
this.idx = 0;
this.start = true;
this.lists = [];
......@@ -193,17 +94,6 @@ export default class Game {
this.state = GAME_STATE.WAIT;
this.total = this.lists.length;
}
// public getCardInfo() {
// let option: Question = this.lists.splice(0, 1)[0];
// // if (this.lists.length > 0) {
// // let random = Math.floor(Math.random() * this.lists.length);
// // option = this.lists.splice(random, 1)[0];
// // } else {
// // option = null;
// // }
// console.log(" this.cardInfo=======", option)
// return option;
// }
getCurrentPage(): Question {
return this.lists[this.idx];
}
......@@ -218,11 +108,6 @@ export default class Game {
}
get getTotal() {
return this.lists.length;
// this.total = 0;
// this.lists.forEach((item) => {
// this.total += item.rNum;
// })
// return this.total;
}
get isOver() {
return this.idx > this.lists.length;
......
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