diff --git a/JisolGameCocos/assets/resources/config/game/GRoleAttack.json b/JisolGameCocos/assets/resources/config/game/GRoleAttack.json index ea121e27..57af18e7 100644 --- a/JisolGameCocos/assets/resources/config/game/GRoleAttack.json +++ b/JisolGameCocos/assets/resources/config/game/GRoleAttack.json @@ -1 +1 @@ -{"10001":{"roleId":10001,"attackWay":"Normal","attackArgs":[]},"10002":{"roleId":10002,"attackWay":"Normal","attackArgs":[]},"10003":{"roleId":10003,"attackWay":"ParabolicRemote","attackArgs":["20001",0.4]}} \ No newline at end of file +{"10001":{"roleId":10001,"attackWay":"Normal","attackArgs":[]},"10002":{"roleId":10002,"attackWay":"Normal","attackArgs":[]},"10003":{"roleId":10003,"attackWay":"ParabolicRemote","attackArgs":["20001",0.6,"timo5 007"]}} \ No newline at end of file diff --git a/JisolGameCocos/assets/script/battle/base/attack/GAttackParabolicRemote.ts b/JisolGameCocos/assets/script/battle/base/attack/GAttackParabolicRemote.ts index 79d019ad..d7c3c5c3 100644 --- a/JisolGameCocos/assets/script/battle/base/attack/GAttackParabolicRemote.ts +++ b/JisolGameCocos/assets/script/battle/base/attack/GAttackParabolicRemote.ts @@ -4,13 +4,13 @@ import { app } from "../../../App"; import GRoleBase from "../role/GRoleBase"; import { GAttackBase, GAttackBullet } from "./GAttack"; import GButtleDefault from "../bullet/GButtleDefault"; -import { size } from "cc"; -import { Size } from "cc"; -import { Vec2 } from "cc"; -import { v2 } from "cc"; import { v3 } from "cc"; +import { bezier } from "cc"; +import { v2 } from "cc"; +import { Vec2 } from "cc"; /** * 抛物线普攻 + * 攻击子弹,子弹大小,龙骨-初始位置 */ export default class GAttackParabolicRemote implements GAttackBase{ @@ -18,7 +18,7 @@ export default class GAttackParabolicRemote implements GAttackBase{ //[子弹图片] let image:SpriteFrame = app.role.bullets[info.attackArgs[0]]; let scale:number = info.attackArgs[1] as unknown as number; - let bone = role.spine.findBone("timo5 007"); + let bone = role.spine.findBone(info.attackArgs[2]); console.log(role.spine,bone); let bullet = GAttackBullet.create(GButtleDefault,{ image:image, @@ -26,7 +26,29 @@ export default class GAttackParabolicRemote implements GAttackBase{ }); role.mode.addGObject(bullet); let world2 = role.node.worldPosition.clone().add(v3(bone.worldX,bone.worldY,0)) + + //设置子弹位置 bullet.node.setWorldPosition(v3(world2.x,world2.y,world2.z)) + + //子弹移动 + let start = bullet.v2World; + let end = role.fsm.enemy.v2World; + let center = v2(((start.x + end.x) / 2),((start.y + end.y) / 2) + (Math.abs((start.x - end.x)) / 2)); + // start.rotate(90).normalize().multiplyScalar(50); + + bullet.JTween({}) + .to({},Vec2.distance(start,end)*3) + .onUpdate((data,elapsed) => { + // console.log(data,elapsed,bezier(0,6,12,1,elapsed),bezier(0,6,12,1,elapsed)) + bullet.node.setWorldPosition(v3( + bezier(start.x,center.x,center.x,end.x,elapsed), + bezier(start.y,center.y,center.y,end.y,elapsed), + 0 + )) + }) + .start(); + + } } diff --git a/JisolGameCocos/assets/script/battle/base/bullet/GButtleDefault.ts b/JisolGameCocos/assets/script/battle/base/bullet/GButtleDefault.ts index ed63460e..60202f60 100644 --- a/JisolGameCocos/assets/script/battle/base/bullet/GButtleDefault.ts +++ b/JisolGameCocos/assets/script/battle/base/bullet/GButtleDefault.ts @@ -12,7 +12,6 @@ const { ccclass, property } = _decorator; export interface GButtleDefaultInfo{ image:SpriteFrame;//子弹图片 scale:number; //子弹大小 - start:Vec2; //子弹初始位置 } //默认子弹类 diff --git a/JisolGameCocos/assets/script/battle/base/role/GRoleBase.ts b/JisolGameCocos/assets/script/battle/base/role/GRoleBase.ts index ef869993..e64c4e6e 100644 --- a/JisolGameCocos/assets/script/battle/base/role/GRoleBase.ts +++ b/JisolGameCocos/assets/script/battle/base/role/GRoleBase.ts @@ -170,12 +170,12 @@ export default abstract class GRoleBase extends GObject{ console.log("onFly"); let vWorld = this.node.worldPosition; let vEndWorld = this.getWorldBackLen(v2(800,500)); - JTween(vWorld) - .to({x:vEndWorld.x},500) + this.JTween(vWorld) + .to({x:vEndWorld.x},600) .onUpdate(pos => this.node.worldPosition = vWorld) .start(); - JTween(vWorld) - .to({y:vEndWorld.y},500) + this.JTween(vWorld) + .to({y:vEndWorld.y},600) .easing(JEasing.Circular.Out) .onUpdate(pos => this.node.worldPosition = vWorld) .start(); diff --git a/JisolGameCocos/assets/script/battle/base/role/PVP/GRolePVPEntity.ts b/JisolGameCocos/assets/script/battle/base/role/PVP/GRolePVPEntity.ts index d02158ce..565354c4 100644 --- a/JisolGameCocos/assets/script/battle/base/role/PVP/GRolePVPEntity.ts +++ b/JisolGameCocos/assets/script/battle/base/role/PVP/GRolePVPEntity.ts @@ -71,7 +71,7 @@ export default class GRolePVPEntity extends GRoleBase{ if(this.isDie){ //销毁数据 this.mode.killRole(this); - this.node.removeFromParent(); + // this.node.removeFromParent(); } } diff --git a/JisolGameCocos/config/GRoleAttack.xlsx b/JisolGameCocos/config/GRoleAttack.xlsx index 7e361a0d..620e3f6c 100644 Binary files a/JisolGameCocos/config/GRoleAttack.xlsx and b/JisolGameCocos/config/GRoleAttack.xlsx differ diff --git a/JisolGameCocos/extensions/ngame b/JisolGameCocos/extensions/ngame index 79372047..68c2a35b 160000 --- a/JisolGameCocos/extensions/ngame +++ b/JisolGameCocos/extensions/ngame @@ -1 +1 @@ -Subproject commit 793720478680b54892b7f43b880c435f3f1c6990 +Subproject commit 68c2a35bfd51ef351accf992f9637c9ce152ebe6