Commit 8799e407 authored by Vũ Gia Vương's avatar Vũ Gia Vương

update tutorial

parent c3ca71ee
This diff is collapsed.
...@@ -17,4 +17,6 @@ export const PLAY_ANIM_NUT3 = 'PLAY_ANIM_NUT3'; ...@@ -17,4 +17,6 @@ export const PLAY_ANIM_NUT3 = 'PLAY_ANIM_NUT3';
export const PLAY_ANIM_NUT4 = 'PLAY_ANIM_NUT4'; export const PLAY_ANIM_NUT4 = 'PLAY_ANIM_NUT4';
export const ROTATE_GUILD = 'ROTATE_GUILD'; export const ROTATE_GUILD = 'ROTATE_GUILD';
export const STOP_GUILD = 'STOP_GUILD'; export const BEAT_GUILD = 'BEAT_GUILD';
\ No newline at end of file export const STOP_GUILD_ROTATE = 'STOP_GUILD_ROTATE';
export const STOP_GUILD_TAP = 'STOP_GUILD_TAP';
\ No newline at end of file
import { eventTarget, PLAY_ANIM_NUT1, PLAY_ANIM_NUT2, PLAY_ANIM_NUT3, PLAY_ANIM_NUT4, PLAY_BREAKING_SOUND, PLAY_DROP_SOUND, SHOW_CARD_POPUP } from "../Events"; import { BEAT_GUILD, eventTarget, PLAY_ANIM_NUT1, PLAY_ANIM_NUT2, PLAY_ANIM_NUT3, PLAY_ANIM_NUT4, PLAY_BREAKING_SOUND, PLAY_DROP_SOUND, SHOW_CARD_POPUP, STOP_GUILD_TAP } from "../Events";
import { Global } from "../Global"; import { Global } from "../Global";
...@@ -20,6 +20,14 @@ export default class BuaController extends cc.Component { ...@@ -20,6 +20,14 @@ export default class BuaController extends cc.Component {
this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this); this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this);
this.node.on(cc.Node.EventType.TOUCH_END, this.onTouchEnd, this); this.node.on(cc.Node.EventType.TOUCH_END, this.onTouchEnd, this);
this._actions = [this.playAnimationDap1, this.playAnimationDap2, this.playAnimationDap3, this.playAnimationDap4]; this._actions = [this.playAnimationDap1, this.playAnimationDap2, this.playAnimationDap3, this.playAnimationDap4];
eventTarget.on(BEAT_GUILD, this.beatGuild, this);
}
private beatGuild() {
this.spine.setAnimation(0, "Dap2", false);
this.spine.timeScale = 1.3;
this.playSound();
} }
public onSetTool() { public onSetTool() {
...@@ -35,12 +43,13 @@ export default class BuaController extends cc.Component { ...@@ -35,12 +43,13 @@ export default class BuaController extends cc.Component {
} }
private onTouchStart(): void { private onTouchStart(): void {
if(!this._isPlay){ eventTarget.emit(STOP_GUILD_TAP);
if (!this._isPlay) {
return; return;
} }
this._actions[Global.tool + this._count].bind(this)(); this._actions[Global.tool + this._count].bind(this)();
this._count++; this._count++;
if(Global.tool + this._count > 3 ){ if (Global.tool + this._count > 3) {
this._isPlay = false; this._isPlay = false;
} }
} }
......
import { eventTarget, PLAY_ROLLING_SOUND, ROTATE_GUILD, STOP_GUILD } from "../Events"; import { eventTarget, PLAY_ROLLING_SOUND, ROTATE_GUILD, STOP_GUILD_ROTATE } from "../Events";
import { TrackEntry } from "../Utils"; import { TrackEntry } from "../Utils";
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
...@@ -50,8 +50,8 @@ export default class HuController extends cc.Component { ...@@ -50,8 +50,8 @@ export default class HuController extends cc.Component {
} }
private onTouchStart(event: cc.Event.EventTouch): void { private onTouchStart(event: cc.Event.EventTouch): void {
eventTarget.emit(STOP_GUILD); eventTarget.emit(STOP_GUILD_ROTATE);
// if (!this._pointStart) { // if (!this._pointStart) {
// this.setRotateAnim(); // this.setRotateAnim();
// } // }
......
{
"ver": "1.1.3",
"uuid": "3d0048a6-0bc0-4625-a1b9-e7efb330f291",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
import { eventTarget, ROTATE_GUILD, STOP_GUILD } from "../Events"; import { eventTarget, ROTATE_GUILD, STOP_GUILD_ROTATE } from "../Events";
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
@ccclass @ccclass
export default class TutorialController extends cc.Component { export default class RotateTutorialController extends cc.Component {
private _hand: cc.Node; private _hand: cc.Node;
protected onLoad(): void { protected onLoad(): void {
[this._hand] = this.node.children; [this._hand] = this.node.children;
eventTarget.on(STOP_GUILD_ROTATE, this.stopGuild, this);
this.tutorialRotate(); this.tutorialRotate();
eventTarget.on(STOP_GUILD, this.stopGuild, this);
} }
private stopGuild() { private stopGuild() {
...@@ -20,7 +20,7 @@ export default class TutorialController extends cc.Component { ...@@ -20,7 +20,7 @@ export default class TutorialController extends cc.Component {
private tutorialRotate() { private tutorialRotate() {
this._hand.active = true; this._hand.active = true;
cc.tween(this._hand) cc.tween(this._hand)
.repeatForever(cc.tween(this._hand) .repeatForever(cc.tween(this._hand)
.to(0, { position: cc.v3(350) }, { easing: 'easingOutQuad' }) .to(0, { position: cc.v3(350) }, { easing: 'easingOutQuad' })
......
{ {
"ver": "1.1.0", "ver": "1.1.0",
"uuid": "3bfa65da-3350-411d-a61c-9a13db8fb529", "uuid": "245c4f1c-7b7e-4244-b576-57d18ca4fec5",
"importer": "typescript", "importer": "typescript",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
......
import { BEAT_GUILD, eventTarget, STOP_GUILD_TAP } from "../Events";
const { ccclass, property } = cc._decorator;
@ccclass
export default class TapTutorialController extends cc.Component {
private _hand: cc.Node;
protected onLoad(): void {
[this._hand] = this.node.children;
eventTarget.on(STOP_GUILD_TAP, this.stopGuild, this);
this.tutorialTap();
}
private stopGuild() {
cc.Tween.stopAllByTarget(this._hand);
this._hand.active = false;
}
private tutorialTap() {
this._hand.active = true;
cc.tween(this._hand)
.repeatForever(cc.tween(this._hand)
.to(0, { position: cc.v3(120, 100) }, { easing: 'easingOutQuad' })
.to(0.2, { angle: 15 }, { easing: 'easingInQuad' })
.to(0.2, { angle: -15 })
.to(0.15, { position: cc.v3(110, 80) })
.call(() => eventTarget.emit(BEAT_GUILD))
.delay(0.8)
)
.start();
}
}
{
"ver": "1.1.0",
"uuid": "2c2cb747-c101-4276-940c-03fcd7cc11ad",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
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