金币落袋

This commit is contained in:
ifengzp 2020-03-30 01:26:16 +08:00
parent bfc9a5375c
commit dc2f9b2f90
37 changed files with 2384 additions and 529 deletions

9
.editorconfig Normal file
View File

@ -0,0 +1,9 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

7
.prettierrc Normal file
View File

@ -0,0 +1,7 @@
{
"trailingComma": "none",
"singleQuote": true,
"semi": true,
"tabWidth": 2,
"printWidth": 120
}

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "47d13c36-a8ef-4048-8886-c7f20ea310d1",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "2fe09b25-f8d3-4224-be15-24be6c15c6cd",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

View File

@ -0,0 +1,55 @@
{
"__type__": "cc.AnimationClip",
"_name": "coin",
"_objFlags": 0,
"_native": "",
"_duration": 1,
"sample": 6,
"speed": 1,
"wrapMode": 2,
"curveData": {
"comps": {
"cc.Sprite": {
"spriteFrame": [
{
"frame": 0,
"value": {
"__uuid__": "28bb2e6a-615d-49b8-a336-b9da8d2a2171"
}
},
{
"frame": 0.16666666666666666,
"value": {
"__uuid__": "a2f151c4-4849-46a2-8de3-cf3daf82786d"
}
},
{
"frame": 0.3333333333333333,
"value": {
"__uuid__": "7c516296-1a47-4557-967b-cb755c885c0b"
}
},
{
"frame": 0.5,
"value": {
"__uuid__": "3b00549c-9d1c-479f-9a4a-3c5a65d8dd19"
}
},
{
"frame": 0.6666666666666666,
"value": {
"__uuid__": "101f2e9d-800b-4a4a-b470-ac3b9a7f343b"
}
},
{
"frame": 0.8333333333333334,
"value": {
"__uuid__": "61a9a149-e55f-4fc5-8368-1f809db4d86a"
}
}
]
}
}
},
"events": []
}

View File

@ -0,0 +1,5 @@
{
"ver": "2.1.0",
"uuid": "c05a7266-2da0-4fc5-95fe-6fc1eea52cd0",
"subMetas": {}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
{
"ver": "1.2.6",
"uuid": "e59f7c21-d36e-47ba-82ef-810c834009a2",
"asyncLoadAssets": false,
"autoReleaseAssets": false,
"subMetas": {}
}

View File

@ -0,0 +1,93 @@
const { ccclass, property } = cc._decorator;
@ccclass
export default class Coin_fly_to_wallet extends cc.Component {
@property(cc.Node)
startPoint: cc.Node = null;
@property(cc.Node)
endPoint: cc.Node = null;
@property(cc.Prefab)
coinPrefab: cc.Prefab = null;
coinPool: cc.NodePool = null;
onLoad() {
this.coinPool = new cc.NodePool();
this.initCoinPool();
}
initCoinPool(count: number = 20) {
for (let i = 0; i < count; i++) {
let coin = cc.instantiate(this.coinPrefab);
this.coinPool.put(coin);
}
}
playAnim() {
let randomCount = Math.random() * 15 + 10;
let stPos = this.startPoint.getPosition();
let edPos = this.endPoint.getPosition();
this.playCoinFlyAnim(randomCount, stPos, edPos);
}
playCoinFlyAnim(count: number, stPos: cc.Vec2, edPos: cc.Vec2, r: number = 130) {
// 确保当前节点池有足够的金币
const poolSize = this.coinPool.size();
const reCreateCoinCount = poolSize > count ? 0 : count - poolSize;
this.initCoinPool(reCreateCoinCount);
// 生成圆,并且对圆上的点进行排序
let points = this.getCirclePoints(r, stPos, count);
let coinNodeList = points.map(pos => {
let coin = this.coinPool.get();
coin.setPosition(stPos);
this.node.addChild(coin);
return {
node: coin,
stPos: stPos,
mdPos: pos,
edPos: edPos,
dis: (pos as any).sub(edPos).mag()
};
});
coinNodeList = coinNodeList.sort((a, b) => {
if (a.dis - b.dis > 0) return 1;
if (a.dis - b.dis < 0) return -1;
return 0;
});
// 执行金币落袋的动画
coinNodeList.forEach((item, idx) => {
item.node.runAction(
cc.sequence(
cc.moveTo(0.3, item.mdPos),
cc.delayTime(idx * 0.01),
cc.moveTo(0.5, item.edPos),
cc.callFunc(() => {
this.coinPool.put(item.node);
})
)
);
});
}
/**
*
*
* @param {number} r
* @param {cc.Vec2} pos
* @param {number} count
* @param {number} [randomScope=80]
* @returns {cc.Vec2[]}
*/
getCirclePoints(r: number, pos: cc.Vec2, count: number, randomScope: number = 60): cc.Vec2[] {
let points = [];
let radians = (Math.PI / 180) * Math.round(360 / count);
for (let i = 0; i < count; i++) {
let x = pos.x + r * Math.sin(radians * i);
let y = pos.y + r * Math.cos(radians * i);
points.unshift(cc.v3(x + Math.random() * randomScope, y + Math.random() * randomScope, 0));
}
return points;
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "e54af7d4-17b3-4679-9cad-3457302e139d",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "aef1340b-5d54-4592-9d0d-283220ebf9cb",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

View File

@ -0,0 +1,143 @@
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "coin",
"_objFlags": 0,
"_parent": null,
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
},
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 60,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "28bb2e6a-615d-49b8-a336-b9da8d2a2171"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": {
"__uuid__": "1a062e1b-0e93-4cff-be58-9517555b09f5"
},
"_id": ""
},
{
"__type__": "cc.Animation",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_defaultClip": {
"__uuid__": "c05a7266-2da0-4fc5-95fe-6fc1eea52cd0"
},
"_clips": [
{
"__uuid__": "c05a7266-2da0-4fc5-95fe-6fc1eea52cd0"
}
],
"playOnLoad": true,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "fca82ecc-ae07-410f-8658-ce7fc8e9d2d3"
},
"fileId": "f9P6h6OM9Glbsc4bkBmFtn",
"sync": false
}
]

