Workshop › Tower Defense › Step 21 of 42
When a bullet reaches its target, hit takes the tower kind's damage off the target's health.
```js
function hit(bullet) {
const kind = TOWERS[bullet.kind]
bullet.target.hp -= kind.damage
}
```TOWERS[bullet.kind] gives the damage.bullet.target is the enemy object itself: changing its hp changes the enemy in the list.Under targetFor, after an empty line, write hit.
Skills: Game states