skellt

skellt

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.

Marked As Solved

Paradox927

Paradox927

Author and Editor at PragProg

Hi, David.

Thank you for pointing this out. I’ve updated the explanation, which will be made available in the next release.

However, for those reading now, the updated explanation reads as follows:

Here, you’re setting the end position of the drop; in other words, where you want the drop to land.

I also expanded the step-by-step that goes along with it—the updates noted in bold text:

  • First, you set the y-position using the input value stored in floorLevel.
  • Then, you add two scale actions to make the drop stretch a little; this gives it a drip-like > appearance.
  • Next, you create actions to fade-in and move the drop down the scene.
  • Finally, for some more visual appeal, you tweak the scale of the drop, and then run this sequence of actions. You give it a named key so that you can access this action later using its name.

Again, thanks for the feedback.

Popular Prag Prog topics Top

jon
Some minor things in the paper edition that says “3 2020” on the title page verso, not mentioned in the book’s errata online: p. 186 But...
New
brianokken
Many tasks_proj/tests directories exist in chapters 2, 3, 5 that have tests that use the custom markers smoke and get, which are not decl...
New
raul
Page 28: It implements io.ReaderAt on the store type. Sorry if it’s a dumb question but was the io.ReaderAt supposed to be io.ReadAt? ...
New
AleksandrKudashkin
On the page xv there is an instruction to run bin/setup from the main folder. I downloaded the source code today (12/03/21) and can’t see...
New
AndyDavis3416
@noelrappin Running the webpack dev server, I receive the following warning: ERROR in tsconfig.json TS18003: No inputs were found in c...
New
brunogirin
When trying to run tox in parallel as explained on page 151, I got the following error: tox: error: argument -p/–parallel: expected one...
New
taguniversalmachine
Hi, I am getting an error I cannot figure out on my test. I have what I think is the exact code from the book, other than I changed “us...
New
Henrai
Hi, I’m working on the Chapter 8 of the book. After I add add the point_offset, I’m still able to see acne: In the image above, I re...
New
ggerico
I got this error when executing the plot files on macOS Ventura 13.0.1 with Python 3.10.8 and matplotlib 3.6.1: programming_ML/code/03_...
New
bjnord
Hello @herbert ! Trying to get the very first “Hello, Bracket Terminal!" example to run (p. 53). I develop on an Amazon EC2 instance runn...
New

Other popular topics Top

Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1016 16836 371
New
AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
New
PragmaticBookshelf
A PragProg Hero’s Journey with Brian P. Hogan @bphogan Have you ever worried that your only legacy will be in the form of legacy...
New
PragmaticBookshelf
“A Mystical Experience” Hero’s Journey with Paolo Perrotta @nusco Ever wonder how authoring books compares to writing articles?...
New
AstonJ
Seems like a lot of people caught it - just wondered whether any of you did? As far as I know I didn’t, but it wouldn’t surprise me if I...
New
mafinar
Crystal recently reached version 1. I had been following it for awhile but never got to really learn it. Most languages I picked up out o...
New
rustkas
Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
New
First poster: joeb
The File System Access API with Origin Private File System. WebKit supports new API that makes it possible for web apps to create, open,...
New
First poster: bot
Large Language Models like ChatGPT say The Darnedest Things. The Errors They MakeWhy We Need to Document Them, and What We Have Decided ...
New
CommunityNews
A Brief Review of the Minisforum V3 AMD Tablet. Update: I have created an awesome-minisforum-v3 GitHub repository to list information fo...
New

Latest in PragProg

View all threads ❯