mirror of
https://github.com/He4eT/DotDashPit.git
synced 2026-05-04 17:37:23 +00:00
game: extract effectHandlers
This commit is contained in:
parent
8e6723efc3
commit
66a70082cf
1 changed files with 40 additions and 42 deletions
6
game.js
6
game.js
|
|
@ -396,7 +396,7 @@ const effectHandlers = {
|
||||||
line(x, y, x, y - dy * w, color)
|
line(x, y, x, y - dy * w, color)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
function drawFX() {
|
function drawFX() {
|
||||||
effects
|
effects
|
||||||
|
|
@ -405,9 +405,7 @@ function drawFX() {
|
||||||
from: arenaToScreen(effect.from ?? {}),
|
from: arenaToScreen(effect.from ?? {}),
|
||||||
to: arenaToScreen(effect.to ?? {}),
|
to: arenaToScreen(effect.to ?? {}),
|
||||||
}))
|
}))
|
||||||
.forEach((effect) =>
|
.forEach((effect) => effectHandlers[effect.type](effect))
|
||||||
effectHandlers[effect.type](effect),
|
|
||||||
)
|
|
||||||
|
|
||||||
effects = effects.filter(({ frames }) => frames.length > 0)
|
effects = effects.filter(({ frames }) => frames.length > 0)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue