Commit a4cdb39c authored by haiyoucuv's avatar haiyoucuv

init

parent 910da6a4
This diff is collapsed.
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "723c169c-3576-43d3-835c-aa0b5fbd954d",
"files": [],
"subMetas": {},
"userData": {}
}
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "356c19c0-b5a4-4d3b-8e2e-6e82e0168a03",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "356c19c0-b5a4-4d3b-8e2e-6e82e0168a03@6c48a",
"displayName": "加速",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "356c19c0-b5a4-4d3b-8e2e-6e82e0168a03",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "356c19c0-b5a4-4d3b-8e2e-6e82e0168a03@f9941",
"displayName": "加速",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 98,
"height": 98,
"rawWidth": 98,
"rawHeight": 98,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-49,
-49,
0,
49,
-49,
0,
-49,
49,
0,
49,
49,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
98,
98,
98,
0,
0,
98,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-49,
-49,
0
],
"maxPos": [
49,
49,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "356c19c0-b5a4-4d3b-8e2e-6e82e0168a03@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "356c19c0-b5a4-4d3b-8e2e-6e82e0168a03@6c48a"
}
}
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "b0074d7f-3919-4a0f-8f92-c879065d55a2",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "b0074d7f-3919-4a0f-8f92-c879065d55a2@6c48a",
"displayName": "加长",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "b0074d7f-3919-4a0f-8f92-c879065d55a2",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "b0074d7f-3919-4a0f-8f92-c879065d55a2@f9941",
"displayName": "加长",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 98,
"height": 98,
"rawWidth": 98,
"rawHeight": 98,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-49,
-49,
0,
49,
-49,
0,
-49,
49,
0,
49,
49,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
98,
98,
98,
0,
0,
98,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-49,
-49,
0
],
"maxPos": [
49,
49,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "b0074d7f-3919-4a0f-8f92-c879065d55a2@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "b0074d7f-3919-4a0f-8f92-c879065d55a2@6c48a"
}
}
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "d707ad26-6f87-4c6e-9833-e1ce3560e851",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "d707ad26-6f87-4c6e-9833-e1ce3560e851@6c48a",
"displayName": "双倍经验",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "d707ad26-6f87-4c6e-9833-e1ce3560e851",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "d707ad26-6f87-4c6e-9833-e1ce3560e851@f9941",
"displayName": "双倍经验",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 98,
"height": 98,
"rawWidth": 98,
"rawHeight": 98,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-49,
-49,
0,
49,
-49,
0,
-49,
49,
0,
49,
49,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
98,
98,
98,
0,
0,
98,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-49,
-49,
0
],
"maxPos": [
49,
49,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "d707ad26-6f87-4c6e-9833-e1ce3560e851@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "d707ad26-6f87-4c6e-9833-e1ce3560e851@6c48a"
}
}
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "13b1f478-e4ca-4a54-9910-58e6fb4c3fcd",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "13b1f478-e4ca-4a54-9910-58e6fb4c3fcd@6c48a",
"displayName": "护盾",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "13b1f478-e4ca-4a54-9910-58e6fb4c3fcd",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "13b1f478-e4ca-4a54-9910-58e6fb4c3fcd@f9941",
"displayName": "护盾",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 98,
"height": 98,
"rawWidth": 98,
"rawHeight": 98,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-49,
-49,
0,
49,
-49,
0,
-49,
49,
0,
49,
49,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
98,
98,
98,
0,
0,
98,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-49,
-49,
0
],
"maxPos": [
49,
49,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "13b1f478-e4ca-4a54-9910-58e6fb4c3fcd@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "13b1f478-e4ca-4a54-9910-58e6fb4c3fcd@6c48a"
}
}
import { _decorator, Component, Graphics, Label, lerp, macro, misc, Node, Sprite, tween, UI, UITransform } from "cc";
const { ccclass, property, executeInEditMode } = _decorator;
@ccclass("PropBtn")
@executeInEditMode
export class PropBtn extends Component {
img: Sprite;
nameTxt: Label;
cdMask: Graphics;
cdTxt: Label;
onLoad() {
this.img = this.node.getChildByName("img").getComponent(Sprite);
this.nameTxt = this.node.getChildByName("name").getComponent(Label);
const cd = this.node.getChildByName("cd");
this.cdMask = cd.getChildByName("mask").getComponent(Graphics);
this.cdTxt = cd.getChildByName("num").getComponent(Label);
this.startCd(5);
this.drawProcess(0.4);
}
drawProcess(process: number) {
process = misc.clampf(process, 0, 1);
const h = lerp(0, Math.PI, process);
this.cdMask.clear();
this.cdMask.arc(0, 0, 50, h - Math.PI / 2, -h - Math.PI / 2, false);
this.cdMask.fill();
// this.cdMask.moveTo(0, )
}
totalCd = 0;
cd = 0;
startCd(cd = 5) {
this.cdTxt.node.active = true;
this.cdMask.node.active = true;
this.totalCd = cd;
this.cd = cd;
tween(this as PropBtn)
.to(cd, { cd: 0 }, {
onUpdate: (target: PropBtn, ratio: number) => {
this.drawProcess(1 - ratio);
this.cdTxt.string = `${this.cd.toFixed(1)}s`;
},
onComplete: () => {
this.cdTxt.node.active = false;
this.cdMask.node.active = false;
}
})
.start();
}
start() {
}
update(deltaTime: number) {
}
}
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "532eab71-9a5a-4452-ae6f-c41c40b32568",
"files": [],
"subMetas": {},
"userData": {}
}
......@@ -158,8 +158,8 @@ export class MainGame extends Scene {
initAiSnake(nickName?: string, tag?: number) {
const node = aiPool.get() || instantiate(this.animalPrefab);
const x = math.randomRangeInt(-(Global.MAP_WIDTH / 2 - 50), Global.MAP_WIDTH / 2 - 50);
const y = math.randomRangeInt(-(Global.MAP_HEIGHT / 2 - 50), Global.MAP_HEIGHT / 2 - 50);
const x = math.randomRange(-(Global.MAP_WIDTH / 2 - 50), Global.MAP_WIDTH / 2 - 50);
const y = math.randomRange(-(Global.MAP_HEIGHT / 2 - 50), Global.MAP_HEIGHT / 2 - 50);
node.getComponent(AISnake)?.init({
nickName: nickName,
tag: tag,
......@@ -167,7 +167,7 @@ export class MainGame extends Scene {
// x: 50,
// y: 50,
// bodyCount: 100,
angle: math.randomRangeInt(0, 360),
angle: math.randomRange(0, 360),
skinName: "s0",
});
this.animalNode.addChild(node);
......
......@@ -181,7 +181,7 @@
"_priority": 65535,
"_fov": 45,
"_fovAxis": 0,
"_orthoHeight": 857.2908366533865,
"_orthoHeight": 617.8074074074075,
"_near": 1,
"_far": 2000,
"_color": {
......
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