View File

@ -0,0 +1,8 @@
{
"ver": "1.2.6",
"uuid": "fca82ecc-ae07-410f-8658-ce7fc8e9d2d3",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "07c3b8ca-280e-4457-9def-57ef7e082777",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

View File

@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>frames</key>
<dict>
<key>jb1.png</key>
<dict>
<key>frame</key>
<string>{{2,2},{60,60}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<false/>
<key>sourceColorRect</key>
<string>{{0,0},{60,60}}</string>
<key>sourceSize</key>
<string>{60,60}</string>
</dict>
<key>jb2.png</key>
<dict>
<key>frame</key>
<string>{{64,60},{56,60}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{56,60}}</string>
<key>sourceSize</key>
<string>{56,60}</string>
</dict>
<key>jb3.png</key>
<dict>
<key>frame</key>
<string>{{2,102},{36,60}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{36,60}}</string>
<key>sourceSize</key>
<string>{36,60}</string>
</dict>
<key>jb4.png</key>
<dict>
<key>frame</key>
<string>{{64,118},{13,60}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{13,60}}</string>
<key>sourceSize</key>
<string>{13,60}</string>
</dict>
<key>jb5.png</key>
<dict>
<key>frame</key>
<string>{{2,64},{36,60}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{36,60}}</string>
<key>sourceSize</key>
<string>{36,60}</string>
</dict>
<key>jb6.png</key>
<dict>
<key>frame</key>
<string>{{64,2},{56,60}}</string>
<key>offset</key>
<string>{0,0}</string>
<key>rotated</key>
<true/>
<key>sourceColorRect</key>
<string>{{0,0},{56,60}}</string>
<key>sourceSize</key>
<string>{56,60}</string>
</dict>
</dict>
<key>metadata</key>
<dict>
<key>format</key>
<integer>2</integer>
<key>realTextureFileName</key>
<string>goldAnim.png</string>
<key>size</key>
<string>{128,256}</string>
<key>smartupdate</key>
<string>$TexturePacker:SmartUpdate:174c3bcf2102596fc16f1743450236e8$</string>
<key>textureFileName</key>
<string>goldAnim.png</string>
</dict>
</dict>
</plist>

View File

@ -0,0 +1,144 @@
{
"ver": "1.2.4",
"uuid": "1a062e1b-0e93-4cff-be58-9517555b09f5",
"rawTextureUuid": "61b6bf8b-4ce9-412a-bce2-58ed9971db4f",
"size": {
"width": 128,
"height": 256
},
"type": "Texture Packer",
"subMetas": {
"jb1.png": {
"ver": "1.0.4",
"uuid": "28bb2e6a-615d-49b8-a336-b9da8d2a2171",
"rawTextureUuid": "61b6bf8b-4ce9-412a-bce2-58ed9971db4f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 2,
"trimY": 2,
"width": 60,
"height": 60,
"rawWidth": 60,
"rawHeight": 60,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"spriteType": "normal",
"subMetas": {}
},
"jb2.png": {
"ver": "1.0.4",
"uuid": "61a9a149-e55f-4fc5-8368-1f809db4d86a",
"rawTextureUuid": "61b6bf8b-4ce9-412a-bce2-58ed9971db4f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": true,
"offsetX": 0,
"offsetY": 0,
"trimX": 64,
"trimY": 60,
"width": 56,
"height": 60,
"rawWidth": 56,
"rawHeight": 60,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"spriteType": "normal",
"subMetas": {}
},
"jb3.png": {
"ver": "1.0.4",
"uuid": "101f2e9d-800b-4a4a-b470-ac3b9a7f343b",
"rawTextureUuid": "61b6bf8b-4ce9-412a-bce2-58ed9971db4f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": true,
"offsetX": 0,
"offsetY": 0,
"trimX": 2,
"trimY": 102,
"width": 36,
"height": 60,
"rawWidth": 36,
"rawHeight": 60,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"spriteType": "normal",
"subMetas": {}
},
"jb4.png": {
"ver": "1.0.4",
"uuid": "3b00549c-9d1c-479f-9a4a-3c5a65d8dd19",
"rawTextureUuid": "61b6bf8b-4ce9-412a-bce2-58ed9971db4f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": true,
"offsetX": 0,
"offsetY": 0,
"trimX": 64,
"trimY": 118,
"width": 13,
"height": 60,
"rawWidth": 13,
"rawHeight": 60,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"spriteType": "normal",
"subMetas": {}
},
"jb5.png": {
"ver": "1.0.4",
"uuid": "7c516296-1a47-4557-967b-cb755c885c0b",
"rawTextureUuid": "61b6bf8b-4ce9-412a-bce2-58ed9971db4f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": true,
"offsetX": 0,
"offsetY": 0,
"trimX": 2,
"trimY": 64,
"width": 36,
"height": 60,
"rawWidth": 36,
"rawHeight": 60,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"spriteType": "normal",
"subMetas": {}
},
"jb6.png": {
"ver": "1.0.4",
"uuid": "a2f151c4-4849-46a2-8de3-cf3daf82786d",
"rawTextureUuid": "61b6bf8b-4ce9-412a-bce2-58ed9971db4f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": true,
"offsetX": 0,
"offsetY": 0,
"trimX": 64,
"trimY": 2,
"width": 56,
"height": 60,
"rawWidth": 56,
"rawHeight": 60,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"spriteType": "normal",
"subMetas": {}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -0,0 +1,14 @@
{
"ver": "2.3.4",
"uuid": "61b6bf8b-4ce9-412a-bce2-58ed9971db4f",
"type": "raw",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 128,
"height": 256,
"platformSettings": {},
"subMetas": {}
}

View File

Before

Width:  |  Height:  |  Size: 82 B

After

Width:  |  Height:  |  Size: 82 B

287
assets/Scene/Home.fire Executable file
View File

@ -0,0 +1,287 @@
[
{
"__type__": "cc.SceneAsset",
"_name": "",
"_objFlags": 0,
"_native": "",
"scene": {
"__id__": 1
}
},
{
"__type__": "cc.Scene",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_is3DNode": true,
"_groupIndex": 0,
"groupIndex": 0,
"autoReleaseAssets": false,
"_id": "2d2f792f-a40c-49bb-a189-ed176a246e49"
},
{
"__type__": "cc.Node",
"_name": "Canvas",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
}
],
"_active": true,
"_components": [
{
"__id__": 5
},
{
"__id__": 6
},
{
"__id__": 7
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 252,
"g": 252,
"b": 252,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
667,
375,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "a286bbGknJLZpRpxROV6M94"
},
{
"__type__": "cc.Node",
"_name": "Main Camera",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
452.93128617926146,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "5asNwYHHZD1rkaP+0fDn4b"
},
{
"__type__": "cc.Camera",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_cullingMask": 4294967295,
"_clearFlags": 7,
"_backgroundColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_depth": -1,
"_zoomRatio": 1,
"_targetTexture": null,
"_fov": 60,
"_orthoSize": 10,
"_nearClip": 1,
"_farClip": 4096,
"_ortho": true,
"_rect": {
"__type__": "cc.Rect",
"x": 0,
"y": 0,
"width": 1,
"height": 1
},
"_renderStages": 1,
"_alignWithScreen": true,
"_id": "b99yu4HWREH4Qoiccp2gXV"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_fitWidth": false,
"_fitHeight": true,
"_id": "40zd8HWWlDfoW8KOeIfAd2"
},
{
"__type__": "e1b90/rohdEk4SdmmEZANaD",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_id": "10XBeOwdlMjY6IKW4gHw0V"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "78gApOlVZPNo6zKoTsIRiq"
}
]

View File

@ -1,476 +0,0 @@
[
{
"__type__": "cc.SceneAsset",
"_name": "",
"_objFlags": 0,
"_rawFiles": null,
"scene": {
"__id__": 1
}
},
{
"__type__": "cc.Scene",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_tag": -1,
"_active": true,
"_components": [],
"_prefab": null,
"_id": "2d2f792f-a40c-49bb-a189-ed176a246e49",
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_cascadeOpacityEnabled": true,
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_localZOrder": 0,
"_globalZOrder": 0,
"_opacityModifyRGB": false,
"groupIndex": 0,
"autoReleaseAssets": null,
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
}
},
{
"__type__": "cc.Node",
"_name": "Canvas",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
},
{
"__id__": 6
},
{
"__id__": 8
}
],
"_tag": -1,
"_active": true,
"_components": [
{
"__id__": 10
},
{
"__id__": 11
},
{
"__id__": 12
}
],
"_prefab": null,
"_id": "a286bbGknJLZpRpxROV6M94",
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 252,
"g": 252,
"b": 252,
"a": 255
},
"_cascadeOpacityEnabled": true,
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_contentSize": {
"__type__": "cc.Size",
"width": 960,
"height": 640
},
"_skewX": 0,
"_skewY": 0,
"_localZOrder": 0,
"_globalZOrder": 0,
"_opacityModifyRGB": false,
"groupIndex": 0,
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
480,
320,
0,
0,
0,
0,
1,
1,
1,
1
]
}
},
{
"__type__": "cc.Node",
"_name": "background",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_tag": -1,
"_active": true,
"_components": [
{
"__id__": 4
},
{
"__id__": 5
}
],
"_prefab": null,
"_id": "e2e0crkOLxGrpMxpbC4iQg1",
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 27,
"g": 38,
"b": 46,
"a": 255
},
"_cascadeOpacityEnabled": true,
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_contentSize": {
"__type__": "cc.Size",
"width": 960,
"height": 640
},
"_skewX": 0,
"_skewY": 0,
"_localZOrder": 0,
"_globalZOrder": 0,
"_opacityModifyRGB": false,
"groupIndex": 0,
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
}
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"isAlignOnce": true,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 200,
"_originalHeight": 150
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_spriteFrame": {
"__uuid__": "410fb916-8721-4663-bab8-34397391ace7"
},
"_type": 1,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_atlas": null
},
{
"__type__": "cc.Node",
"_name": "cocos",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_tag": -1,
"_active": true,
"_components": [
{
"__id__": 7
}
],
"_prefab": null,
"_id": "c4f30YOS65G64U2TwufdJ+2",
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_cascadeOpacityEnabled": true,
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_contentSize": {
"__type__": "cc.Size",
"width": 195,
"height": 270
},
"_skewX": 0,
"_skewY": 0,
"_localZOrder": 0,
"_globalZOrder": 0,
"_opacityModifyRGB": false,
"groupIndex": 0,
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
50,
0,
0,
0,
0,
1,
1,
1,
1
]
}
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
},
"_enabled": true,
"_spriteFrame": {
"__uuid__": "31bc895a-c003-4566-a9f3-2e54ae1c17dc"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_atlas": null
},
{
"__type__": "cc.Node",
"_name": "label",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_tag": -1,
"_active": true,
"_components": [
{
"__id__": 9
}
],
"_prefab": null,
"_id": "31f1bH7V69Ajr1iXhluMpTB",
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_cascadeOpacityEnabled": true,
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_contentSize": {
"__type__": "cc.Size",
"width": 342.33,
"height": 60
},
"_skewX": 0,
"_skewY": 0,
"_localZOrder": 0,
"_globalZOrder": 0,
"_opacityModifyRGB": false,
"groupIndex": 0,
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-180,
0,
0,
0,
0,
1,
1,
1,
1
]
}
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_useOriginalSize": false,
"_actualFontSize": 60,
"_fontSize": 60,
"_lineHeight": 60,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_N$string": "Hello, World!",
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 960,
"height": 640
},
"_fitWidth": false,
"_fitHeight": true
},
{
"__type__": "e1b90/rohdEk4SdmmEZANaD",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"label": {
"__id__": 9
},
"text": "hello"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0
}
]

