Skip to content

Commit aebe51a

Browse files
committed
Conflicts: book/prototype.markdown
2 parents 1b2030e + 62d4049 commit aebe51a

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

book/prototype.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Watch [the demo](http://www.youtube.com/watch?v=USyoT_Ha_bA) and prepare to be b
1717

1818
Pretend we're making a game in the style of Gauntlet. We've got creatures and fiends swarming around the hero, vying for their share of his flesh. These unsavory dinner companions enter the arena by way of generators, and there is a different generator for each kind of enemy.
1919

20-
For the sake of this example, let's say we have different types for each kind of monster in the game. We'll have actual C++ classes for `Ghost`, `Demon`, `Sorceror`, etc.:
20+
For the sake of this example, let's say we have different types for each kind of monster in the game. We'll have actual C++ classes for `Ghost`, `Demon`, `Sorcerer`, etc., like:
2121

2222
^code monster-classes
2323

book/update-method.markdown

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
## Motivation
99

10-
The player's mighty valkyrie is on a quest to steal glorious jewels from where they rest on the bones of the long-dead sorceror-king. She tentatively approaches the entrance of his magnificent crypt and is attacked by... *nothing*. No cursed statues shooting lightning at her. No undead warriors patrolling the entrance. She just walks right in grabs the loot. <span name="win">Game over.</span> You win.
10+
The player's mighty valkyrie is on a quest to steal glorious jewels from where they rest on the bones of the long-dead sorcerer-king. She tentatively approaches the entrance of his magnificent crypt and is attacked by... *nothing*. No cursed statues shooting lightning at her. No undead warriors patrolling the entrance. She just walks right in grabs the loot. <span name="win">Game over.</span> You win.
1111

1212
Well, that won't do.
1313

@@ -21,7 +21,7 @@ This crypt needs some guards -- some enemies our brave hero can grapple with. Fi
2121

2222
<aside name="brains">
2323

24-
If the sorceror-king wanted more intelligent behavior, he should have re-animated something that still had brain tissue.
24+
If the sorcerer-king wanted more intelligent behavior, he should have re-animated something that still had brain tissue.
2525

2626
</aside>
2727

code/cpp/prototype.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace PrototypePattern
1313

1414
class Ghost : public Monster {};
1515
class Demon : public Monster {};
16-
class Sorceror : public Monster {};
16+
class Sorcerer : public Monster {};
1717
//^monster-classes
1818

1919
//^generator-classes

draft/first draft/update-method.markdown

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
## Motivation
99

10-
The player's mighty warrior is on a quest to steal the glorious jewels from where they rest on the bones of the long-dead sorceror-queen. He walks to the entrance of her magnificent crypt to discover... nothing. No cursed statues shooting lightning at him. No undead warriors guarding the entrance. He can just walk right in that grab the loot. That won't do.
10+
The player's mighty warrior is on a quest to steal the glorious jewels from where they rest on the bones of the long-dead sorcerer-queen. He walks to the entrance of her magnificent crypt to discover... nothing. No cursed statues shooting lightning at him. No undead warriors guarding the entrance. He can just walk right in that grab the loot. That won't do.
1111

12-
This crypt needs some protection: some enemies our brave hero can grapple with. First up, we want a re-animated skeleton guard to patrol back and forth in front of the door. (If the sorceror-queen wanted more intelligent behavior, she should have re-animated something that still had brains.)
12+
This crypt needs some protection: some enemies our brave hero can grapple with. First up, we want a re-animated skeleton guard to patrol back and forth in front of the door. (If the sorcerer-queen wanted more intelligent behavior, she should have re-animated something that still had brains.)
1313

1414
Our actual game deals with user input, rendering, and maintaining a stable framerate. That means all of the game code is nestled within a comfy little <a href="game-loop.html" class="pattern">game loop</a>. If we ignore that for the moment and imagine the simplest possible code to move our skeleton back and forth, we'd have something like:
1515

html/prototype.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ <h2><a href="#the-prototype-design-pattern" name="the-prototype-design-pattern">
7171
</aside>
7272

7373
<p>Pretend we&#x2019;re making a game in the style of Gauntlet. We&#x2019;ve got creatures and fiends swarming around the hero, vying for their share of his flesh. These unsavory dinner companions enter the arena by way of generators, and there is a different generator for each kind of enemy.</p>
74-
<p>For the sake of this example, let&#x2019;s say we have different types for each kind of monster in the game. We&#x2019;ll have actual C++ classes for <code>Ghost</code>, <code>Demon</code>, <code>Sorceror</code>, etc.:</p>
74+
<p>For the sake of this example, let&#x2019;s say we have different types for each kind of monster in the game. We&#x2019;ll have actual C++ classes for <code>Ghost</code>, <code>Demon</code>, <code>Sorcerer</code>, etc., like:</p>
7575
<div class="codehilite"><pre><span class="k">class</span> <span class="nc">Monster</span>
7676
<span class="p">{</span>
7777
<span class="c1">// Stuff...</span>
7878
<span class="p">};</span>
7979

8080
<span class="k">class</span> <span class="nc">Ghost</span> <span class="o">:</span> <span class="k">public</span> <span class="n">Monster</span> <span class="p">{};</span>
8181
<span class="k">class</span> <span class="nc">Demon</span> <span class="o">:</span> <span class="k">public</span> <span class="n">Monster</span> <span class="p">{};</span>
82-
<span class="k">class</span> <span class="nc">Sorceror</span> <span class="o">:</span> <span class="k">public</span> <span class="n">Monster</span> <span class="p">{};</span>
82+
<span class="k">class</span> <span class="nc">Sorcerer</span> <span class="o">:</span> <span class="k">public</span> <span class="n">Monster</span> <span class="p">{};</span>
8383
</pre></div>
8484

8585

html/update-method.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ <h1>Update Method</h1>
6464
<h2><a href="#intent" name="intent">Intent</a></h2>
6565
<p><em>Simulate a collection of independent objects by telling each to process one frame of behavior at a time.</em></p>
6666
<h2><a href="#motivation" name="motivation">Motivation</a></h2>
67-
<p>The player&#x2019;s mighty valkyrie is on a quest to steal glorious jewels from where they rest on the bones of the long-dead sorceror-king. She tentatively approaches the entrance of his magnificent crypt and is attacked by&hellip; <em>nothing</em>. No cursed statues shooting lightning at her. No undead warriors patrolling the entrance. She just walks right in grabs the loot. <span name="win">Game over.</span> You win.</p>
67+
<p>The player&#x2019;s mighty valkyrie is on a quest to steal glorious jewels from where they rest on the bones of the long-dead sorcerer-king. She tentatively approaches the entrance of his magnificent crypt and is attacked by&hellip; <em>nothing</em>. No cursed statues shooting lightning at her. No undead warriors patrolling the entrance. She just walks right in grabs the loot. <span name="win">Game over.</span> You win.</p>
6868
<p>Well, that won&#x2019;t do.</p>
6969
<aside name="win">
7070

@@ -74,7 +74,7 @@ <h2><a href="#motivation" name="motivation">Motivation</a></h2>
7474
<p>This crypt needs some guards&thinsp;&mdash;&thinsp;some enemies our brave hero can grapple with. First up, we want a re-animated <span name="brains">skeleton guard</span> to patrol back and forth in front of the door.</p>
7575
<aside name="brains">
7676

77-
<p>If the sorceror-king wanted more intelligent behavior, he should have re-animated something that still had brain tissue.</p>
77+
<p>If the sorcerer-king wanted more intelligent behavior, he should have re-animated something that still had brain tissue.</p>
7878
</aside>
7979

8080
<p>Ignoring everything you probably already know about game programming, the simplest possible code to make that skeleton lurch back and forth is something like:</p>

0 commit comments

Comments
 (0)