Commit 32b5400a authored by Nguyễn Quang Sáng's avatar Nguyễn Quang Sáng

10/8/2023 commit

parent 2767d079
{
"__type__": "cc.AnimationClip",
"_name": "CompleteLevel",
"_objFlags": 0,
"_native": "",
"_duration": 0.16666666666666666,
"sample": 60,
"speed": 0.3,
"wrapMode": 2,
"curveData": {
"props": {
"scaleY": [
{
"frame": 0,
"value": 1
},
{
"frame": 0.08333333333333333,
"value": 0.9
},
{
"frame": 0.16666666666666666,
"value": 1
}
]
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.2",
"uuid": "b7e24d55-f30f-47b9-bd0d-c225dc7a46b1",
"importer": "animation-clip",
"subMetas": {}
}
\ No newline at end of file
......@@ -3,44 +3,12 @@
"_name": "DogRun",
"_objFlags": 0,
"_native": "",
"_duration": 6.833333333333333,
"_duration": 5.966666666666667,
"sample": 60,
"speed": 1,
"speed": 0.8,
"wrapMode": 2,
"curveData": {
"props": {
"x": [
{
"frame": 0,
"value": -393
},
{
"frame": 0.26666666666666666,
"value": -320.306
},
{
"frame": 2.8833333333333333,
"value": 393
},
{
"frame": 3.1166666666666667,
"value": 393
},
{
"frame": 6.233333333333333,
"value": -393
}
],
"scaleX": [
{
"frame": 2.8833333333333333,
"value": -1.465
},
{
"frame": 3.1166666666666667,
"value": 1.465
}
],
"y": [
{
"frame": 0,
......@@ -236,7 +204,7 @@
}
},
{
"frame": 3.1166666666666667,
"frame": 3,
"value": {
"__uuid__": "3540dbbf-d26c-4074-811c-052d7507479b"
}
......@@ -306,30 +274,6 @@
"value": {
"__uuid__": "4b0a89d3-ec70-4aa1-9be8-1c156b6dc2d7"
}
},
{
"frame": 5.95,
"value": {
"__uuid__": "3540dbbf-d26c-4074-811c-052d7507479b"
}
},
{
"frame": 6.166666666666667,
"value": {
"__uuid__": "4b0a89d3-ec70-4aa1-9be8-1c156b6dc2d7"
}
},
{
"frame": 6.483333333333333,
"value": {
"__uuid__": "2a754951-3650-498a-accc-d669476f80dc"
}
},
{
"frame": 6.816666666666666,
"value": {
"__uuid__": "4b0a89d3-ec70-4aa1-9be8-1c156b6dc2d7"
}
}
]
}
......
{
"__type__": "cc.AnimationClip",
"_name": "Hunting",
"_objFlags": 0,
"_native": "",
"_duration": 5.983333333333333,
"sample": 60,
"speed": 0.8,
"wrapMode": 2,
"curveData": {
"props": {
"x": [
{
"frame": 0,
"value": -400
},
{
"frame": 3,
"value": 550
},
{
"frame": 3.0833333333333335,
"value": 400
},
{
"frame": 5.983333333333333,
"value": -550
}
],
"scaleX": [
{
"frame": 2.9833333333333334,
"value": 1
},
{
"frame": 3.183333333333333,
"value": -1
}
]
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.2",
"uuid": "20a495e8-1606-4bbf-9a81-226b9a79c17b",
"importer": "animation-clip",
"subMetas": {}
}
\ No newline at end of file
{
"__type__": "cc.AnimationClip",
"_name": "Light",
"_objFlags": 0,
"_native": "",
"_duration": 0.3333333333333333,
"sample": 60,
"speed": 0.1,
"wrapMode": 2,
"curveData": {
"props": {
"angle": [
{
"frame": 0,
"value": 0
},
{
"frame": 0.3333333333333333,
"value": 360
}
]
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.2",
"uuid": "0d80acb8-f3f6-45f2-ab44-aa6b412bb43b",
"importer": "animation-clip",
"subMetas": {}
}
\ No newline at end of file
{
"__type__": "cc.AnimationClip",
"_name": "Opening",
"_objFlags": 0,
"_native": "",
"_duration": 0.5166666666666667,
"sample": 60,
"speed": 1,
"wrapMode": 1,
"curveData": {
"props": {
"opacity": [
{
"frame": 0,
"value": 0
},
{
"frame": 0.5166666666666667,
"value": 255
}
]
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.2",
"uuid": "20dd64ba-ba66-4af0-9f75-d3196eca01af",
"importer": "animation-clip",
"subMetas": {}
}
\ No newline at end of file
{
"__type__": "cc.AnimationClip",
"_name": "Practice",
"_objFlags": 0,
"_native": "",
"_duration": 5.983333333333333,
"sample": 60,
"speed": 1,
"wrapMode": 2,
"curveData": {
"paths": {},
"props": {
"position": [
{
"frame": 0,
"value": [
352.505,
203.38,
0
]
},
{
"frame": 1,
"value": [
352.505,
328.441,
0
]
},
{
"frame": 2,
"value": [
524.063,
328.441,
0
]
},
{
"frame": 3.0166666666666666,
"value": [
524.063,
203.38,
0
]
},
{
"frame": 4,
"value": [
524.063,
327.639,
0
]
},
{
"frame": 5,
"value": [
351.704,
327.639,
0
]
},
{
"frame": 5.983333333333333,
"value": [
351.704,
206.587,
0
]
}
]
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.2",
"uuid": "44c47fc2-a8ce-45ff-8dac-e915701f1e55",
"importer": "animation-clip",
"subMetas": {}
}
\ No newline at end of file
......@@ -12,7 +12,7 @@
"angle": [
{
"frame": 0,
"value": 0
"value": 15
},
{
"frame": 0.05,
......@@ -20,7 +20,7 @@
},
{
"frame": 0.1,
"value": 0
"value": 15
}
]
}
......
{
"ver": "2.3.7",
"uuid": "8d2cdeac-7d2b-45bb-a0ce-4dad07bbf258",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 276,
"height": 104,
"platformSettings": {},
"subMetas": {
"button_collect": {
"ver": "1.0.6",
"uuid": "c4251a1f-25f4-4c87-8e13-14c7845bac0d",
"importer": "sprite-frame",
"rawTextureUuid": "8d2cdeac-7d2b-45bb-a0ce-4dad07bbf258",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 276,
"height": 104,
"rawWidth": 276,
"rawHeight": 104,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.7",
"uuid": "08bfa518-5cb7-48aa-a3bf-21cfbe30920a",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 86,
"height": 101,
"platformSettings": {},
"subMetas": {
"clock": {
"ver": "1.0.6",
"uuid": "1f76d3e6-e222-4bf3-9139-eb51756d4087",
"importer": "sprite-frame",
"rawTextureUuid": "08bfa518-5cb7-48aa-a3bf-21cfbe30920a",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 86,
"height": 101,
"rawWidth": 86,
"rawHeight": 101,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.7",
"uuid": "83e988fa-ee2a-4c72-96a6-f51546331a91",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 92,
"height": 105,
"platformSettings": {},
"subMetas": {
"hand": {
"ver": "1.0.6",
"uuid": "61592a45-f8b4-4ebd-99c8-24b752abd4a9",
"importer": "sprite-frame",
"rawTextureUuid": "83e988fa-ee2a-4c72-96a6-f51546331a91",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 92,
"height": 105,
"rawWidth": 92,
"rawHeight": 105,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.7",
"uuid": "bbc8827e-b2e8-4f76-8e39-ef96a215a4aa",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 296,
"height": 283,
"platformSettings": {},
"subMetas": {
"light": {
"ver": "1.0.6",
"uuid": "bf9ff59f-908f-4078-bcdb-495a1da51391",
"importer": "sprite-frame",
"rawTextureUuid": "bbc8827e-b2e8-4f76-8e39-ef96a215a4aa",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 296,
"height": 283,
"rawWidth": 296,
"rawHeight": 283,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.7",
"uuid": "be1bc2f2-aec9-42fb-afd4-ae7d867808a3",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 128,
"height": 128,
"platformSettings": {},
"subMetas": {
"particles": {
"ver": "1.0.6",
"uuid": "e56c675f-3072-4fd9-ae7e-6e16b8b194b5",
"importer": "sprite-frame",
"rawTextureUuid": "be1bc2f2-aec9-42fb-afd4-ae7d867808a3",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -0.5,
"offsetY": 0.5,
"trimX": 0,
"trimY": 0,
"width": 127,
"height": 127,
"rawWidth": 128,
"rawHeight": 128,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.7",
"uuid": "9c22e33b-69ac-431a-9cc9-b4dac11f1007",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 32,
"height": 32,
"platformSettings": {},
"subMetas": {
"particles2": {
"ver": "1.0.6",
"uuid": "569245d0-6e2a-4d28-831c-8be6242f4c3f",
"importer": "sprite-frame",
"rawTextureUuid": "9c22e33b-69ac-431a-9cc9-b4dac11f1007",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -3.5,
"offsetY": 2,
"trimX": 0,
"trimY": 0,
"width": 25,
"height": 28,
"rawWidth": 32,
"rawHeight": 32,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.7",
"uuid": "c2aba5b3-a1fb-495d-a329-00a4884addd8",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 70,
"height": 19,
"platformSettings": {},
"subMetas": {
"practice_bar": {
"ver": "1.0.6",
"uuid": "b744da33-a96b-4ba6-a0ba-07a6568fb2d3",
"importer": "sprite-frame",
"rawTextureUuid": "c2aba5b3-a1fb-495d-a329-00a4884addd8",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 9,
"trimY": 2,
"width": 52,
"height": 15,
"rawWidth": 70,
"rawHeight": 19,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.7",
"uuid": "23809d4c-813d-4579-8bd4-1ddf1d79d025",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 423,
"height": 264,
"platformSettings": {},
"subMetas": {
"win_1star": {
"ver": "1.0.6",
"uuid": "40455dae-ba33-4baf-865e-fa1ab3616d41",
"importer": "sprite-frame",
"rawTextureUuid": "23809d4c-813d-4579-8bd4-1ddf1d79d025",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 722,
"height": 336,
"rawWidth": 722,
"rawHeight": 336,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.7",
"uuid": "db3e036d-28b6-4617-a228-df577c49b8bd",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 722,
"height": 333,
"platformSettings": {},
"subMetas": {
"win_2star": {
"ver": "1.0.6",
"uuid": "45d01018-dbcf-474e-9e3f-9bf3674d50eb",
"importer": "sprite-frame",
"rawTextureUuid": "db3e036d-28b6-4617-a228-df577c49b8bd",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 722,
"height": 333,
"rawWidth": 722,
"rawHeight": 333,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.7",
"uuid": "e3575924-c923-49c5-9ad3-1d371d8cddd4",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 722,
"height": 335,
"platformSettings": {},
"subMetas": {
"win_3star": {
"ver": "1.0.6",
"uuid": "c95ae700-55d5-4278-b83c-13af6dabb22e",
"importer": "sprite-frame",
"rawTextureUuid": "e3575924-c923-49c5-9ad3-1d371d8cddd4",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": -0.5,
"trimX": 0,
"trimY": 1,
"width": 722,
"height": 334,
"rawWidth": 722,
"rawHeight": 335,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
const { ccclass, property } = cc._decorator;
@ccclass
export default class Buttons extends cc.Component {
onClickButtonBack() {
cc.director.loadScene("start");
}
onClickButtonReplay() {
cc.director.loadScene("gameplay");
}
}
{
"ver": "1.1.0",
"uuid": "1a8f8993-416b-4d62-a47d-a21e728b6331",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
......@@ -10,11 +10,28 @@ export default class GamePlay extends cc.Component {
@property(cc.Prefab) prefabToLoad: cc.Prefab = null;
@property(cc.Node) gameRegion: cc.Node = null;
@property(cc.Graphics) graphic: cc.Graphics = null;
@property(cc.Label) timerLabel: cc.Label = null;
@property(cc.Node) clock: cc.Node = null;
@property(cc.Node) levelLabel: cc.Node = null;
@property(cc.Node) shadow: cc.Node = null;
@property(cc.Node) light: cc.Node = null;
@property(cc.Node) title: cc.Node = null;
@property(cc.Node) earnedCoin: cc.Node = null;
@property(cc.Node) earnedCoinLabel: cc.Node = null;
@property(cc.Node) buttonCollect: cc.Node = null;
@property(cc.Node) star: cc.Node = null;
@property(cc.Node) starLabel: cc.Node = null;
@property(cc.Node) rewardSprite: cc.Node = null;
@property(cc.SpriteFrame) win2Star: cc.SpriteFrame = null;
@property(cc.SpriteFrame) win1Star: cc.SpriteFrame = null;
isDrawing: boolean = true;
draw: cc.Node = null;
rb = null;
chain = null;
countdown: number = 7;
startCount: boolean = false;
protected onLoad(): void {
cc.director.getPhysicsManager().enabled = true;
......@@ -33,9 +50,15 @@ export default class GamePlay extends cc.Component {
loadPrefab() {
const newNode = cc.instantiate(this.prefabToLoad);
this.node.addChild(newNode);
this.levelLabel.getComponent(cc.Label).string = this.prefabToLoad.name;
}
onTouchDown(event) {
if (this.prefabToLoad.name == "Level 1") {
this.prefabToLoad.data.children[3].active = false;
}
console.log(this.prefabToLoad.data.getChildByName("PracticeLine").active);
this.draw = new cc.Node();
this.draw.parent = this.node;
this.draw.addComponent(cc.Graphics);
......@@ -48,19 +71,54 @@ export default class GamePlay extends cc.Component {
onTouchMove(event) {
if (this.isDrawing) {
this.chain.points.push(event.getLocation());
this.drawLine();
LimitBar.instance.fillTheBar();
if (LimitBar.instance.progress <= 0) {
this.onTouchUp();
} else this.drawLine();
}
}
onTouchUp(event) {
// this.isDrawing = false;
onTouchUp() {
this.isDrawing = false;
// this.rb.type = cc.RigidBodyType.Dynamic;
this.rb.allowSleep = false;
this.rb.enabledContactListener = true;
Dog.instance.getComponent(cc.Animation).play("DogScare");
this.chain.apply();
Hole.instance.isSpawnable = true;
this.clock.active = true;
this.startCount = true;
}
protected update(dt: number): void {
if (this.startCount && this.countdown >= 1) {
this.countdown -= 1 * dt;
this.timerLabel.string = Math.floor(this.countdown).toString();
}
if (Dog.instance.attacked || this.countdown < 0) this.startCount == false;
if (Dog.instance.attacked == false && this.countdown <= 1) {
this.onLevelCompleted();
}
}
onLevelCompleted() {
Dog.instance.getComponent(cc.Animation).play("DogIdle");
this.shadow.active = true;
this.light.active = true;
this.title.active = true;
this.earnedCoin.active = true;
this.earnedCoinLabel.active = true;
this.buttonCollect.active = true;
this.star.active = true;
this.starLabel.active = true;
this.rewardSprite.active = true;
if (LimitBar.instance.winStar == 2) {
this.rewardSprite.getComponent(cc.Sprite).spriteFrame = this.win2Star;
}
if (LimitBar.instance.winStar == 1) {
this.rewardSprite.getComponent(cc.Sprite).spriteFrame = this.win1Star;
}
}
drawLine() {
......
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