Commit dd7329ff authored by Tt's avatar Tt

背景处理完成

parent b5a53f3b
This diff is collapsed.
...@@ -125,6 +125,15 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -125,6 +125,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc.find("layout_info/label_title", this.node).getComponent(cc.Label).string = Game.getIns().title; cc.find("layout_info/label_title", this.node).getComponent(cc.Label).string = Game.getIns().title;
} }
} }
initBg() {
// 处理背景及自动的动画
}
initEvent() { initEvent() {
this.btn_laba.on(cc.Node.EventType.TOUCH_END, this.playLaba, this); this.btn_laba.on(cc.Node.EventType.TOUCH_END, this.playLaba, this);
this.btn_record.on(cc.Node.EventType.TOUCH_END, this.onTouchRecord, this); this.btn_record.on(cc.Node.EventType.TOUCH_END, this.onTouchRecord, this);
...@@ -176,20 +185,19 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -176,20 +185,19 @@ export default class SceneComponent extends MyCocosSceneComponent {
private intervalId; private intervalId;
private playLaba() { private playLaba() {
let btn_kaba2 = this.btn_laba.getChildByName("btn_laba2"); let btn_kaba2 = this.btn_laba.getChildByName("btn_laba2");
let btn_kaba3 = this.btn_laba.getChildByName("btn_laba3");
btn_kaba2.active = true; btn_kaba2.active = true;
btn_kaba3.active = true;
cc.audioEngine.stopAllEffects(); cc.audioEngine.stopAllEffects();
let count = 0; let count = 0;
if (this.intervalId) clearInterval(this.intervalId); if (this.intervalId) clearInterval(this.intervalId);
let stop = false; let stop = false;
this.intervalId = setInterval(() => { this.intervalId = setInterval(() => {
count++; count++;
btn_kaba3.active = count % 3 == 2; btn_kaba2.active = count % 2 == 0;
if (stop && count % 3 == 2) { if (stop && count % 2 == 1) {
clearInterval(this.intervalId); clearInterval(this.intervalId);
btn_kaba2.active = false; btn_kaba2.active = false;
btn_kaba3.active = false; } else {
} }
}, 150) }, 150)
...@@ -474,7 +482,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -474,7 +482,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
private updateTop() { private updateTop() {
let round = cc.find("layout_info/bg_number/round", this.node); let round = cc.find("layout_info/bg_number/round", this.node);
round.getComponent(cc.Label).string = `${this.starData.id}/${Game.getIns().total}`; round.getComponent(cc.Label).string = `${this.starData.id}/${Game.getIns().total}`;
......
// 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 fishs extends cc.Component {
@property
public left2Right: boolean = false;
@property
public index: number = 1;
// 花费时间
@property
public costTime: number = 10;
// 花费时间
@property
public waitTime: number = 3;
// 起始位置
private startPos: cc.Vec2;
// 结束位置
private endPos: cc.Vec2;
private leftPos: Array<cc.Vec2> = [cc.v2(-1400, 120), cc.v2(-1200, 360), cc.v2(-1200, 20)];
private rightPos: Array<cc.Vec2> = [cc.v2(1400, 120), cc.v2(1200, 360), cc.v2(1200, 20)];
private timer: any;
onLoad() {
// 默认位置在左侧
this.startPos = this.left2Right ? this.leftPos[this.index - 1] : this.rightPos[this.index - 1];
this.endPos = this.left2Right ? this.rightPos[this.index - 1] : this.leftPos[this.index - 1];
this.timer = setTimeout(() => {
this.startMove();
}, this.waitTime * 1000);
}
startMove() {
this.node.setPosition(this.startPos);
cc.tween(this.node).to(this.costTime, { x: this.endPos.x, y: this.endPos.y }).start();
this.timer = setTimeout(() => {
this.startMove();
}, this.costTime * 1000 + 100);
}
stopMove() {
cc.Tween.stopAllByTarget(this.node);
this.timer && clearTimeout(this.timer);
}
start() {
}
update(dt) {
}
}
{
"ver": "1.0.8",
"uuid": "40dd61ad-4825-4230-bb16-9dd015f2a025",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
assets/dg08_hx/textures/bg_number.png

6.32 KB | W: | H:

assets/dg08_hx/textures/bg_number.png

2.01 KB | W: | H:

assets/dg08_hx/textures/bg_number.png
assets/dg08_hx/textures/bg_number.png
assets/dg08_hx/textures/bg_number.png
assets/dg08_hx/textures/bg_number.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 520, "width": 264,
"height": 143, "height": 85,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg_number": { "bg_number": {
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 520, "width": 264,
"height": 143, "height": 85,
"rawWidth": 520, "rawWidth": 264,
"rawHeight": 143, "rawHeight": 85,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "29059c48-8c90-49fe-ac72-295b4058da30",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 147,
"height": 114,
"platformSettings": {},
"subMetas": {
"bg_title": {
"ver": "1.0.4",
"uuid": "53786c4f-7a97-4be3-9593-eaff4c963e3b",
"rawTextureUuid": "29059c48-8c90-49fe-ac72-295b4058da30",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 147,
"height": 114,
"rawWidth": 147,
"rawHeight": 114,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "c6bae2ef-348e-402d-9f07-37725e327e44",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "2f71e0e6-cc9c-4ad1-82a4-1b6464e6a1f7",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1920,
"height": 1080,
"platformSettings": {},
"subMetas": {
"bg": {
"ver": "1.0.4",
"uuid": "7cd29f22-f219-462b-9f4b-6090e02d2663",
"rawTextureUuid": "2f71e0e6-cc9c-4ad1-82a4-1b6464e6a1f7",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1920,
"height": 1080,
"rawWidth": 1920,
"rawHeight": 1080,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "6f03c1be-590d-4d4c-b482-1ca8b778137d",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 679,
"height": 463,
"platformSettings": {},
"subMetas": {
"bg_left_cover": {
"ver": "1.0.4",
"uuid": "ab65787c-a9fa-4053-9dc4-446d75917abd",
"rawTextureUuid": "6f03c1be-590d-4d4c-b482-1ca8b778137d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 679,
"height": 463,
"rawWidth": 679,
"rawHeight": 463,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "457784ed-26ba-4d20-beea-8e2984287d45",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 145,
"height": 89,
"platformSettings": {},
"subMetas": {
"bg_star": {
"ver": "1.0.4",
"uuid": "6a9d0a56-2805-4405-bf33-a20d5a529e41",
"rawTextureUuid": "457784ed-26ba-4d20-beea-8e2984287d45",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 145,
"height": 89,
"rawWidth": 145,
"rawHeight": 89,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "cb77b25f-88a3-41c0-9719-bffdfd852a96",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 708,
"height": 471,
"platformSettings": {},
"subMetas": {
"fish_1": {
"ver": "1.0.4",
"uuid": "5ef654e1-8428-4158-9221-08d077bc5fed",
"rawTextureUuid": "cb77b25f-88a3-41c0-9719-bffdfd852a96",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 708,
"height": 471,
"rawWidth": 708,
"rawHeight": 471,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "5aeb4564-8148-4916-8891-b262017a8c13",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 260,
"height": 164,
"platformSettings": {},
"subMetas": {
"fish_2": {
"ver": "1.0.4",
"uuid": "052629d9-552a-420b-956e-630e6d5ef839",
"rawTextureUuid": "5aeb4564-8148-4916-8891-b262017a8c13",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 260,
"height": 164,
"rawWidth": 260,
"rawHeight": 164,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "c1beb000-67e2-44bc-9223-2f0fbecd9f4c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 259,
"height": 156,
"platformSettings": {},
"subMetas": {
"fish_3": {
"ver": "1.0.4",
"uuid": "84f1662b-a147-463b-985c-8facd7cb7704",
"rawTextureUuid": "c1beb000-67e2-44bc-9223-2f0fbecd9f4c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 259,
"height": 156,
"rawWidth": 259,
"rawHeight": 156,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/dg08_hx/textures/btn_laba.png

9.48 KB | W: | H:

assets/dg08_hx/textures/btn_laba.png

14 KB | W: | H:

assets/dg08_hx/textures/btn_laba.png
assets/dg08_hx/textures/btn_laba.png
assets/dg08_hx/textures/btn_laba.png
assets/dg08_hx/textures/btn_laba.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 131, "width": 141,
"height": 131, "height": 120,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_laba": { "btn_laba": {
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 131, "width": 141,
"height": 131, "height": 120,
"rawWidth": 131, "rawWidth": 141,
"rawHeight": 131, "rawHeight": 120,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
assets/dg08_hx/textures/btn_laba2.png

1.64 KB | W: | H:

assets/dg08_hx/textures/btn_laba2.png

17.4 KB | W: | H:

assets/dg08_hx/textures/btn_laba2.png
assets/dg08_hx/textures/btn_laba2.png
assets/dg08_hx/textures/btn_laba2.png
assets/dg08_hx/textures/btn_laba2.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 131, "width": 163,
"height": 131, "height": 149,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_laba2": { "btn_laba2": {
...@@ -18,14 +18,14 @@ ...@@ -18,14 +18,14 @@
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": -32, "offsetX": 0,
"offsetY": -1.5, "offsetY": 0,
"trimX": 23, "trimX": 0,
"trimY": 55, "trimY": 0,
"width": 21, "width": 163,
"height": 24, "height": 149,
"rawWidth": 131, "rawWidth": 163,
"rawHeight": 131, "rawHeight": 149,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
"ver": "1.1.2",
"uuid": "dcea346a-01bd-47ce-88ef-df96b2f78ee4",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "fd1d125d-d0e5-4126-83be-8ea88955eca2",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 521,
"height": 351,
"platformSettings": {},
"subMetas": {
"btn_fish": {
"ver": "1.0.4",
"uuid": "1e1c4847-a65b-4c3b-a30d-d9d8b2e40b81",
"rawTextureUuid": "fd1d125d-d0e5-4126-83be-8ea88955eca2",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 521,
"height": 351,
"rawWidth": 521,
"rawHeight": 351,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "8ade620e-39d4-4e83-81d4-9e156e8973fc",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 418,
"height": 419,
"platformSettings": {},
"subMetas": {
"btn_poper": {
"ver": "1.0.4",
"uuid": "481b840e-a6a4-4fe8-bbbf-5f09690249a6",
"rawTextureUuid": "8ade620e-39d4-4e83-81d4-9e156e8973fc",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 418,
"height": 419,
"rawWidth": 418,
"rawHeight": 419,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "0053e14d-fa4a-4c20-8995-c61d6d9a3f11",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 483,
"height": 472,
"platformSettings": {},
"subMetas": {
"btn_poper_break": {
"ver": "1.0.4",
"uuid": "816d5845-0aef-4607-a5cd-eec0a5dda30d",
"rawTextureUuid": "0053e14d-fa4a-4c20-8995-c61d6d9a3f11",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 483,
"height": 472,
"rawWidth": 483,
"rawHeight": 472,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "a67ed0c1-ef93-4d17-9b2c-f31d6d952c19",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1920,
"height": 1080,
"platformSettings": {},
"subMetas": {
"view": {
"ver": "1.0.4",
"uuid": "484fb17c-1ff2-4b9c-8fb4-e66fa85ed7d5",
"rawTextureUuid": "a67ed0c1-ef93-4d17-9b2c-f31d6d952c19",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1920,
"height": 1080,
"rawWidth": 1920,
"rawHeight": 1080,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
This diff is collapsed.
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
"experimentalDecorators": true, "experimentalDecorators": true,
"skipLibCheck": true, "skipLibCheck": true,
"outDir": "temp/vscode-dist", "outDir": "temp/vscode-dist",
"allowJs": true,
"forceConsistentCasingInFileNames": true "forceConsistentCasingInFileNames": true
}, },
"exclude": [ "exclude": [
......
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