mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
update
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user