0% found this document useful (0 votes)
13 views41 pages

Game Programming in C Start To Finish 1st Edition Erik Yuzwa

The document provides information about various ebooks available for download on ebookname.com, including titles such as 'Game Programming in C Start to Finish' by Erik Yuzwa and 'Successful Capital Campaigns from Start to Finish' by Scott C. Stevenson. It highlights the instant availability of digital formats like PDF, ePub, and MOBI. Additionally, it contains details about the contents of the book 'Game Programming in C++: Start to Finish' by Erik Yuzwa, including chapters on game design, graphics programming, and networking.

Uploaded by

ruppelntinda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views41 pages

Game Programming in C Start To Finish 1st Edition Erik Yuzwa

The document provides information about various ebooks available for download on ebookname.com, including titles such as 'Game Programming in C Start to Finish' by Erik Yuzwa and 'Successful Capital Campaigns from Start to Finish' by Scott C. Stevenson. It highlights the instant availability of digital formats like PDF, ePub, and MOBI. Additionally, it contains details about the contents of the book 'Game Programming in C++: Start to Finish' by Erik Yuzwa, including chapters on game design, graphics programming, and networking.

Uploaded by

ruppelntinda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

Endless Ebook, One Click Away – Start Downloading at ebookname.

com

Game Programming in C Start to Finish 1st Edition


Erik Yuzwa

https://ebookname.com/product/game-programming-in-c-start-
to-finish-1st-edition-erik-yuzwa/

OR CLICK HERE

DOWLOAD EBOOK

Browse and Get More Ebook Downloads Instantly at https://ebookname.com


Click here to visit ebookname.com and download ebook now
Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Successful Capital Campaigns from Start to Finish Third


Edition Scott C. Stevenson

https://ebookname.com/product/successful-capital-campaigns-from-
start-to-finish-third-edition-scott-c-stevenson/

Wedding Videography Start to Finish 1st Edition Joanna


Silber

https://ebookname.com/product/wedding-videography-start-to-
finish-1st-edition-joanna-silber/

Windows Forms Programming with C 1st Edition Erik Brown

https://ebookname.com/product/windows-forms-programming-
with-c-1st-edition-erik-brown/

Infertility Around the Globe Professor Marcia Inhorn

https://ebookname.com/product/infertility-around-the-globe-
professor-marcia-inhorn/
Tax Planning and Compliance for Tax Exempt
Organizations Rules Checklists Procedures Wiley
Nonprofit Law Finance and Management Series 4th Edition
Jody Blazek
https://ebookname.com/product/tax-planning-and-compliance-for-
tax-exempt-organizations-rules-checklists-procedures-wiley-
nonprofit-law-finance-and-management-series-4th-edition-jody-
blazek/

The Maudsley Handbook of Practical Psychiatry 6th


Edition Gareth Owen

https://ebookname.com/product/the-maudsley-handbook-of-practical-
psychiatry-6th-edition-gareth-owen/

The Fiction of Relationship Arnold Weinstein

https://ebookname.com/product/the-fiction-of-relationship-arnold-
weinstein/

Scripps Whittier Diabetes Institute Guide to Patient


Management and Prevention 1st Edition Athena Philis-
Tsimikas

https://ebookname.com/product/scripps-whittier-diabetes-
institute-guide-to-patient-management-and-prevention-1st-edition-
athena-philis-tsimikas/

Artificial psychology the quest for what it means to be


human 1st Edition Jay Friedenberg

https://ebookname.com/product/artificial-psychology-the-quest-
for-what-it-means-to-be-human-1st-edition-jay-friedenberg/
Advances in Accounting Volume 20 20th Annv Edition
Philip M J Reckers

https://ebookname.com/product/advances-in-accounting-
volume-20-20th-annv-edition-philip-m-j-reckers/
GAME PROGRAMMING
IN C++:
START TO FINISH

Erik YuzwA

CHARLES RIVER MEDIA


Boston, Massachusetts
Copyright 2006 Career & Professional Group, a division of Thomson
Learning Inc.
Published by Charles River Media, an imprint of Thomson
Learning Inc.
All rights reserved.

No part of this publication may be reproduced in


any way, stored in retrieval system of any type, or
transmitted by any means or media, electronic or mechanical,
including, but not limited to, photocopy,
recording, or scanning, without prior permission in writing from the publisher.
Cover Design: Tyler Creative
CHARLES RIVER MEDIA
25 Thomson Place
Boston, Massachusetts 02210
617-757-7900
617-757-7969 (FAX)
[email protected]
www.charlesriver.com

This book is
printed on acid-free paper.
Erik Yuzwa. Game Programming in C++:
ISBN: 1-58450-432-3
Start to Finish
All brand names and product names mentioned
in
this book are trademarks
respective companies. Any omission or misuse (of any kind) of service marks or service marks of their
or trademarks should not
be regarded as intent
toinfringe on the property of others. The publisher recognizes and
marks used by companies, manufacturers, and developers as means respects all
a to
distinguish their products.
Library of Congress Cataloging-in-Publication Data

