Skip to content

Commit f3410ce

Browse files
committed
Replace shoddy inkscape pictures with programatically generated ones
1 parent 3569e11 commit f3410ce

10 files changed

Lines changed: 116 additions & 2321 deletions

File tree

04_data.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,10 @@ var list = {
12511251
};
12521252
----
12531253

1254+
The resulting object form a chain, like this:
1255+
1256+
image::img/linked-list.svg[alt="A linked list"]
1257+
12541258
A nice thing about lists is that they can share parts of their
12551259
structure. For example, if I create two new values `{value: 0, rest:
12561260
list}` and `{value: -1, rest: list}` (with `list` referring to the

15_game.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -719,11 +719,16 @@ Level.prototype.obstacleAt = function(pos, size) {
719719

720720
It computes the set of grid squares that the body overlaps with by
721721
using `Math.floor` and `Math.ceil` on its coordinates. Remember that
722-
grid squares are one by one unit in size. If the body sticks out of
723-
the level, we return a predetermined obstacle type—`"wall"` for the
724-
sides and top, `"lava"` for the bottom. Otherwise, we loop over the
725-
block of grid squares, and return the first non-empty content type we
726-
find.
722+
grid squares are one by one unit in size. By rounding the sides of a
723+
box up and down, we get the range of background squares that the box
724+
touches.
725+
726+
image::img/game-grid.svg[alt="Finding collisions on a grid"]
727+
728+
If the body sticks out of the level, we return a predetermined
729+
obstacle type—`"wall"` for the sides and top, `"lava"` for the bottom.
730+
Otherwise, we loop over the block of grid squares, and return the
731+
first non-empty content type we find.
727732

728733
Collisions between the player and other dynamic actors (coins, moving
729734
lava) are handled _after_ the player moved. When the motion would take

html/ejs.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ blockquote footer:before {
317317

318318
div.image img {
319319
max-width: 28em;
320-
min-width: 20em;
321320
margin-left: 1em;
322321
}
323322

img/game-grid.svg

Lines changed: 2 additions & 0 deletions
Loading

img/html-boxes.svg

Lines changed: 15 additions & 323 deletions
Loading

0 commit comments

Comments
 (0)