Commit 5ceadf6d authored by Vũ Gia Vương's avatar Vũ Gia Vương

add hammer

parent 21489ab8
......@@ -99,10 +99,10 @@
"_active": true,
"_components": [
{
"__id__": 176
"__id__": 180
},
{
"__id__": 177
"__id__": 181
}
],
"_prefab": null,
......@@ -5144,12 +5144,15 @@
},
{
"__id__": 172
},
{
"__id__": 175
}
],
"_active": true,
"_components": [
{
"__id__": 175
"__id__": 179
}
],
"_prefab": null,
......@@ -8266,6 +8269,186 @@
},
"_id": "55p7kNBX9GUKwcKmGcqJ9A"
},
{
"__type__": "cc.Node",
"_name": "Hammer",
"_objFlags": 0,
"_parent": {
"__id__": 110
},
"_children": [
{
"__id__": 176
}
],
"_active": true,
"_components": [
{
"__id__": 178
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 400,
"height": 600
},
"_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": "ecEAZtsQ1M86ZSI5xa+HtN"
},
{
"__type__": "cc.Node",
"_name": "Bua",
"_objFlags": 0,
"_parent": {
"__id__": 175
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 177
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 462.01,
"height": 540.78
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
200,
-150,
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": "eb8hbSoSxMx7ZXOGQBwKBk"
},
{
"__type__": "sp.Skeleton",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 176
},
"_enabled": true,
"_materials": [
{
"__uuid__": "7afd064b-113f-480e-b793-8817d19f63c3"
}
],
"paused": false,
"defaultSkin": "Bua",
"defaultAnimation": "Dap4",
"_preCacheMode": 0,
"_cacheMode": 0,
"loop": true,
"premultipliedAlpha": true,
"timeScale": 1,
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_skeletonCache": null,
"_animationName": "Dap4",
"_animationQueue": [],
"_headAniInfo": null,
"_playTimes": 0,
"_isAniComplete": true,
"_N$skeletonData": {
"__uuid__": "a5d5b5a3-7ac9-4207-a35a-9fd1ce088b83"
},
"_N$_defaultCacheMode": 0,
"_N$debugSlots": false,
"_N$debugBones": false,
"_N$debugMesh": false,
"_N$useTint": false,
"_N$enableBatch": false,
"_id": "0dlMrbSXxJU6Vbpc+nVqiW"
},
{
"__type__": "fa954JGo2FPTIS/o0ccP3kC",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 175
},
"_enabled": true,
"_id": "9a4ytEMJlKtKZ1ogOoLQA/"
},
{
"__type__": "90267gmddZPkLBW/eIiYJR6",
"_name": "",
......@@ -8277,6 +8460,9 @@
"spriteNode": {
"__id__": 167
},
"hammerNode": {
"__id__": 175
},
"_id": "4eyUw4PwxKSq63DGUgJory"
},
{
......
......@@ -15,7 +15,6 @@ export default class FragmentController extends cc.Component {
this._physicsCollider = this.node.getComponent(cc.PhysicsPolygonCollider);
this._physicsCollider.points = this._collider.points;
this._physicsCollider.enabled = false;
this._rg = this.node.getComponent(cc.RigidBody);
eventTarget.on(CHECK_TOUCH, this.checkTouch, this);
......@@ -39,7 +38,7 @@ export default class FragmentController extends cc.Component {
.call(() => {
this._physicsCollider.enabled = true;
this._rg.type = cc.RigidBodyType.Dynamic;
this._rg.gravityScale = 2;
this._rg.gravityScale = 5;
})
.start();
}
......
......@@ -8,6 +8,8 @@ export default class BreakingBottleScreen extends cc.Component {
@property(cc.Node)
private spriteNode: cc.Node = null;
@property(cc.Node)
private hammerNode: cc.Node = null;
onLoad() {
cc.director.getPhysicsManager().enabled = true;
......@@ -22,6 +24,7 @@ export default class BreakingBottleScreen extends cc.Component {
this.spriteNode.position = cc.v3(nodePos.x, nodePos.y);
eventTarget.emit(CHECK_TOUCH, nodePos);
this.hammerNode.position = cc.v3(nodePos.x, nodePos.y);
}
}
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