Yuzwa, Erik.
Game programming in C++ start to finish / Erik Yuzwa.
p. cm.
Includes index.
ISBN 1-58450-432-3 (pbk. with cd : alk. paper)
1. Computer games—Programming. 2. C++ (Computer program language) I.
Title.
QA76.76.C672Y98 2005
005.13’3—dc22
2005032754
Printed in the United States of America
06765432
CHARLES RIVER MEDIA titles
are available for site license or bulk purchase by institutions, user
groups, corporations, etc. For additional information, please contact the Special Sales
Department
at 800-347-7707.
Requests for replacement of a
defective CD-ROM must be accompanied by the
mailing address, telephone number, date of purchase and purchase price. Please
original disc, your
state the nature of
the problem, and send the information to CHARLES RIVER MEDIA, 25
Thomson Place, Boston,
Massachusetts 02210. CRM’s sole obligation to the purchaser
materials or faulty workmanship, but not on the operation
is
to replace the disc, based on defective
or functionality of the product.
Contents

XixX
Acknowledgments
Preface

1 Game Technologies -

Common License Agreements Wo

Some Helpful Technologies


Concurrent Versioning System (CVS)
NN

©
Using CVS
Creating the SuperAsteroidArena Project
OO

14
Introduction to Doxygen
16
Introduction to InnoSetup
23
The Standard Template Library
23
std::string
24
std::vector
25
std::map
27
Chapter Exercises
27
Summary

29
2 Design Fundamentals
29
What Is a Game Design?
30
Classic Waterfall Software Design
31
Iterative Software Design
32
Principles of Agile Design
:
33
When to Use Agile
33
Introduction to the Unified Modeling Language
Basic Class Notation 34
vi Contents

Visibility Notation 35
Comment/Note Notation 35
Modeling Class Relationships 36
Generalization Relationship 37
Software Reusability
38
Code Reuse
38
Design Reuse 38
Anatomy of a Game 44
Initialization Phase
44
Process Phase 45
Destruction Phase 46
The SuperAsteroidArena Design Document
46
Drafting a Project Overview 46
What Type or Genre of Game Is It? 47
Who Is Your Audience?
48
Why Make the Game? 49
What Do You Want To See? 49
What Does It Offer? 49
Draft an Initial List of Timeboxes
50
Who Is Involved? 51
Budget Concerns 51
Demo versus Registered Features
52
Chapter Exercises 53
Summary 53

Introduction to SDL and Windows


55
Introduction to the Simple DirectMedia Layer 55
Why Use SDL Instead of DirectX? 56
SDL “Hello World”
56
Creating the EngineCore 60
Initializing SDL 61
The SDL/Windows Event Queue
62
Contents

Cleaning Up SDL
Big Endian versus Little Endian
Adding the FileLogger
Using Windows Initialization
Files

The Component Object Model


The 1unknown Object
Introduction to Dynamically Linked Libraries
Chapter Exercises
Summary

77
4 Introduction to the Peon Engine
77
Basic Engine Structure
79
Introduction to Peon
80
Introduction to Some Peon Components
82
Building Upon the Foundation
82
Managing State Information
83
Working on the First Timebox
85
Creating the New Instances of IApplicationState
86
Timebox Evaluation
86
Chapter Exercises
87
Summary

89
5 Graphics Programming Mathematics
89
The Cartesian Coordinate System
90
Fixed Function Geometry Pipeline
92
Introduction to Vectors
93
Common Vector Operations
95
Introduction to Matrices
95
The OpenGL Matrix Stacks
96
Identity Matrix
97
Matrix Addition and Subtraction
Contents

Matrix Multiplication 98
Coordinate Transformations 99
Scaling Transform 99
Translation Transform 99
Rotation Transform 100
Matrix Concatenation 102
Basic Camera/View Orientation 103
Projection Transformations 104
Create a Basic Camera 105
Gimbal Lock 106
:

Quaternions 107
Basic Quaternion Algorithm 108
Chapter Exercises 109
Summary 109

6 Creating an OpenGL Renderer 111


How Does OpenGL Operate? 112
OpenGL and Installable Client Drivers (ICDs) 112
Understanding the OpenGL Architecture 113
Defining the SceneRenderer 114
Loading the OpenGL Device Using SDL 116
Working with OpenGL Surfaces 118
Cathode Ray Tube Monitors and Phosphors 119
Clearing the Device 120
Flipping the Device 121
Unloading the Device 121
The OpenGL State Machine 122
Saving and Restoring State Information 122
Rendering Primitives 123
Rendering Vertices with the SceneRenderer 125
Contents ix

Texture Mapping 129


129
Creating an OpenGL Texture
133
Using the Texture Map
133
Using the SceneTexture
135
Rendering Text
135
OpenGL Display Lists
136
Storing the Font Characters
The SceneFont in Action 138
139
Printing Text
139
Cleaning Up
140
Rendering a Simple Cube
142
Moving the Cube
142
Rendering the Cube
143
Working with Fog
144
BasicFog Demo
Chapter Exercises
144
145
Summary

7 More OpenGL Techniques 147


147
Lighting and Materials
149
Defining Surface Normals
Adding Light Support to the SceneRende rer 150
152
Implementing Light Support in SceneRenderer
154
Sample Demonstration
154
Alpha-Blending and Transparencies
155
Sample Demonstration
Vertex Arrays 156

The OpenGL Extension Mechanism 158


160
Multitexturing
Contents

Working with the Texture Units 161


Chapter Exercises 162
Summary 163

8 Scene Geometry Management


165
The Depth Buffer
166
View Frustum Culling
166
Basic Scene Hierarchy Management
170
Sorting Rendering States 172
Animation Rendering 172
Introduction to the Peon Scene Graph 173
Scene Graph States
175
Scene Graph Passes
175
Scene Graph Traversal
176
Binary Space Partitioning Trees 176
Octree Data Structure
176
Building Your Octree 177
The Occluder Query
177
Occlusion Query Algorithm
179
Cleanup 180
Chapter Exercises 180
Summary 181

