Workshop › Sokoban › Step 9 of 29
Goals never move either, so they also go in a Set. Three characters mean a goal: ., and * and + (a box or the
player standing on one). They are drawn as small orange dots.
```js
let goals
goals = new Set()
if (ch === '.' || ch === '*' || ch === '+') goals.add(key(x, y))
for (const k of goals) {
const [x, y] = k.split(',').map(Number)
tile(x, y, '#f59e0b', 18)
}
```goals is a new Set, emptied in loadLevel like walls.|| means "or": the character is a goal if it is ., * or +.let walls write let goals.loadLevel, under walls = new Set() write goals = new Set(); under the wall if, write the goal if.draw, under the walls loop, write the goals loop. Press Run.Skills: Game states, Drawing on a canvas
← Center the level The boxes →