Game Development Reference
In-Depth Information
What just happened?
Terrain
is a container of
Blocks
, and we just added the logic that will add a new
block
object to this container. Inside
addBlocks
, we call an
initBlock
method,
which will use the information from our
patterns
arrays to initialize each block used in
the terrain. It is this method we'll implement next.