The Goal
The tile ID of the goal tile is stored in the playField
array along with the road and wall
tiles. It is not considered a separate item because, unlike the player
and enemy
objects, it does not need to move. As we
have described previously, because the enemy and player tiles move on
top of the playfield, they are considered moving items and not part of
the playfield.
Get HTML5 Canvas, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.