This commit is contained in:
DESKTOP-5RP3AKU\Jisol 2023-10-28 02:51:05 +08:00
parent c4e6d02388
commit 324736a619
7 changed files with 34 additions and 13 deletions

View File

@ -1 +1 @@
{"10001":{"roleId":10001,"attackWay":"Normal","attackArgs":[]},"10002":{"roleId":10002,"attackWay":"Normal","attackArgs":[]},"10003":{"roleId":10003,"attackWay":"ParabolicRemote","attackArgs":["20001",0.4]}}
{"10001":{"roleId":10001,"attackWay":"Normal","attackArgs":[]},"10002":{"roleId":10002,"attackWay":"Normal","attackArgs":[]},"10003":{"roleId":10003,"attackWay":"ParabolicRemote","attackArgs":["20001",0.6,"timo5 007"]}}

View File

@ -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();
}
}

View File

@ -12,7 +12,6 @@ const { ccclass, property } = _decorator;
export interface GButtleDefaultInfo{
image:SpriteFrame;//子弹图片
scale:number; //子弹大小
start:Vec2; //子弹初始位置
}
//默认子弹类

View File

@ -170,12 +170,12 @@ export default abstract class GRoleBase<T> extends GObject<T>{
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();

View File

@ -71,7 +71,7 @@ export default class GRolePVPEntity extends GRoleBase<GDemoMessage>{
if(this.isDie){
//销毁数据
this.mode.killRole(this);
this.node.removeFromParent();
// this.node.removeFromParent();
}
}

@ -1 +1 @@
Subproject commit 793720478680b54892b7f43b880c435f3f1c6990
Subproject commit 68c2a35bfd51ef351accf992f9637c9ce152ebe6