draw player differently when they are attacking (player is just different colour for now; placeholder asset to change for later)
This commit is contained in:
@@ -597,18 +597,30 @@ struct
|
|||||||
end
|
end
|
||||||
|
|
||||||
(* block is placeholder asset *)
|
(* block is placeholder asset *)
|
||||||
fun helpGetDrawVec (x, y, size, width, height, attacked) =
|
fun helpGetDrawVec (x, y, size, width, height, attacked, mainAttack) =
|
||||||
case attacked of
|
case mainAttack of
|
||||||
|
MAIN_NOT_ATTACKING =>
|
||||||
|
(case attacked of
|
||||||
NOT_ATTACKED =>
|
NOT_ATTACKED =>
|
||||||
Block.lerp (x, y, size, size, width, height, 0.5, 0.5, 0.5)
|
Block.lerp (x, y, size, size, width, height, 0.5, 0.5, 0.5)
|
||||||
| ATTACKED amt =>
|
| ATTACKED amt =>
|
||||||
if amt mod 5 = 0 then
|
if amt mod 5 = 0 then
|
||||||
Block.lerp (x, y, size, size, width, height, 0.9, 0.9, 0.9)
|
Block.lerp (x, y, size, size, width, height, 0.9, 0.9, 0.9)
|
||||||
else
|
else
|
||||||
Block.lerp (x, y, size, size, width, height, 0.5, 0.5, 0.5)
|
Block.lerp (x, y, size, size, width, height, 0.5, 0.5, 0.5))
|
||||||
|
| MAIN_ATTACKING _ =>
|
||||||
|
(case attacked of
|
||||||
|
NOT_ATTACKED =>
|
||||||
|
Block.lerp (x, y, size, size, width, height, 1.0, 0.5, 0.5)
|
||||||
|
| ATTACKED amt =>
|
||||||
|
if amt mod 5 = 0 then
|
||||||
|
Block.lerp (x, y, size, size, width, height, 1.0, 0.9, 0.9)
|
||||||
|
else
|
||||||
|
Block.lerp (x, y, size, size, width, height, 1.0, 0.5, 0.5))
|
||||||
|
|
||||||
fun getDrawVec ({x, y, attacked, ...}: player, width, height) =
|
fun getDrawVec (player: player, width, height) =
|
||||||
let
|
let
|
||||||
|
val {x, y, attacked, mainAttack, ...} = player
|
||||||
val wratio = width / 1920.0
|
val wratio = width / 1920.0
|
||||||
val hratio = height / 1080.0
|
val hratio = height / 1080.0
|
||||||
in
|
in
|
||||||
@@ -625,7 +637,7 @@ struct
|
|||||||
|
|
||||||
val realSize = realSize * wratio
|
val realSize = realSize * wratio
|
||||||
in
|
in
|
||||||
helpGetDrawVec (x, y, realSize, width, height, attacked)
|
helpGetDrawVec (x, y, realSize, width, height, attacked, mainAttack)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
let
|
let
|
||||||
@@ -640,7 +652,7 @@ struct
|
|||||||
|
|
||||||
val realSize = realSize * hratio
|
val realSize = realSize * hratio
|
||||||
in
|
in
|
||||||
helpGetDrawVec (x, y, realSize, width, height, attacked)
|
helpGetDrawVec (x, y, realSize, width, height, attacked, mainAttack)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user