9 Graphics Timebox 183


Timebox Requirements
183
The LogoState
184
The MainMenustate
184
Loading Common Data 185
Rendering the Starfield 186
Contents

187
Rendering Text to the Player
187
Creating the Graphical User Interface
188
The ActiveState
188
Timebox Evaluation
189
Chapter Exercises
189
Summary

191
10 Working with Input Devices
191
Introduction to Input Using SDL
192
Using the Keyboard
193
Using the Mouse
195
Using the Joystick
195
Joystick Enumeration
196
Opening a Joystick
196
Processing Joystick Events
198
Cleaning up the Joystick
198
Adding Input Support to Peon
200
Chapter Exercises
200
Summary

201
Working With Sound
201
Sound Mechanics
202
Digitized Sound
202
Sound Layers
203
Introduction to SDL_Mixer
203
Working with Audio Music Data
206
Cleaning Up
206
Working with Audio Sound Effects Data
207
Sound Effect Playback
208
Cleaning Up
xii Contents

Introduction to OpenAL 208


Intializing the OpenAL Device Context 209
Loading Sound Effects 209
Working with the Source Object 210
Positioning the Listener Object 212
Playing the Sound 213
Stopping the Sound 213
Shutting Down the OpenAL Context 213
Playing Ogg-Vorbis Data with OpenAL 214
Playing the Ogg Buffer 216
Chapter Exercises 216
Summary 217

12 Input and Sound Timebox 219


Timebox Requirements 219
Required Input Events 220
Rotating the Player’s Ship 221
Activating the Player’s Engines 222
Using the AudioEngine 223
Loading Sounds 224
Playing Sounds 225
Unloading Sounds 225
Timebox Evaluation 226
Chapter Exercises 226
Summary 226

13 Collision Detection and Physics Techniques 227


Prioritize Speed 227
Axis-Aligned Bounding Box Detection 228
Bounding Sphere Collision Detection 230
Contents xiii

Plane Collisions
232
Collision of Plane versus AABB
232
Ray Collisions
233
Collision of Plane versus Ray
234
Implementing Physics
235
Using the neSimulator
237
Working with Geometry
238
Running the Simulation with Tokamak
238
Rendering the Geometry
239
Cleaning Up
240
Chapter Exercises
240
Summary

Introduction to Networking 241


241
Networking Basics
242
Peer-to-Peer
243
Client-Server
244
TCP versus UDP
245
DirectPlay and Winsock
246
SDL_Net
247
Starting a Basic Server
250
Starting a Basic Client
253
Sending and Receiving Data
Non-Blocking Sockets 254
254
Using SDLNet_CheckSockets
259
TCP/IP versus UDP (Part II)
Network Address Translation 260
261
Client-Server Prediction/Authentication
:
261
Dead-Reckoning
261
Chapter Exercises
262
Summary
xiv Contents

15 Networking Timebox 263


Introduction to ReplicaNet 263
Network Topology Design 264
;

Networking Timebox 264


Making Additions to Peon 265
Creating the NetStream Object 265
Working with Message Types 266
Updating Players 266
Session Hosting/Joining 267
Players Tend to Move Around 268
Players Want to Fire 268
Timebox Evaluation 268
Chapter Exercises 269
Summary 269

16 Introduction to Models 271


Model Generation 271
Updating the MeshFactory in Peon 272
Creating a 3DS Importer 273
Loading the 3DS Model Data :

276
Rendering the Model 277
Cleaning Up 279
Model Animation
279
The MD3 File Format
280
The AnimatedMeshFactory
284
Introduction to Collada 284
Chapter Exercises 285
Summary 285

17 Animation and Special Effects


287
Billboarding 287
Understanding the View Matrix (Recap) 288
Contents XV

288
Extracting the Vectors
291
Skyboxes (Environment Mapping)
294
Object Picking/Selection
298
Particle Systems
300
Updating the Emitter
301
Rendering the Emitter
302
Particle System II: Point Sprites
305
Billboard Animation
306
Loading New Frames
307
Updating Frames
308
Creating a Shockwave
309
Initializing the Shockwave
310
Updating the Shockwave
311
Rendering the Shockwave
312
Taking a Screen Shot
314
Chapter Exercises
315
Summary

18 Introduction to the OpenGL Shading Language (GLSL) 317


318
Some History of Shading Languages
319
Cg
319
The OpenGL Shading Language (GLSL)
320
The Vertex Processor
321
The Fragment Processor
321
GLSL Data Types
322
Shader Inputs and Outputs
322
Built-In Types
323
OpenGL Shading Language Syntax
325
Checking for Shader Support
327
Loading the Shader Source
328
Creating a Shader Program
329
The Shader InfoLog
Xvi Contents

Uniform and Attribute Variables 330


Rendering with Shaders 330
Shader Object Cleanup 331
Shader Validation Using GLSLvalidate 331
Chapter Exercises 332
Summary 333

19 Introduction to Scripting 535


Introduction to Scripting 335
Introduction to Lua 336
Using the Interpreter 338
A Simple Script
339
A Simple Script File
340
Introducing Luac 341
Lua Stack 341
Calling a Lua Function 342
Using Lua
to Position Objects 343
.
Updating the Object Position 344
Chapter Exercises 345
Summary 345

20 Polish Timebox 347


