Commit 8024cbe2 authored by Nguyễn Quang Sáng's avatar Nguyễn Quang Sáng

first commit

parent 0b7ce095
Pipeline #1656 failed with stages
...@@ -133,13 +133,13 @@ ...@@ -133,13 +133,13 @@
"tag": 0, "tag": 0,
"_offset": { "_offset": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
"x": 0.5, "x": -0.5,
"y": 0.6 "y": 0
}, },
"_size": { "_size": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 156.6, "width": 151.7,
"height": 76.5 "height": 75.7
}, },
"_id": "" "_id": ""
}, },
......
...@@ -133,13 +133,13 @@ ...@@ -133,13 +133,13 @@
"tag": 0, "tag": 0,
"_offset": { "_offset": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
"x": 0.3, "x": -0.3,
"y": 0.2 "y": 0.2
}, },
"_size": { "_size": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 75.3, "width": 75.3,
"height": 233.6 "height": 233.5
}, },
"_id": "" "_id": ""
}, },
......
...@@ -133,13 +133,13 @@ ...@@ -133,13 +133,13 @@
"tag": 0, "tag": 0,
"_offset": { "_offset": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
"x": -0.1, "x": 0.2,
"y": 0.1 "y": 0.1
}, },
"_size": { "_size": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 156.4, "width": 153.5,
"height": 77.3 "height": 74.2
}, },
"_id": "" "_id": ""
}, },
......
...@@ -133,13 +133,13 @@ ...@@ -133,13 +133,13 @@
"tag": 0, "tag": 0,
"_offset": { "_offset": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
"x": 0.3, "x": 0,
"y": 0.1 "y": 0.9
}, },
"_size": { "_size": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 75.5, "width": 75.4,
"height": 155.8 "height": 155
}, },
"_id": "" "_id": ""
}, },
......
...@@ -133,12 +133,12 @@ ...@@ -133,12 +133,12 @@
"tag": 0, "tag": 0,
"_offset": { "_offset": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
"x": 0.2, "x": 0.1,
"y": 0.1 "y": 0.1
}, },
"_size": { "_size": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 234.9, "width": 232.8,
"height": 75.1 "height": 75.1
}, },
"_id": "" "_id": ""
......
This diff is collapsed.
This diff is collapsed.
...@@ -75,19 +75,22 @@ ...@@ -75,19 +75,22 @@
"__id__": 5 "__id__": 5
}, },
{ {
"__id__": 8 "__id__": 7
}, },
{ {
"__id__": 11 "__id__": 10
},
{
"__id__": 13
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 15 "__id__": 17
}, },
{ {
"__id__": 16 "__id__": 18
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -140,7 +143,7 @@ ...@@ -140,7 +143,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "Main Camera", "_name": "wallpaper",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 2 "__id__": 2
...@@ -161,6 +164,100 @@ ...@@ -161,6 +164,100 @@
"b": 255, "b": 255,
"a": 255 "a": 255
}, },
"_contentSize": {
"__type__": "cc.Size",
"width": 642,
"height": 1138
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1.384,
1.384,
1.384
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "fb35JsPjBPYZPuBI9wEWK0"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "498a0d42-52b2-4f56-bc4a-50cee19c5899"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "e7gTQ1XrdNqoWZ9V6VnnUk"
},
{
"__type__": "cc.Node",
"_name": "Main Camera",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 6
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 0, "width": 0,
...@@ -205,7 +302,7 @@ ...@@ -205,7 +302,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 3 "__id__": 5
}, },
"_enabled": true, "_enabled": true,
"_cullingMask": 4294967295, "_cullingMask": 4294967295,
...@@ -247,10 +344,10 @@ ...@@ -247,10 +344,10 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 6 "__id__": 8
}, },
{ {
"__id__": 7 "__id__": 9
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -306,7 +403,7 @@ ...@@ -306,7 +403,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 5 "__id__": 7
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -338,7 +435,7 @@ ...@@ -338,7 +435,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 5 "__id__": 7
}, },
"_enabled": true, "_enabled": true,
"introSound": { "introSound": {
...@@ -357,10 +454,10 @@ ...@@ -357,10 +454,10 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 9 "__id__": 11
}, },
{ {
"__id__": 10 "__id__": 12
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -416,7 +513,7 @@ ...@@ -416,7 +513,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 8 "__id__": 10
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
...@@ -448,7 +545,7 @@ ...@@ -448,7 +545,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 8 "__id__": 10
}, },
"_enabled": true, "_enabled": true,
"_defaultClip": { "_defaultClip": {
...@@ -473,10 +570,10 @@ ...@@ -473,10 +570,10 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 12 "__id__": 14
}, },
{ {
"__id__": 14 "__id__": 16
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -532,7 +629,7 @@ ...@@ -532,7 +629,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 11 "__id__": 13
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
...@@ -541,7 +638,7 @@ ...@@ -541,7 +638,7 @@
"zoomScale": 1.2, "zoomScale": 1.2,
"clickEvents": [ "clickEvents": [
{ {
"__id__": 13 "__id__": 15
} }
], ],
"_N$interactable": true, "_N$interactable": true,
...@@ -614,7 +711,7 @@ ...@@ -614,7 +711,7 @@
{ {
"__type__": "cc.ClickEvent", "__type__": "cc.ClickEvent",
"target": { "target": {
"__id__": 11 "__id__": 13
}, },
"component": "", "component": "",
"_componentId": "4bc11amZLhJF7l5YKzcrMTW", "_componentId": "4bc11amZLhJF7l5YKzcrMTW",
...@@ -626,7 +723,7 @@ ...@@ -626,7 +723,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 11 "__id__": 13
}, },
"_enabled": true, "_enabled": true,
"volumeOnSprite": null, "volumeOnSprite": null,
...@@ -646,8 +743,8 @@ ...@@ -646,8 +743,8 @@
"width": 644, "width": 644,
"height": 1140 "height": 1140
}, },
"_fitWidth": false, "_fitWidth": true,
"_fitHeight": true, "_fitHeight": false,
"_id": "6cDBduULJLYZ9zQ79J1blC" "_id": "6cDBduULJLYZ9zQ79J1blC"
}, },
{ {
......
...@@ -10,8 +10,8 @@ const { ccclass, property } = cc._decorator; ...@@ -10,8 +10,8 @@ const { ccclass, property } = cc._decorator;
@ccclass @ccclass
export default class GamePlay extends cc.Component { export default class GamePlay extends cc.Component {
@property(cc.Node) blockContainer: cc.Node = null; @property(cc.Node) blockContainer: cc.Node = null;
@property(cc.Node) touchSpace: cc.Node = null;
@property(cc.Node) slots: cc.Node = null; @property(cc.Node) slots: cc.Node = null;
@property(cc.Node) replayButton: cc.Node = null;
@property(cc.Prefab) completeEffect: cc.Prefab = null; @property(cc.Prefab) completeEffect: cc.Prefab = null;
@property(Array(cc.Prefab)) blockTypes: Array<cc.Prefab> = @property(Array(cc.Prefab)) blockTypes: Array<cc.Prefab> =
new Array<cc.Prefab>(); new Array<cc.Prefab>();
...@@ -39,6 +39,7 @@ export default class GamePlay extends cc.Component { ...@@ -39,6 +39,7 @@ export default class GamePlay extends cc.Component {
currentLevel: number; currentLevel: number;
highestLevel: number; highestLevel: number;
isDown: boolean = false; isDown: boolean = false;
soundOnStartMove: boolean = false;
protected onLoad(): void { protected onLoad(): void {
cc.audioEngine.playEffect(this.soundBlockFall, false); cc.audioEngine.playEffect(this.soundBlockFall, false);
...@@ -96,7 +97,7 @@ export default class GamePlay extends cc.Component { ...@@ -96,7 +97,7 @@ export default class GamePlay extends cc.Component {
if (this.currentTouchLoc.y < block.lockUpY) { if (this.currentTouchLoc.y < block.lockUpY) {
block.node.position = cc.v3(block.node.position.x, pos.y); block.node.position = cc.v3(block.node.position.x, pos.y);
} }
} else if (!block.lockDown && pos.y > block.node.y) } else if (!block.lockUp && pos.y > block.node.y)
block.node.position = cc.v3(block.node.position.x, pos.y); block.node.position = cc.v3(block.node.position.x, pos.y);
} }
} }
...@@ -118,6 +119,10 @@ export default class GamePlay extends cc.Component { ...@@ -118,6 +119,10 @@ export default class GamePlay extends cc.Component {
} }
onTouchMove(event: cc.Event.EventTouch) { onTouchMove(event: cc.Event.EventTouch) {
if (!this.soundOnStartMove) {
this.soundOnStartMove = true;
cc.audioEngine.playEffect(this.soundBlockMove, false);
}
if (this.currentHoldingBlock == null) { if (this.currentHoldingBlock == null) {
this.isHolding = false; this.isHolding = false;
return; return;
...@@ -141,7 +146,7 @@ export default class GamePlay extends cc.Component { ...@@ -141,7 +146,7 @@ export default class GamePlay extends cc.Component {
block.lockLeftX = null; block.lockLeftX = null;
block.lockRightX = null; block.lockRightX = null;
} }
this.soundOnStartMove = false;
this.currentTouchLoc == null; this.currentTouchLoc == null;
this.isHolding = false; this.isHolding = false;
this.fitSlot(); this.fitSlot();
...@@ -156,6 +161,7 @@ export default class GamePlay extends cc.Component { ...@@ -156,6 +161,7 @@ export default class GamePlay extends cc.Component {
) { ) {
cc.audioEngine.playEffect(this.soundBlockMove, false); cc.audioEngine.playEffect(this.soundBlockMove, false);
this.numberNode.moveCount(); this.numberNode.moveCount();
this.isDown = false; this.isDown = false;
} }
} }
...@@ -261,8 +267,16 @@ export default class GamePlay extends cc.Component { ...@@ -261,8 +267,16 @@ export default class GamePlay extends cc.Component {
this.node.parent.convertToWorldSpaceAR(cc.Vec3.ZERO) this.node.parent.convertToWorldSpaceAR(cc.Vec3.ZERO)
); );
cc.tween(this.blockContainer).to(1, { opacity: 0 }).start(); cc.tween(this.blockContainer).to(1, { opacity: 0 }).start();
if (LocalStorage.getMinMoveAtLevel(this.currentLevel) == 0) {
LocalStorage.setMinMoveAtLevel(
this.currentLevel,
this.numberNode.currentNumber
);
}
if ( if (
LocalStorage.getMinMoveAtLevel(this.currentLevel) < LocalStorage.getMinMoveAtLevel(this.currentLevel) >
this.numberNode.currentNumber this.numberNode.currentNumber
) { ) {
LocalStorage.setMinMoveAtLevel( LocalStorage.setMinMoveAtLevel(
...@@ -279,8 +293,10 @@ export default class GamePlay extends cc.Component { ...@@ -279,8 +293,10 @@ export default class GamePlay extends cc.Component {
}) })
.delay(1.5) .delay(1.5)
.call(() => { .call(() => {
if (this.currentLevel + 1 == this.highestLevel) {
LocalStorage.setHighestLevel((this.highestLevel += 1));
}
LocalStorage.setCurrentLevel((this.currentLevel += 1)); LocalStorage.setCurrentLevel((this.currentLevel += 1));
LocalStorage.setHighestLevel((this.highestLevel += 1));
this.currentLevel = LocalStorage.getCurrentLevel(); this.currentLevel = LocalStorage.getCurrentLevel();
if (this.currentLevel > 39) { if (this.currentLevel > 39) {
cc.director.loadScene("start"); cc.director.loadScene("start");
...@@ -297,6 +313,7 @@ export default class GamePlay extends cc.Component { ...@@ -297,6 +313,7 @@ export default class GamePlay extends cc.Component {
effect.position = this.node.convertToNodeSpaceAR( effect.position = this.node.convertToNodeSpaceAR(
this.node.parent.convertToWorldSpaceAR(cc.Vec3.ZERO) this.node.parent.convertToWorldSpaceAR(cc.Vec3.ZERO)
); );
cc.tween(this.replayButton).to(1, { angle: 360 }).start();
cc.tween(this.blockContainer).to(1, { opacity: 0 }).start(); cc.tween(this.blockContainer).to(1, { opacity: 0 }).start();
cc.tween(this) cc.tween(this)
.delay(1) .delay(1)
...@@ -315,7 +332,6 @@ export default class GamePlay extends cc.Component { ...@@ -315,7 +332,6 @@ export default class GamePlay extends cc.Component {
let slots = this.slots.children; let slots = this.slots.children;
let closestSlot = null; let closestSlot = null;
let closestDis = 0; let closestDis = 0;
cc.audioEngine.playEffect(this.soundFitSlot, false);
if (this.currentHoldingBlock == null) return; if (this.currentHoldingBlock == null) return;
if ( if (
...@@ -399,6 +415,7 @@ export default class GamePlay extends cc.Component { ...@@ -399,6 +415,7 @@ export default class GamePlay extends cc.Component {
let blocks = this.blockContainer.children; let blocks = this.blockContainer.children;
let closestSlot = null; let closestSlot = null;
let closestDis = 0; let closestDis = 0;
cc.audioEngine.playEffect(this.soundFitSlot, false);
blocks.forEach((block) => { blocks.forEach((block) => {
if (block.name == "block_2" || block.name == "block_7") { if (block.name == "block_2" || block.name == "block_7") {
......
{ {
"ver": "2.0.3", "ver": "2.0.3",
"uuid": "a932074e-47a4-4d01-9a33-a6be2312b409", "uuid": "b81fe0e8-a88a-4b65-804b-e32fa08f13a1",
"importer": "audio-clip", "importer": "audio-clip",
"downloadMode": 0, "downloadMode": 0,
"duration": 0.783673, "duration": 0.809796,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
This diff is collapsed.
...@@ -6,8 +6,9 @@ body { ...@@ -6,8 +6,9 @@ body {
text-align: center; text-align: center;
background-color: black; background-color: black;
background-repeat: no-repeat;
background-image: url("./background.jpg"); background-size: cover;
background-image: url("./background.png");
font-family: Helvetica, Verdana, Arial, sans-serif; font-family: Helvetica, Verdana, Arial, sans-serif;
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"mainCompressionType": "default", "mainCompressionType": "default",
"mainIsRemote": false, "mainIsRemote": false,
"optimizeHotUpdate": false, "optimizeHotUpdate": false,
"md5Cache": true, "md5Cache": false,
"nativeMd5Cache": true, "nativeMd5Cache": true,
"encryptJs": true, "encryptJs": true,
"xxteaKey": "801d017f-45fe-4a", "xxteaKey": "801d017f-45fe-4a",
......
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