Commit 206d1651 authored by Vũ Gia Vương's avatar Vũ Gia Vương

add tutorial, sprite fragment

parent 4cd1b5ee
This diff is collapsed.
{
"ver": "2.3.7",
"uuid": "1dea3e9f-3ceb-4f42-830f-62d96c35878d",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 283,
"height": 199,
"platformSettings": {},
"subMetas": {
"3 copy 2": {
"ver": "1.0.6",
"uuid": "c75a5b3d-beed-44d2-b507-2b610bfcdf78",
"importer": "sprite-frame",
"rawTextureUuid": "1dea3e9f-3ceb-4f42-830f-62d96c35878d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 283,
"height": 199,
"rawWidth": 283,
"rawHeight": 199,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.7",
"uuid": "5fd52759-45a6-4b36-9832-1be50933da9d",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 237,
"height": 212,
"platformSettings": {},
"subMetas": {
"3 copy": {
"ver": "1.0.6",
"uuid": "d9decce6-590a-47b0-bad7-aee365a4b45a",
"importer": "sprite-frame",
"rawTextureUuid": "5fd52759-45a6-4b36-9832-1be50933da9d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 237,
"height": 212,
"rawWidth": 237,
"rawHeight": 212,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.7",
"uuid": "8d9e57b1-563f-40b3-aaed-cd8d4e8c6255",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 217,
"height": 225,
"platformSettings": {},
"subMetas": {
"6 copy 2": {
"ver": "1.0.6",
"uuid": "4176edff-03cb-4219-9c89-a99ef9c740ae",
"importer": "sprite-frame",
"rawTextureUuid": "8d9e57b1-563f-40b3-aaed-cd8d4e8c6255",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 217,
"height": 225,
"rawWidth": 217,
"rawHeight": 225,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.7",
"uuid": "163fa625-c63f-4ccd-bda2-e2ee8d4ab844",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 168,
"height": 310,
"platformSettings": {},
"subMetas": {
"6 copy": {
"ver": "1.0.6",
"uuid": "ae7ba715-3fca-4a44-94bb-b1d9c7d2286f",
"importer": "sprite-frame",
"rawTextureUuid": "163fa625-c63f-4ccd-bda2-e2ee8d4ab844",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 168,
"height": 310,
"rawWidth": 168,
"rawHeight": 310,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
import { CHECK_FRAGMENT, CHECK_TOUCH, eventTarget, HAMMER, RESET_BOTTLE, RESET_FRAGMENT, SHOW_CARD_POPUP } from "../Events"; 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 { Global } from "../Global";
import FragmentController from "./FragmentController"; import FragmentController from "./FragmentController";
import TheController from "./TheController"; import TheController from "./TheController";
...@@ -33,11 +33,17 @@ export default class BreakingBottleController extends cc.Component { ...@@ -33,11 +33,17 @@ export default class BreakingBottleController extends cc.Component {
eventTarget.on(CHECK_FRAGMENT, this.checkFragment, this); eventTarget.on(CHECK_FRAGMENT, this.checkFragment, this);
eventTarget.on(HAMMER, this.onHammer, this); eventTarget.on(HAMMER, this.onHammer, this);
eventTarget.on(RESET_BOTTLE, this.resetBottle, this); eventTarget.on(RESET_BOTTLE, this.resetBottle, this);
eventTarget.on(BEAT_GUILD, this.beatGuild, this);
this._fragmentsNode = this.getComponentsInChildren(FragmentController).map(item => item.node); this._fragmentsNode = this.getComponentsInChildren(FragmentController).map(item => item.node);
this._fragmentsPosition = this._fragmentsNode.map(item => item.position.clone()); this._fragmentsPosition = this._fragmentsNode.map(item => item.position.clone());
} }
private beatGuild() {
this.onHammer(cc.v2(100));
}
protected start(): void { protected start(): void {
this.hideHammer(); this.hideHammer();
} }
...@@ -54,10 +60,17 @@ export default class BreakingBottleController extends cc.Component { ...@@ -54,10 +60,17 @@ export default class BreakingBottleController extends cc.Component {
} }
private onHammer(newPos: cc.Vec2) { private onHammer(newPos: cc.Vec2) {
this.hammerNode.active = false;
this.scheduleOnce(() => this.hammerNode.active = true, 0);
cc.Tween.stopAllByTarget(this.hammerNode);
this._spine.setAnimation(0, "Dap4", false);
cc.tween(this.hammerNode) cc.tween(this.hammerNode)
.to(0.1, { opacity: 255, position: cc.v3(newPos.x, newPos.y), active: true }) .to(0, { opacity: 255, position: cc.v3(newPos.x, newPos.y, 0), active: false })
.delay(0.7) .to(0, { active: true })
.to(0.2, { opacity: 0, active: false }) .delay(1)
.to(0.5, { position: cc.v3(300) })
.start(); .start();
} }
...@@ -69,6 +82,7 @@ export default class BreakingBottleController extends cc.Component { ...@@ -69,6 +82,7 @@ export default class BreakingBottleController extends cc.Component {
} }
private onTouchStart(event: cc.Event.EventTouch) { private onTouchStart(event: cc.Event.EventTouch) {
eventTarget.emit(STOP_GUILD_TAP);
const pos = event.getLocation(); const pos = event.getLocation();
const nodePos = this.node.convertToNodeSpaceAR(pos); const nodePos = this.node.convertToNodeSpaceAR(pos);
...@@ -84,7 +98,8 @@ export default class BreakingBottleController extends cc.Component { ...@@ -84,7 +98,8 @@ export default class BreakingBottleController extends cc.Component {
} }
private hideHammer() { private hideHammer() {
this.hammerNode.opacity = 0; // this.hammerNode.opacity = 0;
this.hammerNode.position = cc.v3(300);
} }
......
...@@ -10,7 +10,8 @@ export default class TapTutorialController extends cc.Component { ...@@ -10,7 +10,8 @@ export default class TapTutorialController extends cc.Component {
[this._hand] = this.node.children; [this._hand] = this.node.children;
eventTarget.on(STOP_GUILD_TAP, this.stopGuild, this); eventTarget.on(STOP_GUILD_TAP, this.stopGuild, this);
this.tutorialTap(); // this.tutorialTap();
this.tutorialTapForFragements();
} }
private stopGuild() { private stopGuild() {
...@@ -27,7 +28,22 @@ export default class TapTutorialController extends cc.Component { ...@@ -27,7 +28,22 @@ export default class TapTutorialController extends cc.Component {
.to(0.2, { angle: -15 }) .to(0.2, { angle: -15 })
.to(0.15, { position: cc.v3(110, 80) }) .to(0.15, { position: cc.v3(110, 80) })
.call(() => eventTarget.emit(BEAT_GUILD)) .call(() => eventTarget.emit(BEAT_GUILD))
.delay(0.8) .delay(1)
)
.start();
}
private tutorialTapForFragements() {
this._hand.active = true;
cc.tween(this._hand)
.repeatForever(cc.tween(this._hand)
.to(0, { position: cc.v3(120, 100), opacity: 255 })
.to(0.2, { angle: 15 })
.to(0.2, { angle: -15 })
.to(0.15, { position: cc.v3(110, 80) })
.call(() => eventTarget.emit(BEAT_GUILD))
.to(0.5, { opacity: 0 })
.delay(2)
) )
.start(); .start();
} }
......
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