Commit da901f3e authored by Tt's avatar Tt

修改完成

parent b7a48342
...@@ -15,7 +15,7 @@ export default class boatmove extends cc.Component { ...@@ -15,7 +15,7 @@ export default class boatmove extends cc.Component {
// LIFE-CYCLE CALLBACKS: // LIFE-CYCLE CALLBACKS:
onLoad() { onLoad() {
let mul = 3; let mul = 1.5;
if (this.firstUp) { if (this.firstUp) {
cc.tween(this.node).repeatForever( cc.tween(this.node).repeatForever(
cc.tween() cc.tween()
......
...@@ -15,7 +15,7 @@ export default class netscale extends cc.Component { ...@@ -15,7 +15,7 @@ export default class netscale extends cc.Component {
// LIFE-CYCLE CALLBACKS: // LIFE-CYCLE CALLBACKS:
onLoad() { onLoad() {
let scale = 0.05; let scale = 0.05 * 3;
if (this.firstUp) { if (this.firstUp) {
cc.tween(this.node).repeatForever( cc.tween(this.node).repeatForever(
cc.tween() cc.tween()
......
...@@ -4404,7 +4404,7 @@ ...@@ -4404,7 +4404,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-442.526, -442.526,
-64.271, -29.942,
0, 0,
0, 0,
0, 0,
...@@ -5303,7 +5303,7 @@ ...@@ -5303,7 +5303,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
452.507, 452.507,
-64.271, -29.942,
0, 0,
0, 0,
0, 0,
......
...@@ -196,9 +196,10 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -196,9 +196,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
layout_fish.addChild(node); layout_fish.addChild(node);
this.scheduleOnce(() => { this.scheduleOnce(() => {
this.updateItem(node, fish); this.updateItem(node, fish);
}, index * 12) }, Math.floor(index / 2) * 8 + Math.random())
}); });
} }
private showLeft: boolean;
updateItem(item, data: Option) { updateItem(item, data: Option) {
item.data = data; item.data = data;
console.log(data); console.log(data);
...@@ -211,26 +212,28 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -211,26 +212,28 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
item.active = false; item.active = false;
//左往右 //左往右
if (Math.random() < 0.5) { let sceneWidth = cc.winSize.width;
item.x = -(1920 / 2 + Math.random() * 200) this.showLeft = !this.showLeft
if (this.showLeft) {
item.x = -(sceneWidth / 2 + Math.random() * 200)
item.y = -315 - Math.random() * 150; item.y = -315 - Math.random() * 150;
item.scaleX = -1; item.scaleX = -1;
text.scaleX = -1; text.scaleX = -1;
item.active = true; item.active = true;
cc.tween(item).repeatForever(cc.tween().by(21 * 3, { x: 1920 + 400 }).call(() => { cc.tween(item).repeatForever(cc.tween().by(21 * 3, { x: sceneWidth + 400 }).call(() => {
item.scaleX = -item.scaleX; item.scaleX = -item.scaleX;
text.scaleX = -text.scaleX; text.scaleX = -text.scaleX;
}).by(21 * 3, { x: - 1920 - 400 }).call(() => { }).by(21 * 3, { x: - sceneWidth - 400 }).call(() => {
item.scaleX = -item.scaleX; item.scaleX = -item.scaleX;
text.scaleX = -text.scaleX; text.scaleX = -text.scaleX;
})).start(); })).start();
} else { } else {
item.x = 1920 / 2 + Math.random() * 200 item.x = sceneWidth / 2 + Math.random() * 200
item.y = -315 - Math.random() * 150; item.y = -315 - Math.random() * 150;
item.scaleX = 1; item.scaleX = 1;
text.scaleX = 1; text.scaleX = 1;
item.active = true; item.active = true;
cc.tween(item).repeatForever(cc.tween().by(21 * 3, { x: -1920 - 400 }).call(() => { cc.tween(item).repeatForever(cc.tween().by(21 * 3, { x: -sceneWidth - 400 }).call(() => {
item.scaleX = -item.scaleX; item.scaleX = -item.scaleX;
text.scaleX = -text.scaleX; text.scaleX = -text.scaleX;
}).by(21 * 3, { x: 1920 + 400 }).call(() => { }).by(21 * 3, { x: 1920 + 400 }).call(() => {
...@@ -247,7 +250,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -247,7 +250,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
let item = e.target; let item = e.target;
let location = e.getLocation(); let location = e.getLocation();
cc.Tween.stopAllByTarget(item); cc.Tween.stopAllByTarget(item);
let pos = location.sub(cc.v2(1920 / 2, 1080 / 2)); let pos = location.sub(cc.v2(cc.winSize.width / 2, cc.winSize.height / 2));
item.x = pos.x; item.x = pos.x;
item.y = pos.y; item.y = pos.y;
} }
......
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