Commit 8b16b7cb authored by 杨一航's avatar 杨一航

鸭子动画

parent 3f6897c1
{ {
"ver": "1.1.2", "ver": "1.1.2",
"uuid": "a9782130-6dec-43e5-b21f-7134bf473a98", "uuid": "b57f5fe8-2854-40a5-957d-cf3ca1b80b1e",
"isBundle": false, "isBundle": false,
"bundleName": "", "bundleName": "",
"priority": 1, "priority": 1,
......
{
"__type__": "cc.AnimationClip",
"_name": "ducks",
"_objFlags": 0,
"_native": "",
"_duration": 1.4833333333333334,
"sample": 60,
"speed": 1,
"wrapMode": 2,
"curveData": {
"props": {
"opacity": [
{
"frame": 0,
"value": 255
},
{
"frame": 0.5,
"value": 0
},
{
"frame": 1.4833333333333334,
"value": 255
}
]
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.0",
"uuid": "665495ee-14da-4c09-8c5d-60c29b1ae0e2",
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
...@@ -20,6 +20,21 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -20,6 +20,21 @@ export default class SceneComponent extends MyCocosSceneComponent {
cover = null cover = null
@property(cc.Node) @property(cc.Node)
recordCat = null recordCat = null
@property(cc.Node)
duck1 = null
@property(cc.Node)
duck2 = null
@property(cc.Node)
duck1PosList = []
@property(cc.Node)
duck2PosList = []
_cardList: Array<cc.Node> = []; _cardList: Array<cc.Node> = [];
private _isRolling: any; private _isRolling: any;
...@@ -33,6 +48,11 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -33,6 +48,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
private _playingAudio: boolean; private _playingAudio: boolean;
private _canClick: any; private _canClick: any;
private _recordBefore: boolean = false; private _recordBefore: boolean = false;
_duck1To: number;
private _duck1Now: number;
private _duck2To: number;
private _duck2Now: number;
addPreloadImage() { addPreloadImage() {
...@@ -59,8 +79,62 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -59,8 +79,62 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.initData(); this.initData();
this.initView(); this.initView();
this.initListener(); this.initListener();
this.initDuckAni();
} }
initDuckAni() {
// this.duck.position = this.duckPosList[7].position;
this._duck1To = 6;
this._duck1Now = 7;
this._duck2To = 4;
this._duck2Now = 5;
this.duck1Moving()
this.duck2Moving()
}
duck1Moving() {
this.duck1.position = this.duck1PosList[this._duck1Now];
cc.tween(this.duck1).to(10, { x: this.duck1PosList[this._duck1To].x, y: this.duck1PosList[this._duck1To].y }).call(() => {
this._duck1Now = this._duck1To;
this._duck1To = Math.floor(Math.random() * 8);
if (this._duck1To != this._duck1Now) {
this.duck1.angle = 30 - 180 / Math.PI * cc.v2(this.duck1PosList[this._duck1To].x - this.duck1PosList[this._duck1Now].x, this.duck1PosList[this._duck1To].y - this.duck1PosList[this._duck1Now].y).angle(cc.v2(0, 1))
console.log(this.duck1.angle);
}
this.duck1Moving();
}).start()
}
duck2Moving() {
this.duck2.position = this.duck2PosList[this._duck2Now];
cc.tween(this.duck2).to(10, { x: this.duck2PosList[this._duck2To].x, y: this.duck2PosList[this._duck2To].y }).call(() => {
this._duck2Now = this._duck2To;
this._duck2To = Math.floor(Math.random() * 8);
if (this._duck2To != this._duck2Now) {
this.duck2.angle = 30 - 180 / Math.PI * cc.v2(this.duck2PosList[this._duck2To].x - this.duck2PosList[this._duck2Now].x, this.duck2PosList[this._duck2To].y - this.duck2PosList[this._duck2Now].y).angle(cc.v2(0, 1))
console.log(this.duck2.angle);
}
this.duck2Moving();
}).start()
}
_status = { _status = {
state: -1,// -1:未开始 0 准备阶段 1 roll 2 判定 state: -1,// -1:未开始 0 准备阶段 1 roll 2 判定
Red: -1, Red: -1,
......
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "1be5cbd5-0003-45fc-a5d3-045a5d610275", "uuid": "61eda5af-f7df-409e-86e9-5548ded10ff6",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 146, "width": 179,
"height": 175, "height": 175,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"23": { "duck": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "fe048a37-9035-4e32-817b-45587c349333", "uuid": "7e195d69-8ba3-4daa-bad4-5172f7ce387c",
"rawTextureUuid": "1be5cbd5-0003-45fc-a5d3-045a5d610275", "rawTextureUuid": "61eda5af-f7df-409e-86e9-5548ded10ff6",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 146, "width": 179,
"height": 175, "height": 175,
"rawWidth": 146, "rawWidth": 179,
"rawHeight": 175, "rawHeight": 175,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
......
{ {
"ver": "2.3.5", "ver": "2.3.5",
"uuid": "9c10325b-0d43-4724-bcc5-7338540fd267", "uuid": "7b833808-53d9-4225-9177-97f957d1c49f",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 181, "width": 157,
"height": 127, "height": 131,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"12": { "duck1": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "565f0a81-f01f-45e3-b8e5-6159b9063372", "uuid": "374d55c9-0d49-4641-8adb-ff6cd779c2c0",
"rawTextureUuid": "9c10325b-0d43-4724-bcc5-7338540fd267", "rawTextureUuid": "7b833808-53d9-4225-9177-97f957d1c49f",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 0, "offsetX": -2.5,
"offsetY": 0, "offsetY": -12.5,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 25,
"width": 181, "width": 152,
"height": 127, "height": 106,
"rawWidth": 181, "rawWidth": 157,
"rawHeight": 127, "rawHeight": 131,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
"ver": "2.3.5",
"uuid": "2e780f8f-94ce-4b22-9767-d0a50c00f5d4",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 171,
"height": 138,
"platformSettings": {},
"subMetas": {
"1": {
"ver": "1.0.4",
"uuid": "0ad2e1a6-cb32-4dc4-9c27-90e89475060d",
"rawTextureUuid": "2e780f8f-94ce-4b22-9767-d0a50c00f5d4",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 171,
"height": 138,
"rawWidth": 171,
"rawHeight": 138,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "d36a8723-2eb6-4863-8e14-226226ed6546",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 158,
"height": 205,
"platformSettings": {},
"subMetas": {
"10": {
"ver": "1.0.4",
"uuid": "1376cd89-b17d-4cdf-a6b7-4a143f3b7e29",
"rawTextureUuid": "d36a8723-2eb6-4863-8e14-226226ed6546",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 158,
"height": 205,
"rawWidth": 158,
"rawHeight": 205,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "87cfa1b8-c20b-44ce-8327-9957dc7ba84b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 203,
"height": 150,
"platformSettings": {},
"subMetas": {
"11": {
"ver": "1.0.4",
"uuid": "2f716a73-3790-45b4-94ce-dc27af1cbacf",
"rawTextureUuid": "87cfa1b8-c20b-44ce-8327-9957dc7ba84b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 203,
"height": 150,
"rawWidth": 203,
"rawHeight": 150,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "49a3baba-6de3-4527-b436-8d7c58234ce4",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 155,
"height": 165,
"platformSettings": {},
"subMetas": {
"13": {
"ver": "1.0.4",
"uuid": "1cef8b77-a391-4a51-90df-0ec12dc42a85",
"rawTextureUuid": "49a3baba-6de3-4527-b436-8d7c58234ce4",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 155,
"height": 165,
"rawWidth": 155,
"rawHeight": 165,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "533d4de2-8e98-4f38-a5d5-49df263bc86c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 155,
"height": 198,
"platformSettings": {},
"subMetas": {
"14": {
"ver": "1.0.4",
"uuid": "db443c5c-17a9-4714-8121-db9a89c9537f",
"rawTextureUuid": "533d4de2-8e98-4f38-a5d5-49df263bc86c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 155,
"height": 198,
"rawWidth": 155,
"rawHeight": 198,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "c639d868-2ddb-452f-87f2-b252f2744b7c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 167,
"height": 134,
"platformSettings": {},
"subMetas": {
"15": {
"ver": "1.0.4",
"uuid": "9415f333-caf0-44e8-a4bd-3fb01b652496",
"rawTextureUuid": "c639d868-2ddb-452f-87f2-b252f2744b7c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 167,
"height": 134,
"rawWidth": 167,
"rawHeight": 134,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "d718f41d-898f-4a63-b63f-667a6a65e703",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 144,
"height": 160,
"platformSettings": {},
"subMetas": {
"16": {
"ver": "1.0.4",
"uuid": "daa2c6eb-f6d1-4985-a7eb-3848c0970c4a",
"rawTextureUuid": "d718f41d-898f-4a63-b63f-667a6a65e703",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 144,
"height": 160,
"rawWidth": 144,
"rawHeight": 160,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "780cf934-f43c-4e88-9440-7b88fbfcce7f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 158,
"height": 151,
"platformSettings": {},
"subMetas": {
"17": {
"ver": "1.0.4",
"uuid": "cbde4d6e-8c42-4c21-9039-6c6a25fb13f1",
"rawTextureUuid": "780cf934-f43c-4e88-9440-7b88fbfcce7f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 158,
"height": 151,
"rawWidth": 158,
"rawHeight": 151,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "7249295c-661c-4445-8d65-dc119766fd6e",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 190,
"height": 134,
"platformSettings": {},
"subMetas": {
"18": {
"ver": "1.0.4",
"uuid": "8fa3f187-a061-40b4-9fd0-708febda0bab",
"rawTextureUuid": "7249295c-661c-4445-8d65-dc119766fd6e",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 190,
"height": 134,
"rawWidth": 190,
"rawHeight": 134,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "f122757e-6c23-485d-a7fe-bd2106e1a8a4",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 184,
"height": 152,
"platformSettings": {},
"subMetas": {
"19": {
"ver": "1.0.4",
"uuid": "76e8b9a5-8102-48af-b0d0-af70d2e9c758",
"rawTextureUuid": "f122757e-6c23-485d-a7fe-bd2106e1a8a4",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 184,
"height": 152,
"rawWidth": 184,
"rawHeight": 152,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "66e30f4d-2cdc-4eac-88fc-0308c1f97a53",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 172,
"height": 149,
"platformSettings": {},
"subMetas": {
"2": {
"ver": "1.0.4",
"uuid": "b91b631b-f226-433c-8a71-2ec8738d9b65",
"rawTextureUuid": "66e30f4d-2cdc-4eac-88fc-0308c1f97a53",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 172,
"height": 149,
"rawWidth": 172,
"rawHeight": 149,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "1906cd31-bd8b-44aa-8a32-0b572bd86043",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 210,
"height": 151,
"platformSettings": {},
"subMetas": {
"20": {
"ver": "1.0.4",
"uuid": "9d9995fb-e238-457b-afa0-238511e284ce",
"rawTextureUuid": "1906cd31-bd8b-44aa-8a32-0b572bd86043",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 210,
"height": 151,
"rawWidth": 210,
"rawHeight": 151,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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