- commit
- 490926fb4b7841f792f68f2d622d2b94e6e9cd7a
- parent
- 0610a984d84d60970d9e6d5a2f9e30aa945419e5
- author
- Dami <dami.etoile@gmail.com>
| M | src/ | 7 | +++++++ |
| M | src/ | 3 | +++ |
@@ -39,6 +39,12 @@ export function projectEntityVisual(entity, {
3939 shakeY = blocked.dir?.[1] * amount || 0;4040 }4141 const squash = reducedMotion || progress >= 1 ? 0 : Math.sin(progress * Math.PI) * (entity.pushed ? 0.05 : 0.10);42+ // Only the board renderer applies this to word tiles. A pushed word skids43+ // toward its destination while the pusher remains level. The angle is44+ // signed by horizontal travel and returns to zero at the settled cell.45+ const skid = !reducedMotion && entity.pushed && entity.dx && progress < 146+ ? entity.dx * 0.09 * Math.sin(progress * Math.PI)47+ : 0;4248 const popProgress = entity.popDuration ? clamp((at - entity.popStart) / entity.popDuration) : 1;4349 const bounceProgress = entity.bounceDuration ? clamp((at - entity.bounceStart) / entity.bounceDuration) : 1;4450 const popScale = entity.popDuration ? 0.55 + 0.45 * easeBack(popProgress) : 1;@@ -55,6 +61,7 @@ export function projectEntityVisual(entity, {
5561 scaleY: (entity.dy ? 1 + squash : 1 - squash * 0.6) * popScale * bounceScale,5662 moving: progress < 1,5763 pushed: entity.pushed,64+ skid,5865 facing: entity.facing,5966 glyphScaleX,6067 };@@ -34,6 +34,9 @@ export function drawEntities(ctx, state, model, options, draw) {
3434 if (object.kind === 'word') {3535 ctx.save();3636 if (count > 1) ctx.rotate((index % 2 ? 1 : -1) * 0.07);37+ if (visual.moving && visual.pushed && Number.isFinite(visual.skid)) {38+ ctx.rotate(visual.skid);39+ }3740 draw.tile(3841 ctx,3942 object.text,