Timebox Goals 347
Adding Scripting Support 348
Adding Shader Support 349
Timebox Evaluation 350
Chapter Exercises 350
Summary 350

21 Finishing Tips and Tricks 351


Simple Suggestions 351
Game Play Testing 353
Contents

Installation Scripts 354


354
Using InnoSetup
356
Beta Testing or Quality Assurance Testing
357
User Instruction Manual
358
User Manual Checklist
359
Game Asset Compression/Encryption
359
Registration/Patch/Updating Mechanism
360
Final Things to Remember
361
Chapter Exercises
361
Summary

Setting Up the SDL and the Compiler 363


Appendix A
363
Installing SDL
363
Microsoft Visual Studio 6.0
364
Microsoft Visual Studio .NET 2003
364
Microsoft Visual Studio .NET 2005 (Beta 2)

Debugging Tools 365


Appendix B
365
OutputDebugString
366
Assert
366
gDEBugger
367
GLSL Validation Tool

ASCII Table 369


Appendix C

Windows Vista and OpenGL 371


Appendix D

About the CD-ROM 375


Appendix E
374
Required Software
374
System Requirements
374
Installation
374
Author Support
Other documents randomly have
different content
would shoot, and ask Baldy to stuff as
full as life to grace the top of Miss
Letty’s desk.
But it often happens, when one goes
a-hunting, that the birds, beasts, and
fishes have engagements elsewhere.
A hawk soared over toward the river,
and crows were quarrelling up in their
roost in the cedars, but the only birds
that came near were a downy
woodpecker, a nuthatch, and a
chickadee, and Anne’s brother would
not think of even aiming at these.
Tommy walked on in silence, a state
to which he was quite a stranger, until
he began to feel that not to speak
even to a dog gave one a queer, chilly
feeling; then he noticed that he had
wandered out of the beaten path, and
he stopped to look about, and
whistled for Waddles. He was not afraid, for he was quite
accustomed to taking care of himself, but he was disappointed about
the rabbit, and angry with Waddles because he had gone off without
finding a trail. Then he spied a quantity of hickory nuts lying on the
rocks where a squirrel had evidently collected them, and he began
to crack them with a stone, and pick out the meats very deliberately,
which showed that Tommy was tired.
Presently he heard a sound close behind that reminded him of the
noise the mother screech-owl had made when she snapped her
beak. Getting up cautiously he looked about. There, in deep shade,
perched on the gnarled root of a hickory tree that overlapped the
rock, was a great owl with a smooth, round head, blue-black eyes,
and brown, barred feathers. The bird sat still without blinking,
watching a small hole under the root. Tommy stood still, scarcely
breathing, in his wonder at the bird, hoping that it would not see
him and flap in his face as the screech-owl had in Anne’s.
Suddenly a young chipmunk, with back and tail striped like a garter
snake’s, ran out of the hole. One of the hooked claws made a grab,
snap went the beak, the little animal was secured, and the owl,
spreading its broad wings, flew into a hemlock, where it began to
eat at its leisure. Then only did Tommy remember his gun, and
about his promise to Miss Letty.
“Never mind,” he said to himself; “father says owls are usefuller than
most things they eat, and that they oughtn’t to be killed, so I’m glad
I let him go; but rabbits eat lots of our garden things every year. I
must look for that bunny, because it’s here somewhere, for when Mr.
Hugh says so, it always happens.”
Tommy found his way back to the path, and met Waddles hurrying
along; he also had found poor hunting, and was now willing to
follow. After walking some distance, and having several false alarms
(for when on the watch a couple of beech leaves or a tuft of wild
grass take fanciful shapes), Tommy actually saw a pair of long ears
held erect, and a pair of bright eyes glistening around the corner of
a rock just before him. His first fear was that Waddles should see the
prize and chase it away before he had a chance to aim and cock his
trigger, which was quite a feat, the spring was so strong. For once,
Waddles neither scented nor suspected anything, but kept close to
Tommy’s heels, nosing about in the moss.
One step more, the child raised his gun, shut his eyes, and fired, and
then a reaction came, and he didn’t like to open them again, so sure
he was of having killed the pretty creature. Finally he peeped a little,
then stared, for there sat the rabbit as round-eyed and placid as
before; it had not even moved!
Tommy’s impulse to fire again was stopped by the thought that it
would be very mean to shoot such a tame animal, and that it must
be some one’s pet, though it was not Pinkie Scott’s, for everybody in
Dogtown knew her rabbits by heart, they had carried them home to
her so many times, when they had strayed off gardening on their
own hook.

Tommy meets the Rabbit.