View File

@ -1,16 +0,0 @@
const {ccclass, property} = cc._decorator;
@ccclass
export default class Helloworld extends cc.Component {
@property(cc.Label)
label: cc.Label = null;
@property
text: string = 'hello';
start () {
// init logic
this.label.string = this.text;
}
}

6
assets/Script/Home.ts Normal file
View File

@ -0,0 +1,6 @@
const {ccclass, property} = cc._decorator;
@ccclass
export default class Home extends cc.Component {
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

BIN
assets/Texture/background.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -1,20 +1,20 @@
{ {
"ver": "2.3.4", "ver": "2.3.4",
"uuid": "6aa0aa6a-ebee-4155-a088-a687a6aadec4", "uuid": "26c62249-fd97-446f-943c-d23dea4fbed1",
"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": 195, "width": 512,
"height": 270, "height": 362,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"HelloWorld": { "background": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "31bc895a-c003-4566-a9f3-2e54ae1c17dc", "uuid": "ca2dacae-8064-403e-8c6c-3105a2891922",
"rawTextureUuid": "6aa0aa6a-ebee-4155-a088-a687a6aadec4", "rawTextureUuid": "26c62249-fd97-446f-943c-d23dea4fbed1",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
@ -22,10 +22,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 195, "width": 512,
"height": 270, "height": 362,
"rawWidth": 195, "rawWidth": 512,
"rawHeight": 270, "rawHeight": 362,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,

BIN
assets/Texture/ground.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,36 @@
{
"ver": "2.3.4",
"uuid": "1d4d90ce-dfa9-4a1a-99b0-b388f16276b4",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 256,
"height": 256,
"platformSettings": {},
"subMetas": {
"ground": {
"ver": "1.0.4",
"uuid": "51984aa7-901e-478d-ae43-20b08753cb97",
"rawTextureUuid": "1d4d90ce-dfa9-4a1a-99b0-b388f16276b4",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 256,
"height": 256,
"rawWidth": 256,
"rawHeight": 256,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

BIN
assets/Texture/npm_1.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -0,0 +1,36 @@
{
"ver": "2.3.4",
"uuid": "3f716868-44f8-4ff2-9f85-72917cc049da",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 78,
"height": 67,
"platformSettings": {},
"subMetas": {
"npm_1": {
"ver": "1.0.4",
"uuid": "d4d6a44a-040e-442d-ab8f-1fa461cafd87",
"rawTextureUuid": "3f716868-44f8-4ff2-9f85-72917cc049da",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 78,
"height": 67,
"rawWidth": 78,
"rawHeight": 67,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

BIN
assets/Texture/star.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -0,0 +1,36 @@
{
"ver": "2.3.4",
"uuid": "f4b59ab3-20f5-4e11-9de3-e61599b5e4d9",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 60,
"height": 71,
"platformSettings": {},
"subMetas": {
"star": {
"ver": "1.0.4",
"uuid": "a4637c7b-9210-47e8-ac88-71fd21356eab",
"rawTextureUuid": "f4b59ab3-20f5-4e11-9de3-e61599b5e4d9",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -1.5,
"trimX": 0,
"trimY": 4,
"width": 60,
"height": 66,
"rawWidth": 60,
"rawHeight": 71,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

View File

@ -12,27 +12,26 @@
"group-list": [ "group-list": [
"default" "default"
], ],
"start-scene": "2d2f792f-a40c-49bb-a189-ed176a246e49", "design-resolution-width": 1334,
"design-resolution-width": 960, "design-resolution-height": 750,
"design-resolution-height": 640,
"fit-width": false, "fit-width": false,
"fit-height": true, "fit-height": true,
"use-project-simulator-setting": false, "use-project-simulator-setting": false,
"simulator-orientation": false, "simulator-orientation": false,
"use-customize-simulator": false, "use-customize-simulator": true,
"simulator-resolution": { "simulator-resolution": {
"width": 960, "height": 640,
"height": 640 "width": 960
}, },
"last-module-event-record-time": 0, "last-module-event-record-time": 0,
"assets-sort-type": "name", "assets-sort-type": "name",
"facebook": { "facebook": {
"enable": false,
"appID": "", "appID": "",
"live": { "audience": {
"enable": false "enable": false
}, },
"audience": { "enable": false,
"live": {
"enable": false "enable": false
} }
} }

35
tsconfig.json Executable file → Normal file
View File

@ -1,18 +1,17 @@
{ {
"compilerOptions": { "compilerOptions": {
"module": "commonjs", "module": "commonjs",
"lib": [ "dom", "es5", "es2015.promise" ], "lib": [ "dom", "es5", "es2015.promise" ],
"target": "es5", "target": "es5",
"allowJs": true, "experimentalDecorators": true,
"experimentalDecorators": true, "skipLibCheck": true
"skipLibCheck": true },
}, "exclude": [
"exclude": [ "node_modules",
"node_modules", "library",
"library", "local",
"local", "temp",
"temp", "build",
"build", "settings"
"settings" ]
] }
}