Apress / Devel-2D-Games-Unity

Source Code for 'Developing 2D Games with Unity: Independent Game Programming with C#' by Jared Halpern
https://www.apress.com/us/book/9781484237717
Other
219 stars 53 forks source link

Chapter 8 - Multiple formatting issues & other corrections (Pages 282, 306, 318, 319, 324, 328, 346, #41

Open scouttyg opened 4 years ago

scouttyg commented 4 years ago

1. Page 282 (minor, formatting)

The variable moveCoroutine is where we'll save a reference [...]

I believe we want the code formatting for moveCoroutine, e.g.:

The variable moveCoroutine is where we'll save a reference [...]

2. Page 306 (minor, formatting)

if (collision is BoxCollider2D)
    {
    ....

The first left bracket is formatted indented, when it should be inline with the if statement.

3. Page 318 (bug?)

Initially, at the stage where we write the while loop:

while (percentageComplete < 1.0f)
{ 
    percentComplete += Time.deltaTime / duration;

    transform.position = Vector3.Lerp(startPosition, destination, percentComplete);
    ...
}

I kept running into an error where transform could not be used in the context provided. At the end of chapter everything seemed to work correctly, but at this stage of the app it wouldn't for some reason.

4. Page 319 (minor, formatting)

Take a look at this line again: percentComplete += Time.deltaTime / duration;

It looks like the whole line got turned into code, rather than just the latter half of the sentence:

Take a look at this line again: percentComplete += Time.deltaTime / duration;

5. Page 324 (multiple)

5.1 - Weapon Velocity set to 2 in the figure, but mentioned as 0.5

In Figure 8-15., and at the end of Page 323, we're told to set Weapon Velocity to 2. But in the very first sentence of page 324 it says:

We've chosen to use 0.5 for the Weapon Velocity because it feels like a natural amount of time [...]

I think this instead should be 2, not 0.5.

5.1 Multiple references to leaving lines alone

Under the section Arcing, it mentions and has the following lines twice:

// Leave this existing line alone.
percentComplete += Time.deltaTime / duration;

And then later on page 325:

        // Leave these existing lines alone.
percentComplete += Time.deltaTime / duration;
yield return null

6. Page 328 (mistake / correction)

Under the section Clean Up the Animator, it makes multiple references to "Idle State", including in Figure 8-18.. But the "Idle State" I believe is actually called "player-idle" -- we have never renamed it, as we can see from the previous Figure 8-17.

7. Page 346 (missing step)

Under number 14., it mentions two differences between the transitions:

  • When you create the isFiring condition, set it to: false.
  • Check the Exit Time property and set the value for Exit Time to: 1

The correct property to check would actually be Has Exit Time, so I think it would be better as three steps:

  • Has Exit Time should be set to: checked
  • Exit Time should be set to: 1
  • isFiring should be set to: false.
scouttyg commented 4 years ago

Also, there's not a great place to put this, but in Chapter 8 I don't believe we ever set the Damage Inflicted value within the Unity editor in the book -- I got all the way to the end, and noticed my Ammo script wasn't doing any damage. It was a quick fix, but just something to mention.

scouttyg commented 4 years ago

cc @JaredHalpern -- just want to help out, I think there's a good amount of corrections now in the issues section that could help make the book better! :)

JaredHalpern commented 4 years ago

Hey Scott - I just saw this notification when you @'d me. Thanks so much! I'll go through this and take a look.