Commit 828ebdc3 authored by Tt's avatar Tt

电池完成

parent c7e07b31
{
"ver": "2.0.1",
"uuid": "d9005b3f-48e6-4f3f-89d4-0d554e5badc2",
"downloadMode": 0,
"duration": 1.880816,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "69587344-7bb2-4de2-bb77-6332cf7c8a85",
"downloadMode": 0,
"duration": 1.9346,
"subMetas": {}
}
\ No newline at end of file
{ {
"ver": "2.0.1", "ver": "2.0.1",
"uuid": "3cb2ea31-aef0-4ba5-8575-0af1a99dccee", "uuid": "264c5afb-d4da-4369-9909-bf9608b19ee7",
"downloadMode": 0, "downloadMode": 0,
"duration": 1.48898, "duration": 1.48898,
"subMetas": {} "subMetas": {}
......
{
"ver": "2.0.1",
"uuid": "45d19155-b425-40f9-8f22-28081fe78a5f",
"downloadMode": 0,
"duration": 2.821224,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.1",
"uuid": "7f3f5b5c-1d1b-4f98-a7fd-b733ea11c96e",
"downloadMode": 0,
"duration": 0.428,
"subMetas": {}
}
\ No newline at end of file
// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
const { ccclass, property } = cc._decorator;
@ccclass
export default class NewClass extends cc.Component {
private img_1: cc.Node;
private img_2: cc.Node;
private count: number;
onLoad() {
this.count = 0;
this.img_1 = this.node.getChildByName('img_1')
this.img_2 = this.node.getChildByName('img_2')
this.img_1.active = true;
this.img_2.active = true;
cc.tween(this.img_1).repeatForever(
cc.tween().to(0.25, { opacity: 0 }).to(0.25, { opacity: 255 })
).start();
this.scheduleOnce(() => {
cc.tween(this.img_2).repeatForever(
cc.tween().to(0.25, { opacity: 0 }).to(0.25, { opacity: 255 })
).start();
}, 0.1)
}
update(dt) {
}
}
{
"ver": "1.0.8",
"uuid": "f060d304-ea8f-4da5-9d6c-ae787b0b008d",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
const { ccclass, property } = cc._decorator;
@ccclass
export default class NewClass extends cc.Component {
onLoad() {
let time1 = Math.random() + 1;
let time2 = Math.random() + 1;
cc.tween(this.node).repeatForever(
cc.tween().to(time1, { opacity: 50 }).to(time2, { opacity: 255 })
).start();
}
}
{
"ver": "1.0.8",
"uuid": "cd5bc223-43eb-432d-b7dd-55c412c59aa5",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
...@@ -74,10 +74,24 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -74,10 +74,24 @@ export default class SceneComponent extends MyCocosSceneComponent {
@property(cc.Node) layout_battery_right: cc.Node = null; @property(cc.Node) layout_battery_right: cc.Node = null;
@property(cc.Node) item_battery_text: cc.Node = null; @property(cc.Node) item_battery_text: cc.Node = null;
@property(cc.Node) item_battery_img: cc.Node = null; @property(cc.Node) item_battery_img: cc.Node = null;
@property(cc.Node) img_left: cc.Node = null;
@property(cc.Node) img_right: cc.Node = null;
initCanvas() { initCanvas() {
let img = pg.view.find(this.layout_canvas, 'img'); let img = pg.view.find(this.layout_canvas, 'img');
pg.view.setNetImg(img, this.currentQuestion.bgItem.url, { w: 1220, h: 790 }, false) pg.view.setNetImg(img, this.currentQuestion.bgItem.url, { w: 1220, h: 790 }, false)
if (this.current == 0) {
this.playLocalAudio('opendoor')
let img_door_left = pg.view.find(this.layout_canvas, 'img_door_left')
let img_door_right = pg.view.find(this.layout_canvas, 'img_door_right')
this.img_left.active = true;
this.img_right.active = true;
cc.tween(img_door_left).to(1.6, { x: -1000 }).call(() => {
this.img_left.active = false;
this.img_right.active = false;
}).start();
cc.tween(img_door_right).to(1.6, { x: 1000 }).start();
}
this.initTargets(); this.initTargets();
} }
initTargets() { initTargets() {
...@@ -107,6 +121,15 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -107,6 +121,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
let hotZoneItemArr = this.currentQuestion.hotZoneItemArr let hotZoneItemArr = this.currentQuestion.hotZoneItemArr
let lineNum = Math.ceil(hotZoneItemArr.length / 2) let lineNum = Math.ceil(hotZoneItemArr.length / 2)
let lastY = null; let lastY = null;
let delayTime = 1.5;
if (this.current == 0) {
this.scheduleOnce(() => {
this.playLocalAudio('bettery')
}, delayTime)
} else {
this.playLocalAudio('bettery')
}
hotZoneItemArr.forEach((data, i) => { hotZoneItemArr.forEach((data, i) => {
let isleft = i + 1 <= lineNum let isleft = i + 1 <= lineNum
let layout = isleft ? this.layout_battery_left : this.layout_battery_right; let layout = isleft ? this.layout_battery_left : this.layout_battery_right;
...@@ -129,15 +152,24 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -129,15 +152,24 @@ export default class SceneComponent extends MyCocosSceneComponent {
let sid = (i + 1) % 4 + 1 let sid = (i + 1) % 4 + 1
pg.view.visible(pg.view.find(item, 'bg/img_battery' + sid), true) pg.view.visible(pg.view.find(item, 'bg/img_battery' + sid), true)
item.x = -400; item.x = -400;
if (this.current == 0) {
cc.tween(item).delay(delayTime).to(0.5, { x: 0 }).start();
} else {
cc.tween(item).to(0.5, { x: 0 }).start(); cc.tween(item).to(0.5, { x: 0 }).start();
}
} else { } else {
// 右侧 // 右侧
let sid = (i + 1 - lineNum) % 2 + 5 let sid = (i + 1 - lineNum) % 2 + 5
pg.view.visible(pg.view.find(item, 'bg/img_battery' + sid), true) pg.view.visible(pg.view.find(item, 'bg/img_battery' + sid), true)
item_text.x = 20 item_text.x = 20
item.x = 400; item.x = 400;
if (this.current == 0) {
cc.tween(item).delay(delayTime).to(0.5, { x: 0 }).start();
} else {
cc.tween(item).to(0.5, { x: 0 }).start(); cc.tween(item).to(0.5, { x: 0 }).start();
} }
}
if (!lastY && lastY != 0) lastY = orgPosY; if (!lastY && lastY != 0) lastY = orgPosY;
item.y = lastY -= spaceTextY; item.y = lastY -= spaceTextY;
layout.addChild(item); layout.addChild(item);
...@@ -161,12 +193,20 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -161,12 +193,20 @@ export default class SceneComponent extends MyCocosSceneComponent {
if (isleft) { if (isleft) {
// 左侧 // 左侧
item.x = -400; item.x = -400;
if (this.current == 0) {
cc.tween(item).delay(delayTime).to(0.5, { x: 0 }).start();
} else {
cc.tween(item).to(0.5, { x: 0 }).start(); cc.tween(item).to(0.5, { x: 0 }).start();
}
} else { } else {
// 右侧 // 右侧
item.x = 400; item.x = 400;
if (this.current == 0) {
cc.tween(item).delay(delayTime).to(0.5, { x: 0 }).start();
} else {
cc.tween(item).to(0.5, { x: 0 }).start(); cc.tween(item).to(0.5, { x: 0 }).start();
} }
}
layout.addChild(item); layout.addChild(item);
lastY = item.y; lastY = item.y;
......
{
"ver": "2.3.5",
"uuid": "65a5d744-0ad4-4cd8-a26c-ec6dc6d348ef",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 703,
"height": 791,
"platformSettings": {},
"subMetas": {
"img_door_left": {
"ver": "1.0.4",
"uuid": "c62fba81-5257-46e2-aa59-611c9306fdb2",
"rawTextureUuid": "65a5d744-0ad4-4cd8-a26c-ec6dc6d348ef",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0.5,
"offsetY": -1.5,
"trimX": 1,
"trimY": 3,
"width": 702,
"height": 788,
"rawWidth": 703,
"rawHeight": 791,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "4a1cd86e-c267-47ab-a5c9-5c9e20ca1fe4",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 651,
"height": 791,
"platformSettings": {},
"subMetas": {
"img_door_right": {
"ver": "1.0.4",
"uuid": "cc04aa5b-a500-42a7-b7b5-44ea261d28f3",
"rawTextureUuid": "4a1cd86e-c267-47ab-a5c9-5c9e20ca1fe4",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0.5,
"offsetY": 0,
"trimX": 1,
"trimY": 0,
"width": 650,
"height": 791,
"rawWidth": 651,
"rawHeight": 791,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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