Skip to content

Commit 47c11aa

Browse files
author
Tselote Woldemichael
committed
switch to bumps
1 parent 48e93a8 commit 47c11aa

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

client/src/playback/Actions.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,19 +195,20 @@ export const ACTION_DEFINITIONS: Record<schema.Action, typeof Action<ActionUnion
195195
}
196196
draw(match: Match, ctx: CanvasRenderingContext2D): void {
197197
//target rat moves onto src rat, circle around carried group thing
198-
const src = match.currentRound.bodies.getById(this.robotId)
199-
// const target = match.currentRound.bodies.getById(this.actionData.id()) // rat getting napped
200-
198+
const src = match.currentRound.bodies.getById(this.robotId)
201199
const srcCoords = renderUtils.getRenderCoords(src.pos.x, src.pos.y, match.map.dimension, true)
200+
const t = match.getInterpolationFactor()
201+
const bump = Math.sin(t * Math.PI * 8) * 0.03
202+
const half = 0.5 + bump
203+
202204
ctx.save()
203205
ctx.shadowBlur = 12
204206
ctx.shadowColor = src.team.color
205-
ctx.beginPath()
206207
ctx.strokeStyle = src.team.color
207208
ctx.globalAlpha = 0.7
208209
ctx.lineWidth = 0.04
209-
ctx.arc(srcCoords.x, srcCoords.y, 0.6, 0, 2 * Math.PI)
210-
ctx.stroke()
210+
ctx.strokeRect(srcCoords.x - half, srcCoords.y - half, half * 2, half * 2)
211+
ctx.restore()
211212
ctx.restore()
212213
}
213214
},

0 commit comments

Comments
 (0)