Waddles sauntered slowly forward, saw the rabbit, and making a
spring, knocked it over with one blow of his paw; but still it did not
move. Then Tommy saw that it was a stuffed beast mounted on a
little wooden platform, to which moss and dead leaves were glued.
When he had recovered from his astonishment he was ready to cry
with rage. “It was too mean of Mr. Hugh,” he muttered. “He
promised—he promised, and then he didn’t do it.” Then the exact
words of the promise came to him; it was that he was to “meet a
rabbit face to face.” “I s’pose I have,” he continued; “only he didn’t
say its insides would be stuffing instead of real.” But when he picked
up his gun, which he had dropped, and looked it over, and felt the
bag which sagged his pocket, he remembered that he had forgotten
to put any shot in the gun. Then he walked along, leaving the poor
stuffed rabbit resting on one ear, wondering which was the worst, to
have shot at a real rabbit with no shot, or to have been fooled by a
stuffed one, and at the moment that he made up his mind that the
first would be the most aggravating, he turned into the low meadow
that was divided from its neighbour by the old barbed wire fence,
and from which the lane led to Robin Hood’s Inn.
A yelping of dogs sounded afar off in the rear, with straggling cries
on both sides of him and in front. Off started Waddles, quickly
disappearing in the bushes, and Tommy followed as fast as his legs
could carry him, for he heard a voice and the trampling of hoofs,
and if the run was over, it must be luncheon time.
All unknown to him the drag-hunt had split in two, deaf Mrs. Happy
being the innocent first cause. She had gone to Robin Hood’s Inn
with Anne, and had curled up contentedly in the sunny porch in
company with old Laddie, when presently an odour reached her
nose that caused her to spring up, sniff the air, and start headlong
down the lane to the road, where, on crossing the stone fence, she
struck the trail of a skunk, startled from his daytime lodging by the
hounds who had recently passed close by. Nose to ground, she gave
tongue and followed the skunk, who had zigzagged about the fences
for a time before making off to another hiding-place he had by the
river. Further down, the hounds in doubling crossed this new trail,
and some of the young ones, hearing Happy’s cry, were drawn off
upon it, part of the riders following, only to come upon impassable
rocks by the river cut.

The barking came nearer, and Happy, Waddles, and Jack dashed
past Tommy and up the lane; at the same time he saw a riderless
horse in the outer field, and something seemed to move near the
barbed wire fence that ran between.
“It’s one of those poor hounds, and that wicked wire has caught
him,” cried Tommy, running toward the spot with his eyes flashing
and his little fists doubled up, for, like Anne, he could not bear to
have animals suffer pain.
But when he got near he saw that it was not a hound that was
caught by the wire, but Mr. Hugh! For an instant Tommy was
frightened, but as soon as he saw that his friend was not hurt, but
merely held fast by the clothes in a dozen places, the fun of the
situation struck him, and he capered about shouting, and making
comments, and asking questions, all in one breath.
“Ah, Mr. Hugh, you do look so funny! If only Anne were here with
her camera to take a picture! If you’ll wait long enough, I’ll go fetch
her, for you’re hooked up just like when Pinkie Scott reached after
lilies and fell in the pond, and they pulled her out from behind with
the hay-fork. Did the horse tumble you in like that?”
The truth was that Mr. Hugh had dismounted to let down some bars
for the people who had gone astray, and his horse, feeling fresh,
galloped off. In trying to head him off by a short cut, Mr. Hugh had
met the barbed wire fence, seen a gap between the strands, dashed
at it, only to be caught by a couple of slack wires when halfway
through, in such a position that if he let go the only hold he had
upon a half rotten post, he must fall upon a rusty coil that guarded
the tumble-down stone fence below. Barbed wire at best is cruel
stuff, and when it is old and rusty every scratch it gives means
danger.
“Stop bawling so, for pity’s sake, and see if you can help me out of
this mess before the others come; try to pry the wire with a stick,”
said Mr. Hugh, in so hoarse a whisper that Tommy instantly obeyed,
or rather tried to, but the sticks at hand were either too small or
rotten, and at every twist the poor man made the hooked wire
seemed to take new hold.
At this moment the snapping of twigs and the padding sound of
hoofs on grass made Mr. Hugh give a painful writhe to look over his
shoulder; his discomfiture was complete, for there was Miss Letty.
She slipped quickly to the ground, and tethering Brown Kate to a
branch, came forward, looking, as Tommy told Anne that night in the
privacy of his little bed, “the colour you feel when you’ve waited too
long for your breakfast.”
Seeing that Mr. Hugh had not been thrown, but was merely snared,
she pulled herself together and hesitated for a moment; while he,
putting on an air of bravado which was very funny under the
cramped circumstances, said: “Yes, here I am, and having parted
with my common sense I’m taking the consequences, and you have
your revenge. When all the party have had a good look at me, I
suppose some one will help me out.”
Miss Letty did not answer though she was afraid he would hear her
heart beat it was thumping so loudly, but looking about with a swift
glance spied Tommy’s gun that had fallen unnoticed in the grass.
Seizing it, she slipped it between the two furthest apart wires,
managing to catch a barb in the muzzle, and pried, while with the
handle of her riding crop she pulled back the two loose strands with
all her strength. There was a sound of tearing cloth, a pocket burst
open, throwing its contents in among the leaves, and Mr. Hugh
crawled out on his hands and knees, literally at Miss Letty’s feet. Just
as she stretched out her hand to help him, lest he slip backward,
one of the papers that Tommy was cramming back into the letter-
case caught her eye; it was the picture of herself that Anne had
taken, and which had disappeared as if by magic. Mr. Hugh, if it was
possible, turned redder than he was before he was released; but
Letty, with quiet tact, quickly unfastened Brown Kate and,
scrambling into the saddle by the aid of a stone at the fence corner,
cantered off in the opposite direction to where Mr. Hugh’s horse was
now quietly grazing.
For a minute the big man and the little one stood eying each other
curiously. Then Tommy broke the pause: “Now isn’t Miss Letty
common sensible and useful enough to be your sweetheart, Mr.
Hugh, even if she is pretty? And wouldn’t that red and black girl
have shouted if she’d seen you in the fence?”
“Yes, Tommy,” said Mr. Hugh, quietly; “you are a better judge than I
was; but Miss Letty does not wish to be the sweetheart of an old
bear like me.”
“No,” said Tommy, candidly, “I guess not, for I’ve heard her say you
were a bear, and so has Anne.” And though Tommy handed back the
letter book containing the picture without further comment, he had
seen, and when one has seen a thing, one can hardly unsee it again.
Mr. Hugh secured his horse and regained the road, Tommy riding in
front of him, before he overtook the others; and the beseeching look
that the big man gave the little one as he swung him to the ground
kept him quiet concerning the barbed wire episode, at least for some
hours.

