fix: 分裂弹幕在摧毁后应该分裂

This commit is contained in:
unanmed 2024-12-28 16:45:05 +08:00
parent fc3a8fb81f
commit 8b5f94b65b
3 changed files with 45 additions and 0 deletions

View File

@ -17,6 +17,7 @@
"@ant-design/icons-vue": "^6.1.0",
"@emotion/css": "^11.13.0",
"@vueuse/core": "^10.11.1",
"@wasm-audio-decoders/ogg-vorbis": "^0.1.16",
"anon-tokyo": "0.0.0-alpha.0",
"ant-design-vue": "^3.2.20",
"axios": "^1.7.4",

View File

@ -17,6 +17,9 @@ importers:
'@vueuse/core':
specifier: ^10.11.1
version: 10.11.1(vue@3.5.13(typescript@5.5.4))
'@wasm-audio-decoders/ogg-vorbis':
specifier: ^0.1.16
version: 0.1.16
anon-tokyo:
specifier: 0.0.0-alpha.0
version: 0.0.0-alpha.0
@ -1357,6 +1360,9 @@ packages:
cpu: [x64]
os: [win32]
'@eshaz/web-worker@1.2.2':
resolution: {integrity: sha512-WxXiHFmD9u/owrzempiDlBB1ZYqiLnm9s6aPc8AlFQalq2tKmqdmMr9GXOupDgzXtqnBipj8Un0gkIm7Sjf8mw==}
'@gar/promisify@1.1.3':
resolution: {integrity: sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==}
@ -1638,6 +1644,12 @@ packages:
'@vueuse/shared@10.11.1':
resolution: {integrity: sha512-LHpC8711VFZlDaYUXEBbFBCQ7GS3dVU9mjOhhMhXP6txTV4EhYQg/KGnQuvt/sPAtoUKq7VVUnL6mVtFoL42sA==}
'@wasm-audio-decoders/common@9.0.5':
resolution: {integrity: sha512-b9JNh9sPAvn8PVIizNh9D60WkfQong/u9ea873H47u7zvVDLctxYIp2aZw9CQqXaQdk7JB3MoU5UHiseO40swg==}
'@wasm-audio-decoders/ogg-vorbis@0.1.16':
resolution: {integrity: sha512-HcEx4LPZbbzjhs9bTXgMaXLVCSMSo/egY9paJxAnE9tsYbvseAaGtVddLYktl3Qi/G+nW/ZzUXg4144izJjqCw==}
'@xmldom/xmldom@0.8.10':
resolution: {integrity: sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==}
engines: {node: '>=10.0.0'}
@ -1869,6 +1881,9 @@ packages:
code-points@2.0.0-1:
resolution: {integrity: sha512-PuPoUdSqHY96e+CvEGe0+J9XkEqnQ4o79X+k+PJlZ84sZDoSJ2Q8/1OJT4dqYn8yL5EUxGCq/x2EcLEfvcGqaw==}
codec-parser@2.5.0:
resolution: {integrity: sha512-Ru9t80fV8B0ZiixQl8xhMTLru+dzuis/KQld32/x5T/+3LwZb0/YvQdSKytX9JqCnRdiupvAvyYJINKrXieziQ==}
color-convert@1.9.3:
resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==}
@ -3175,6 +3190,9 @@ packages:
signal-exit@3.0.7:
resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
simple-yenc@1.0.4:
resolution: {integrity: sha512-5gvxpSd79e9a3V4QDYUqnqxeD4HGlhCakVpb6gMnDD7lexJggSBJRBO5h52y/iJrdXRilX9UCuDaIJhSWm5OWw==}
slash@2.0.0:
resolution: {integrity: sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==}
engines: {node: '>=6'}
@ -4838,6 +4856,8 @@ snapshots:
'@esbuild/win32-x64@0.23.1':
optional: true
'@eshaz/web-worker@1.2.2': {}
'@gar/promisify@1.1.3': {}
'@jridgewell/gen-mapping@0.3.5':
@ -5183,6 +5203,16 @@ snapshots:
- '@vue/composition-api'
- vue
'@wasm-audio-decoders/common@9.0.5':
dependencies:
'@eshaz/web-worker': 1.2.2
simple-yenc: 1.0.4
'@wasm-audio-decoders/ogg-vorbis@0.1.16':
dependencies:
'@wasm-audio-decoders/common': 9.0.5
codec-parser: 2.5.0
'@xmldom/xmldom@0.8.10': {}
abbrev@1.1.1: {}
@ -5462,6 +5492,8 @@ snapshots:
dependencies:
code-point: 1.1.0
codec-parser@2.5.0: {}
color-convert@1.9.3:
dependencies:
color-name: 1.1.3
@ -6841,6 +6873,8 @@ snapshots:
signal-exit@3.0.7: {}
simple-yenc@1.0.4: {}
slash@2.0.0: {}
smart-buffer@4.2.0: {}

View File

@ -69,6 +69,9 @@ export class SplittableBall extends Projectile<PalaceBoss> {
private ax: number = 0;
private ay: number = 0;
/** 是否已经分裂过 */
private splitted: boolean = false;
static init(colors: Record<string, string[]>) {
this.ball.clear();
for (const [key, color] of Object.entries(colors)) {
@ -192,6 +195,8 @@ export class SplittableBall extends Projectile<PalaceBoss> {
private split(boss: PalaceBoss) {
if (!this.splitData?.split) return;
if (this.splitted) return;
this.splitted = true;
const {
startAngle,
endAngle,
@ -258,4 +263,9 @@ export class SplittableBall extends Projectile<PalaceBoss> {
const ctx = canvas.ctx;
ctx.drawImage(texture.canvas, this.x - 16, this.y - 16, 32, 32);
}
destroy(): void {
this.split(this.boss);
super.destroy();
}
}