@@ -363,7 +363,7 @@ time and motion inside them.
363363== Encapsulation as a burden ==
364364
365365(((programming style)))(((program size)))(((complexity)))Most of the
366- code in this chapter does not worry about ((encapsulation)) for
366+ code in this chapter does not worry about ((encapsulation)). This has
367367two reasons. First, encapsulation takes extra effort. It makes
368368programs bigger and requires additional concepts and interfaces to be
369369introduced. Since there is only so much code you can throw at a reader
@@ -520,8 +520,8 @@ pixels.
520520DOMDisplay.prototype.drawActors = function() {
521521 var wrap = elt("div");
522522 this.level.actors.forEach(function(actor) {
523- var rect = wrap.appendChild(elt("div", "actor " +
524- actor.type));
523+ var rect = wrap.appendChild(elt("div",
524+ "actor " + actor.type));
525525 rect.style.width = actor.size.x * scale + "px";
526526 rect.style.height = actor.size.y * scale + "px";
527527 rect.style.left = actor.pos.x * scale + "px";
@@ -535,8 +535,8 @@ DOMDisplay.prototype.drawActors = function() {
535535class, we separate the class names by spaces. In the
536536((CSS)) code shown next, the `actor` class gives the actors their
537537absolute position. Their type name is used as an extra class to give
538- them a color. Lava actors don't need the extra class because they use
539- the same class as lava grid squares, which we defined earlier.
538+ them a color. We don't have to define the `lava` class again because we reuse
539+ the class for the lava grid squares which we defined earlier.
540540
541541[source,text/css]
542542----
@@ -587,7 +587,7 @@ element)) with a given class.
587587
588588(((player)))(((box shadow (CSS))))After touching ((lava)), the
589589player's color turns dark red, suggesting scorching. When the last
590- coin has been collected, we use two white box shadows, one to the top
590+ coin has been collected, we use two blurred white box shadows, one to the top
591591left and one to the top right, to create a white halo effect.
592592
593593[[viewport]]
@@ -720,7 +720,7 @@ Solving this for the general case is a big task. You can find
720720libraries, usually called _((physics engine))s_, that simulate
721721interaction between physical objects in two or three ((dimensions)).
722722We'll take a more modest approach in this chapter, handling only
723- collisions between boxes and handling them in a rather simplistic
723+ collisions between rectangular objects and handling them in a rather simplistic
724724way.
725725
726726(((bouncing)))(((collision detection)))(((animation)))Before moving
@@ -1038,11 +1038,11 @@ missing now is the code that _drives_ the animation.
10381038== Tracking keys ==
10391039
10401040(((keyboard)))For a ((game)) like this, we do not want keys to take
1041- effect once per press . Rather, we want their effect (moving the player
1041+ effect once per keypress . Rather, we want their effect (moving the player
10421042figure) to continue happening as long as they are pressed.
10431043
10441044(((preventDefault method)))We need to set up a key handler that stores
1045- the current state of the left, right, and up keys. We will also want
1045+ the current state of the left, right, and up arrow keys. We will also want
10461046to call `preventDefault` for those keys so that they don't end up
10471047((scrolling)) the page.
10481048
@@ -1194,7 +1194,7 @@ called at the right moment.
11941194
11951195(((asynchronous programming)))(((event handling)))This programming
11961196style is usually called _asynchronous_ programming. Event handling is
1197- also an instance of it , and we will see much more of it when working
1197+ also an instance of this style , and we will see much more of it when working
11981198with tasks that can take an arbitrary amount of ((time)), such as
11991199((network)) requests in link:17_http.html#http[Chapter 17] and input
12001200and output in general in link:20_node.html#node[Chapter 20].
0 commit comments