At the end of an afternoon spent in archery, and shooting clay


pigeons, winding up with a great game of hide and seek, in which
old and young, men and women, joined, the last one to be found
receiving a prize of the beautifully painted head of a foxhound,
supper and the fire warmth made the party good-naturedly drowsy.
Miss Varley, who won the prize, had hidden herself beyond finding
by dropping into the hollow trunk of an old chestnut tree; but the
agility that took her in did not get her out again, which was only
accomplished by a long, strong pull by two of the most muscular
men of the party, engineered by Mr. Hugh. This, however, did not
count, and being much elated and in high spirits, she gradually
stirred the company into story-telling, camp-fire fashion, with the
difference that no one was to talk for a longer time than the faggot
he or she threw on the flames should burn. This caused more than
one tale to break off before the climax, and the guessing and
merriment that ensued soon made every one wide awake again,
with the exception of Tommy, who was destined to finish the
evening under the blue and white curtains of Mrs. Carr’s ample four
poster. So, as he said he had a story to tell, he was given the next
turn. Liking quick results, he picked a handful of white pine cones
from the basket instead of a stick, and as they flashed into a juicy
flame began deliberately:—
“Once there was a barbed wire fence on top of a stone wall. It ought
to have been taken down, ’cause it was rusty and wicked, but it
wasn’t, ’cause somebody forgot.”—Seeing signs of agitated interest
in at least two of his audience, Tommy spoke faster—“This old fence
was very cruel indeed, and it caught things tighter than spiders and
flies, but the things were bigger. First it caught a dear little dog
named Jill, and Mrs. Carr, when she was the Herb Witch, pulled her
out and mended her. The next thing that barbed wire fence caught
was bigger and funnier—a—great—big—” “Time’s up,” called Mr.
Hugh, before Tommy could say another word, at the moment that
the blaze vanished in blackness, after the fashion of pine-cone fires;
and if you said even a single word after time was called, you must
pay a fine.
However, as Anne led Tommy away, fairly stumbling with the sleep
that was in his heels if not in his head, he turned, hung back, and
said to Mr. Hugh, in a piping voice that could be heard above all the
babble, “You needn’t have looked so scared, I wasn’t going to tell it
just zackly the way it was—nor about that picture Anne took of Miss
Letty—nor—” but the closing door kindly shut Tommy off, and
though the entire party suspected a joke of some kind, only one
beside the conscious pair saw through the whole affair. This was
Miss Jule, who had seen Mr. Hugh slip the photograph into his
pocket that afternoon long ago, before the sixlets were born. She
had also chanced to see from a distance the barbed wire fence
episode, and for some reason known to herself a motherly smile of
content lighted her plain features, until Letty, glancing shyly at her
aunt, wondered why she had never before thought her fine looking.
Mrs. Carr’s various combinations of apples, nuts, candles, rings,
flour, and pails of water, that go to make up Hallowe’en tricks,
produced more good-natured fun, especially when Miss Letty, after
swinging it thrice over her head, threw the apple paring over her left
shoulder, causing Anne to exclaim at the initial it made, which was
promptly eaten by Tip, who loved fruit, before any one else could
decipher it.
Then the stage and brake came up, and there was a search for
wraps, while Anne was astounded and mystified to find Miss Letty
hugging poor Happy and stuffing her with cold chicken. She had
been shut up supperless in a back passageway because she had
been disobedient and spoiled the hunt, and had also gone too near
the skunk.
Mr. Hugh’s horse had been put up in Miss Jule’s stable, so he rode
that far in the brake with the others, and stopped off to get him. As
there was no reason why he should wait outside in the cold, he went
in with Miss Jule, who hurried off to make some coffee (Anna Maria
having retired), as she said, to “settle their wits, after too much
supper and too much laughter,” leaving the two standing before the
hall fire, feeling equally awkward. Colin and Hamlet, who had stayed
at home, hearing voices, came racing from the kitchen hall and
greeted Letty with an unfeigned joy that tumbled her hair down on
her shoulders, while Tip, not to be outdone, sprang upon the back of
a near-by chair and, paws on her shoulder, gave her a kiss on the tip
of the nose.
“Love me, love my dog,” quoted Miss Letty, struggling with her pets,
and, after the fashion of flustered people, meaning nothing in
particular by her words.
“I do,” answered Mr. Hugh, promptly, having found himself at last.
“Ah!” was what Miss Jule said, when she returned with the coffee
fifteen minutes later.
That night Miss Letty wrote a long letter to her Aunt Marie, telling
her that she liked American customs so much that she had decided
to remain in the country. The letter also said other things which
prevented Aunt Marie from accusing Aunt Jule of unfair influence,
which was quite fortunate.
Before the week was over everybody had heard the news, and
everybody was glad, which was quite wonderful, and Tommy had
the honour of being the messenger. This office he filled most
thoroughly, adding details from time to time to entertain his hearers,
that were certainly not a part of his commission.
Presently, one rainy day, Miss Letty herself came down, as Anne
said, for a good talk, and before seating herself with the children
and dogs on the hearth rug, she pulled a round bundle from her
ulster pocket and tossed it to Anne, who exclaimed upon opening it,
for out fell two beautiful silver bands, lined with chamois, upon
which letters were engraved.
“Why, they are dog collars! Who are they for?” she exclaimed,
holding them toward the light to read the letters.
“For Mr. and Mrs. Waddles, and they are from us, because,—
because, you see, we think that if Happy had not mixed up the drag-
hunt we might have kept on misunderstanding and wandering
around Robin Hood’s barn always.”
“They are perfectly lovely, and too good for every day,” said Anne,
fastening one on Happy, but having to coax Waddles, who was
always suspicious of new-fangled things. “But don’t you really, truly
think, dear Miss Letty, that the poor old barbed wire fence deserves
a silver collar, too?”
CHAPTER XV
THE WEDDING

