Add shadow to drop animation.
This commit is contained in:
parent
86b5f96092
commit
dfabe05d94
@ -610,6 +610,9 @@ const INTERFACE = {
|
||||
time = time * time;
|
||||
let play = INTERFACE_DATA.Animate.play;
|
||||
|
||||
let piece = INTERFACE_DATA.Animate.piece;
|
||||
let target = INTERFACE_DATA.Animate.target;
|
||||
|
||||
// Get to and from coordinates.
|
||||
let coord_to = HEX.tile_to_hex(play.to);
|
||||
if((INTERFACE_DATA.player & 1) ^ INTERFACE_DATA.rotate == 1) {
|
||||
@ -637,6 +640,18 @@ const INTERFACE = {
|
||||
case 1: {
|
||||
from_x = to_x;
|
||||
from_y = to_y - (gui_scale / 1.5);
|
||||
|
||||
switch(piece.player) {
|
||||
case 0: ctx.fillStyle = INTERFACE.Color.DawnDark; break;
|
||||
case 1: ctx.fillStyle = INTERFACE.Color.DuskDark; break;
|
||||
}
|
||||
|
||||
ctx.save();
|
||||
ctx.translate(to_x, to_y);
|
||||
ctx.beginPath();
|
||||
draw.hex(MATH.lerp(1.2, 0.94, time));
|
||||
ctx.fill();
|
||||
ctx.restore();
|
||||
} break;
|
||||
}
|
||||
|
||||
@ -644,9 +659,6 @@ const INTERFACE = {
|
||||
let x = MATH.lerp(from_x, to_x, time);
|
||||
let y = MATH.lerp(from_y, to_y, time);
|
||||
|
||||
let piece = INTERFACE_DATA.Animate.piece;
|
||||
let target = INTERFACE_DATA.Animate.target;
|
||||
|
||||
// Draw target piece.
|
||||
if(target !== null) {
|
||||
if(target.player == piece.player) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user