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

kuroneko
Whilst the author has been careful to provide exact results for the tests elsewhere in the book (such as surds with the transformation te...
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
jeffmcompsci
Title: Design and Build Great Web APIs - typo “https://company-atk.herokuapp.com/2258ie4t68jv” (page 19, third bullet in URL list) Typo:...
New
Mmm
Hi, build fails on: bracket-lib = “~0.8.1” when running on Mac Mini M1 Rust version 1.5.0: Compiling winit v0.22.2 error[E0308]: mi...
New
HarryDeveloper
Hi @venkats, It has been mentioned in the description of ‘Supervisory Job’ title that 2 things as mentioned below result in the same eff...
New
patoncrispy
I’m new to Rust and am using this book to learn more as well as to feed my interest in game dev. I’ve just finished the flappy dragon exa...
New
Charles
In general, the book isn’t yet updated for Phoenix version 1.6. On page 18 of the book, the authors indicate that an auto generated of ro...
New
brunogirin
When running tox for the first time, I got the following error: ERROR: InterpreterNotFound: python3.10 I realised that I was running ...
New
mcpierce
@mfazio23 I’ve applied the changes from Chapter 5 of the book and everything builds correctly and runs. But, when I try to start a game,...
New
dachristenson
I’ve got to the end of Ch. 11, and the app runs, with all tabs displaying what they should – at first. After switching around between St...
New

Other popular topics Top

AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
ohm
Which, if any, games do you play? On what platform? I just bought (and completed) Minecraft Dungeons for my Nintendo Switch. Other than ...
New
dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
AstonJ
Curious to know which languages and frameworks you’re all thinking about learning next :upside_down_face: Perhaps if there’s enough peop...
New
Rainer
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
AstonJ
Inspired by this post from @Carter, which languages, frameworks or other tech or tools do you think is killing it right now? :upside_down...
New
AstonJ
I ended up cancelling my Moonlander order as I think it’s just going to be a bit too bulky for me. I think the Planck and the Preonic (o...
New
Margaret
Hello content creators! Happy new year. What tech topics do you think will be the focus of 2021? My vote for one topic is ethics in tech...
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
AstonJ
If you get Can't find emacs in your PATH when trying to install Doom Emacs on your Mac you… just… need to install Emacs first! :lol: bre...
New

Latest in PragProg

View all threads ❯