Apple Game Frameworks and Technologies: Misleading explanation of gloop end pos (p 62)

On page 62, right after the code snippet for func drop(dropSpeed: TimeInterval, floorLevel: CGFloat), is this line:

Here, you’re setting the initial position of the drop.

As the first explanatory line of text following the method it appears to be referring to the first line of code in the method: let pos = CGPoint(x: position.x, y: floorLevel). But this line is not setting the initial position of the drop. It is setting the end position of the drop to which it will animate. The drop starts up at the top of the screen and animates down to floorLevel.

The initial position of the drop is set elsewhere in spawnGloop(), which then calls drop.

2 Likes