display fieldVec which is more accurate to the attack's hitbox for now

This commit is contained in:
2025-02-07 10:40:47 +00:00
parent 35eab0f789
commit f6cd818c42

View File

@@ -558,6 +558,10 @@ struct
val {x, y, ...} = player val {x, y, ...} = player
val wratio = width / Constants.worldWidthReal val wratio = width / Constants.worldWidthReal
val hratio = height / Constants.worldHeightReal val hratio = height / Constants.worldHeightReal
val x =
case #facing player of
FACING_RIGHT => x + Constants.playerSize
| FACING_LEFT => x - Constants.playerSize
in in
if wratio < hratio then if wratio < hratio then
let let
@@ -567,12 +571,10 @@ struct
else if height < scale then (scale - height) / 2.0 else if height < scale then (scale - height) / 2.0
else 0.0 else 0.0
val x = (Real32.fromInt x - Constants.halfPlayerSizeReal) * wratio val x = Real32.fromInt x * wratio
val y = val y = Real32.fromInt y * wratio + yOffset
(Real32.fromInt y - Constants.halfPlayerSizeReal) * wratio
+ yOffset
val realSize = (Constants.playerSizeReal * 2.0) * wratio val realSize = (Constants.playerSizeReal) * wratio
val {charge, ...} = player val {charge, ...} = player
val alpha = Real32.fromInt charge / 60.0 val alpha = Real32.fromInt charge / 60.0
@@ -588,12 +590,10 @@ struct
else if width < scale then (scale - width) / 2.0 else if width < scale then (scale - width) / 2.0
else 0.0 else 0.0
val x = val x = Real32.fromInt x * hratio + xOffset
(Real32.fromInt x - Constants.halfPlayerSizeReal) * hratio val y = Real32.fromInt y * hratio
+ xOffset
val y = (Real32.fromInt y - Constants.halfPlayerSizeReal) * hratio
val realSize = (Constants.playerSizeReal * 2.0) * hratio val realSize = (Constants.playerSizeReal) * hratio
val {charge, ...} = player val {charge, ...} = player
val alpha = Real32.fromInt charge / 60.0 val alpha = Real32.fromInt charge / 60.0