Skip to content

Commit 85a3feb

Browse files
committed
updated cat sprites for actions
1 parent 367cc23 commit 85a3feb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

client/src/playback/Actions.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export const ACTION_DEFINITIONS: Record<schema.Action, typeof Action<ActionUnion
118118
const fontY =
119119
coords.y - (2 + 4 * random2) * interpolationFactor + 8 * interpolationFactor * interpolationFactor - 0.5
120120
ctx.fillText('nom', fontX, fontY)
121-
src.imgPath = 'robots/cat/cat_feed.png' // is reset in `finish`.
121+
src.imgPath = `robots/cat/cat_feed_${src.direction}.png`// is reset in `finish`.
122122
ctx.restore()
123123
}
124124

@@ -344,6 +344,12 @@ export const ACTION_DEFINITIONS: Record<schema.Action, typeof Action<ActionUnion
344344
}
345345
ctx.stroke()
346346
ctx.globalAlpha = 1
347+
body.imgPath = `robots/cat/cat_scratch_${body.direction}.png`
348+
}
349+
350+
finish(round: Round): void {
351+
const body = round.bodies.getById(this.robotId)
352+
body.imgPath = 'robots/cat/cat.png'
347353
}
348354
},
349355
[schema.Action.CatPounce]: class CatPounceAction extends Action<schema.CatPounce> {

0 commit comments

Comments
 (0)