diff options
Diffstat (limited to 'test-client/visual.ts')
-rw-r--r-- | test-client/visual.ts | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/test-client/visual.ts b/test-client/visual.ts index 784a36a3..c5f34c1c 100644 --- a/test-client/visual.ts +++ b/test-client/visual.ts @@ -20,7 +20,7 @@ import { ItemData, MessageData, MessageStyle, PlayerData, TileData, camera, came import { PLAYER_SIZE } from "./movement.ts"; import { draw_item_sprite, draw_tile_sprite, ItemName, TileName } from "./tiles.ts"; import { V2, ceil_v2, floor_v2 } from "./util.ts"; -import { Message } from "./protocol.ts"; +import { Message, PlayerClass } from "./protocol.ts"; import { draw_particles, particle_count } from "./particles.ts"; export function draw_wait(text: string) { @@ -145,7 +145,7 @@ function draw_player(player: PlayerData) { ctx.translate(player.anim_position.x, player.anim_position.y) ctx.rotate(-player.rot) if (player.boosting) ctx.scale(1.3, 1.3) - draw_character(player.character) + draw_character(player.class, player.character) ctx.restore() if (player.item) draw_item(player.item) } @@ -200,24 +200,25 @@ function draw_grid() { ctx.stroke() } -function draw_character(character: number) { +function draw_character(pclass: PlayerClass, character: number) { ctx.fillStyle = `hsl(${character}rad, 50%, 50%)` ctx.beginPath() ctx.arc(0, 0, PLAYER_SIZE, 0, Math.PI * 2) ctx.fill() - if (character >= 0) { + if (pclass != "customer") { ctx.fillStyle = `hsl(${character}rad, 80%, 10%)` ctx.beginPath() ctx.arc(0, -0.2, PLAYER_SIZE, 0, Math.PI * 2) ctx.fill() } - - ctx.fillStyle = `hsl(${character}rad, 80%, 70%)` - ctx.beginPath() - ctx.moveTo(-0.04, 0.25) - ctx.lineTo(0.04, 0.25) - ctx.lineTo(0, 0.4) + if (pclass != "bot") { + ctx.fillStyle = `hsl(${character}rad, 80%, 70%)` + ctx.beginPath() + ctx.moveTo(-0.04, 0.25) + ctx.lineTo(0.04, 0.25) + ctx.lineTo(0, 0.4) + } ctx.fill() } |