Workshop › Tower Defense › Step 8 of 42
Enemies are kept in a list; each one is an object with its distance d. To draw one, pointAt gives its point in
tiles, and the middle of that tile in pixels gets a red circle.
```js
let enemies
enemies = []
for (const e of enemies) {
const p = pointAt(e.d)
const x = (p.x + 0.5) * TILE
const y = TOP + (p.y + 0.5) * TILE
ctx.fillStyle = '#dc2626'
ctx.beginPath()
ctx.arc(x, y, 11, 0, Math.PI * 2)
ctx.fill()
}
```p is the enemy's point in tiles; (p.x + 0.5) * TILE is the middle of that tile in pixels.beginPath, arc(x, y, radius, 0, Math.PI * 2) (a full turn), then fill.let road write let enemies; in reset, under findRoad(), write enemies = [].draw, after the tile loops and an empty line, write the enemies loop.Skills: Drawing on a canvas