The wedding was in May, exactly a year from the day of the poison
ivy luncheon. All Dogtown was invited, and filled the gray stone
church on the hillside to overflowing, even though the dogs attended
by proxy, except in a few rare cases. Laddie was one of these, for
Mrs. Carr never went without him, and he sat quietly beside her like
a little old man, with bent head and silvery locks.
Mrs. Carr herself was resplendent in a new black cloak, and a close
silk bonnet of the bride’s making took the place of the old pointed
hood. Her gift was her precious old Lowestoft teaset. “I’ve had my
pride o’ it,” she said, when Miss Jule had remonstrated with her, “and
when I gie a gift I like it o’ gude stuff.”
Anne was maid of honour, and Tommy wept bitterly because he
could not be best man. However, he managed to be quite prominent
as it was.
The day was perfect, and both the church and the quaint, low-
studded rooms at the Hilltop Farm were turned into gardens by the
great sprays and wreaths of white lilacs and dogwood with which
Miss Jule and the Happy Hall people had covered even the walls.
The dogs of all three families had been brushed, and their collars
decorated with immense bows of white ribbon; but they were
carefully locked up during the ceremony, to be ready to appear at
the breakfast, for if Waddles had gone near enough to the church to
have heard the organ play, his baying would have certainly brought
the wedding march to an untimely end.
As it was, all promised well, and as Miss Letty crossed the vine-
draped church porch, the people who watched thought that never
had there been a sweeter girl bride. On the side nearest to Anne a
dimple that would come and go, and threatened to end in a smile,
broke the seriousness of her face, and the cause of it was at first
hidden by the folds of her veil and train. It was Tip, the devoted
spaniel, who, climbing out of the window of the room where he was
prisoned, had dropped first to the porch and then the ground, and
caught up with the procession just in time to slip into the church
unnoticed, except by her he was following.
However, he
behaved like a
gentleman, and sat
sedately on the top
step during the
ceremony. This,
together with the
white bow he
wore, caused some
of the village
gossips, who were
not invited, to say
that the whole
thing was planned,
and was a disgrace
to the town; but
wise people know
that such remarks
are as much a part
of a wedding as
the ring and veil.
Tommy, who with his mother and father
occupied one of the front pews, crept out and drew gradually nearer
to where stood the family lawyer and friend, on whose arm the bride
had entered. In another moment he had climbed into a chancel chair
that was partly concealed by a column; from this place he had an
unimpeded view. It was the first time that the child had ever been to
a wedding, and the doings had all the fascination of entire novelty.
So when the clergyman, looking up, asked distinctly, “Who giveth
this woman to be married to this man?” Tommy shouted “Me!”
without the slightest suspicion that it was not what was expected of
him, adding indignantly to an usher who made haste to lift him
down, amid the natural ripple of laughter, “I had to, of course,
’cause she’d rather, and now she isn’t my sweetheart any more.”
The wedding breakfast was very jolly, at least everybody said so,
and all sorts of jokes were mingled with the congratulations. The
minister, who was very bashful, astonished himself by saying that he
was glad that they had finished with all the barbed wires of life
before the wedding, and then suddenly kissed the bride, amid
general applause.
The wedding cake boxes were white with initials, and a dog’s head,
Miss Jule’s crest, in silver. And the gossips had a second spasm when
they learned beyond dispute that there were souvenirs, of Miss
Letty’s invention, for all who owned dogs—small-sized Bologna
sausages wrapped in silver foil, and tied with white.
After it was all over,—and the bride had gone away, and the last
shoe been thrown, while Miss Jule was removing rice from her neck,
saying to a rather mournful relative, “Of course they will be happy,
they can’t help it, for they not only like but dislike the same
things,”—Tip appeared from upstairs with a crestfallen air, and in his
mouth a white slipper, one that his idol had just discarded, which
had dropped to the floor of her room.
Coming out on the porch, after several efforts he succeeded in
sitting upright, a trick Letty had taught him in imitation of Hamlet,
supporting his unsteady spine against the post. Then, as no Miss
Letty came to applaud him, he dropped the slipper on the step as a
challenge, and mounted guard over it until night came, when he
carried it with him to bed unchidden.

“Mistress,” said Waddles, as he sat watching her that night while she
put away her trinkets, and brushed and braided her hair, “I wish that
I hadn’t eaten so much of that round black lumpy cheese that Miss
Letty cut with the great knife.”
“So do I,” said Anne, with a sigh; “but then, Waddlekins, you see Mr.
Hugh and Miss Letty will never be married to each other again, and
we must be willing to bear a little pain inside for the sake of our
friends!”
Then the Mayor of Dogtown and Diana his mistress slept the sleep
of wedding cake, which is heavy with dreams!

