Commit 00772bb5 authored by Vũ Gia Vương's avatar Vũ Gia Vương

fix hammer

parent 8035a4db
import { BEAT_GUILD, CHECK_FRAGMENT, CHECK_TOUCH, eventTarget, HAMMER, RESET_BOTTLE, RESET_FRAGMENT, SHOW_CARD_POPUP, STOP_GUILD_TAP } from "../Events";
import { Global } from "../Global";
import FragmentController from "./FragmentController";
import TheController from "./TheController";
const { ccclass, property } = cc._decorator;
......@@ -39,7 +38,6 @@ export default class BreakingBottleController extends cc.Component {
this._fragmentsPosition = this._fragmentsNode.map(item => item.position.clone());
}
private beatGuild() {
this.onHammer(cc.v2(100));
}
......@@ -60,16 +58,13 @@ export default class BreakingBottleController extends cc.Component {
private onHammer(newPos: cc.Vec2) {
cc.Tween.stopAllByTarget(this.hammerNode);
this._spine.setAnimation(0, "Dap4", false);
this.hammerNode.active = true;
cc.tween(this.hammerNode)
.to(0, { active: false })
.to(0, { active: true })
.to(0, { position: cc.v3(newPos.x, newPos.y, 0), active: false })
.to(0, { active: true })
.to(0.5, { position: cc.v3(newPos.x, newPos.y, 0) })
.delay(1)
.to(0.5, { position: cc.v3(300) })
.call(() => this.hammerNode.active = false)
.start();
}
......@@ -95,6 +90,7 @@ export default class BreakingBottleController extends cc.Component {
private resetHammer() {
this.hammerNode.position = cc.v3(300);
this.hammerNode.active = false;
}
......
......@@ -54,7 +54,7 @@ export default class FragmentController extends cc.Component {
.call(() => {
this._physicsCollider.enabled = true;
this._rg.type = cc.RigidBodyType.Dynamic;
this._rg.gravityScale = 5;
this._rg.gravityScale = 10;
})
.delay(1)
.to(0, { scale: 1 })
......
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