Here end the Annals.


Four-Footed Americans and Their Kin
By MABEL OSGOOD WRIGHT
Edited by Frank M. Chapman. Illustrated by Ernest Seton-
Thompson
Cloth. Crown 8vo. $1.50, net
“It deserves commendation for its fascinating style,
and for the fund of information which it contains
regarding the familiar and many unfamiliar animals of
this country. It is an ideal book for children, and
doubtless older folk will find in its pages much of
interest.”—The Dial.
“Books like this are cups of delight to wide-awake and
inquisitive girls and boys. Here is a gossipy history of
American quadrupeds, bright, entertaining, and
thoroughly instructive. The text, by Mrs. Wright, has all
the fascination that distinguishes her other outdoor
books.”—The Independent.

Citizen Bird
Scenes from Bird-life in Plain English for a Beginner
By MABEL O. WRIGHT and Dr. ELLIOTT COUES
Profusely illustrated by Louis Agassiz Fuertes
Cloth. Crown 8vo. $1.50, net
“When two writers of marked ability in both literature
and natural history write to produce a work giving
scope to their special talents, the public has reason to
expect a masterpiece of its kind. In the ‘Citizen Bird,’
by Mabel O. Wright and Dr. Elliot Coues, this
expectation is realized—seldom is the plan of a book
so admirably conceived, and in every detail so
excellently fulfilled.”—The Dial.
“There is no other book in existence so well fitted for
arousing and directing the interest that all children feel
toward the birds.”—Tribune, Chicago.

Birdcraft
A Field-Book of Two Hundred Song, Game, and Water
Birds
By MABEL OSGOOD WRIGHT
With eighty full-page plates by Louis Agassiz Fuertes
“One of the best books that amateurs in the study of
ornithology can find ... direct, forcible, plain, and
pleasing.”—Chautauquan.
“Of books on birds there are many, all more or less
valuable, but ‘Birdcraft,’ by Mabel O. Wright, has
peculiar merits that will endear it to amateur
ornithologists.... A large number of excellent
illustrations throw light on the text and help to make a
book that will arouse the delight and win the gratitude
of every lover of birds.”—Saturday Evening Gazette,
Boston.

Tommy-Anne and the Three Hearts


By MABEL OSGOOD WRIGHT
With many illustrations by Albert D. Blashfield
Cloth. Crown 8vo. $1.50
“This book is calculated to interest children in nature,
and grown folks, too, will find themselves catching the
author’s enthusiasm. As for Tommy-Anne herself, she
is bound to make friends wherever she is known. The
more of such books as these, the better for the
children. One Tommy-Anne is worth a whole shelf of
the average juvenile literature.”—The Critic.

Wabeno, the Magician


The Sequel to Tommy-Anne and the Three Hearts
By MABEL OSGOOD WRIGHT
Fully illustrated by Joseph M. Gleeson
Cloth. Crown 8vo. $1.50
“Mrs. Wright’s book teaches her young readers to use
their eyes and ears, but it does more in that it
cultivates in them a genuine love for nature and for
every member of the animal kingdom. The best of the
book is that it is never dull.”—Boston Budget.

The Dream Fox Story Book


By MABEL OSGOOD WRIGHT
With eighty drawings by Oliver Herford
Cloth. Small quarto. $1.50, net
Mrs. Wright’s new book for young people recounts the
marvellous adventures of Billy Benton, his
acquaintance with the Dream Fox and the Night Mare,
and what came of it. It differs from the author’s
previous stories, as it is purely imaginative and
somewhat similar to “Alice in Wonderland.”
There are eight full-page illustrations, showing Billy at
moments of greatest interest, and also seventy
drawings scattered throughout the text. These
illustrations are by Oliver Herford, who has entered
thoroughly into the spirit of the text, so that the
pictures seem an integral part of the story.
Flowers and Ferns in Their Haunts
By MABEL OSGOOD WRIGHT
With illustrations from photographs by the author and
J. Horace McFarland
Cloth, 12mo. $2.50, net
“The reader of Mrs. Wright’s handsome volume will
wend his way into a fairy world of loveliness, and find
not only serious wildwood lore, but poetry also, and
sentiment and pictures of the pen that will stay with
him through winter days of snow and ice.... A careful
and interesting companion, its many illustrations being
particularly useful.”—New York Tribune.
“There is no question that this is a book in which you
must be examined before you are fit to pass into the
country.”—New York Sun.
“The illustrations are altogether worthy of the text ... a
series of exquisite pictures of flowers and ferns.”—
London Daily News.

The Friendship of Nature


A New England Chronicle of Birds and Flowers
By MABEL OSGOOD WRIGHT
18mo. Cloth, 75 cts. Large Paper, $3.00
“A dainty little volume, exhaling the perfume and
radiating the hues of both cultivated and wild flowers,
echoing the songs of birds, and illustrated with
exquisite pen pictures of bits of garden, field, and
woodland scenery. The author is an intimate of nature.
She relishes its beauties with the keenest delight, and
describes them with a musical flow of language that
carries us along from a ‘May Day’ to a ‘Winter Mood’ in
a thoroughly sustained effort; and as we drift with the
current of her fancy and her tribute to nature, we
gather much that is informatory, for she has made a
close study of the habits of birds and the legendry of
flowers.”—Richmond Dispatch.

THE MACMILLAN COMPANY


66 FIFTH AVENUE, NEW YORK
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like