HTML5 Canvas Second Edition Steve Fulton - Instantly Access The Complete Ebook With Just One Click
HTML5 Canvas Second Edition Steve Fulton - Instantly Access The Complete Ebook With Just One Click
com
https://ebookname.com/product/html5-canvas-second-edition-
steve-fulton/
OR CLICK HERE
DOWLOAD EBOOK
https://ebookname.com/product/canvas-pocket-reference-scripted-
graphics-for-html5-david-flanagan/
https://ebookname.com/product/foundation-html5-canvas-for-games-
and-entertainment-1st-edition-rob-hawkes/
https://ebookname.com/product/the-opportunity-analysis-canvas-
third-edition-james-v-green/
https://ebookname.com/product/peugeot-306-richard-nicholls/
Handbook of Pharmaceutical Manufacturing Formulations
Over the Counter Products Volume 5 of 6 1st Edition
Niazi
https://ebookname.com/product/handbook-of-pharmaceutical-
manufacturing-formulations-over-the-counter-products-
volume-5-of-6-1st-edition-niazi/
https://ebookname.com/product/imagination-and-the-arts-in-c-s-
lewis-journeying-to-narnia-and-other-worlds-1st-edition-peter-j-
schakel/
https://ebookname.com/product/numerical-analysis-for-scientists-
and-engineers-theory-and-c-programs-1st-edition-madhumangal-pal/
https://ebookname.com/product/people-under-three-young-children-
in-day-care-second-edition-elinor-goldschmied/
https://ebookname.com/product/transplantation-a-companion-to-
specialist-surgical-practice-5e-5th-edition-john-l-r-forsythe/
Ian Hamilton Finlay selections Finlay
https://ebookname.com/product/ian-hamilton-finlay-selections-
finlay/
SECOND EDITION
HTML5 Canvas
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly
Media, Inc. HTML5 Canvas, Second Edition, the image of a New Zealand kaka, and related trade dress are
trademarks of O’Reilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a trade‐
mark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and authors assume
no responsibility for errors or omissions, or for damages resulting from the use of the information contained
herein.
ISBN: 978-1-449-33498-7
[LSI]
For Pop
Table of Contents
Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
v
The initGame() Function 21
The eventKeyPressed() Function 21
The drawScreen() Function 23
Exporting Canvas to an Image 24
The Final Game Code 25
Hello World Animated Edition 25
Some Necessary Properties 26
Animation Loop 27
Alpha Transparency with the globalAlpha Property 28
Clearing and Displaying the Background 28
Updating the globalAlpha Property for Text Display 29
Drawing the Text 29
HTML5 Canvas and Accessibility: Sub Dom 31
Hit Testing Proposal 32
What’s Next? 33
vi | Table of Contents
Resetting the Canvas Width and Height 77
Resetting the Canvas clearRect Function 77
Checking to See Whether a Point Is in the Current Path 79
Drawing a Focus Ring 80
What’s Next? 80
Table of Contents | ix
What’s Next? 303
x | Table of Contents
Displaying Attributes on the Canvas 388
Playing a Sound with No Audio Tag 391
Dynamically Creating an Audio Element in JavaScript 392
Finding the Supported Audio Format 393
Playing the Sound 394
Look Ma, No Tag! 395
Creating a Canvas Audio Player 397
Creating Custom User Controls on the Canvas 398
Loading the Button Assets 399
Setting Up the Audio Player Values 400
Mouse Events 401
Sliding Play Indicator 402
Play/Pause Push Button: Hit Test Point Revisited 403
Loop/No Loop Toggle Button 406
Click-and-Drag Volume Slider 406
Case Study in Audio: Space Raiders Game 416
Why Sounds in Apps Are Different: Event Sounds 416
Iterations 416
Space Raiders Game Structure 417
Iteration #1: Playing Sounds Using a Single Object 426
Iteration #2: Creating Unlimited Dynamic Sound Objects 427
Iteration #3: Creating a Sound Pool 429
Iteration #4: Reusing Preloaded Sounds 431
Web Audio API 435
What Is the Web Audio API? 436
Space Raiders with the Web Audio API Applied 436
What’s Next? 439
Table of Contents | xi
Game Graphic Transformations 453
Rotating the Player Ship from the Center 453
Alpha Fading the Player Ship 455
Game Object Physics and Animation 456
How Our Player Ship Will Move 456
Controlling the Player Ship with the Keyboard 458
Giving the Player Ship a Maximum Velocity 462
A Basic Game Framework 463
The Game State Machine 463
The Update/Render (Repeat) Cycle 467
The FrameRateCounter Object Prototype 469
Putting It All Together 471
Geo Blaster Game Structure 471
Geo Blaster Global Game Variables 475
The Player Object 476
Geo Blaster Game Algorithms 477
Arrays of Logical Display Objects 477
Level Knobs 479
Level and Game End 480
Awarding the Player Extra Ships 481
Applying Collision Detection 481
The Geo Blaster Basic Full Source 483
Rock Object Prototype 484
Simple A* Path Finding on a Tile Grid 486
What Is A*? 486
A* Applied to a Larger Tile Map 493
A* Taking Diagonal Moves into Account 498
A* with Node Weights 502
A* with Node Weights and Diagonals 506
Moving a Game Character Along the A* Path 514
Tanks That Pass Through Walls? 518
What’s Next? 528
"I don't wonder that you look like you was half tickled to death," was
the way in which Dan began the conversation with his brother. "Did
you ever dream that me and you would have such amazing good
luck as has come to us this day? Now, let me tell you, it bangs me
completely. Don't it you?"
Joe did not know how to reply to this. He had seldom seen Dan in so
high spirits, and he could not imagine what he was referring to when
he spoke of the good luck that had fallen to both of them.
"Say—don't it bang you?" repeated Dan. "Ain't me and you going to
live like the richest of them this winter?"
"You and I?" said Joe, with no suspicion of the truth in his mind.
"That's what I remarked," exclaimed Dan, who could hardly keep
from dancing in the excess of his joy. "I tell you, Joe," he added,
confidentially, "if there's anything in life I take pleasure in, it's living
in the woods during the winter, when you've got a tight roof to
shelter you and plenty of firewood to burn, so't you don't have to go
through the deep snow to cut it. That's what I call living, that is."
"I don't see how you happen to know so much about it. You never
tried it."
"I know I never did; but didn't I tell you almost the very first word I
said, that I'm going to try it this winter?"
"Oh!" said Joe, who now thought he began to understand the
matter. "Are you going to be Mr. Hallet's game-warden?"
"Perzackly. You've hit centre the first time trying."
"Then I wonder why Mr. Warren did not say something to me about
it."
And there was still another thing that caused Joe to wonder,
although he made no reference to it. How did it come that Mr.
Hallet, who knew how persistently Dan broke the law in regard to
snaring birds and hares, and shooting out of season—how did it
come that he had selected this poacher to act as his game-warden?
He might as well have hired a wolf to watch his sheep.
"Now wait till I tell you," said Dan hastily. "The thing ain't quite
settled yet, 'cause I ain't had no time to run down and see old man
Hallet; but—"
"Aha!" exclaimed Joe.
"There ain't no 'aha' about it," cried Dan, who was angry in an
instant. "Wait till I tell you. I ain't been down to see old man Hallet
yet, but I'm going directly, and I'm going to say to him that if he
wants somebody to keep an eye on them birds of his'n, I'm the man
he's looking for. He'll be glad to take me, of course, 'cause if there's
any one in the whole country who knows all about a game-warden's
business, its me. But if he can't take me—if he has picked out
another man before I get a chance to speak to him—me and you will
go halvers on them hundred and twenty, won't we?"
"No, we won't," replied Joe, promptly.
"What for, won't we?" demanded Dan.
"For a good many reasons. In the first place, Mr. Warren seems to
think that he needs but one warden, and that I can do all the work
myself."
"Well, you can't, and you shan't, neither," Dan almost shouted.
And in order to show his brother how very much in earnest he was
about it, he struck up a war-dance, and called loudly for somebody
to hold him on the ground.
"And in the next place," continued Joe, who had witnessed these
ebullitions of rage often enough to know that they never ended in
anything more serious than an unnecessary expenditure of breath
and strength on Dan's part—"in the next place, every cent I make
this winter will go to mother, with the exception of the little I shall
need to clothe myself."
"I'll bet you a good hoss that it don't," roared Dan, who was so
angry that it was all he could do to keep from laying violent hands
upon his brother. "Now let me tell you what's the gospel truth, Joe
Morgan: If you don't go pardners with me in this business, I'll bust
up the whole thing. If I don't get half them hundred and twenty
dollars, you shan't have a cent to bless yourself with. I've been
kicked and slammed around till I am tired of it, and I ain't going to
ask my consent to stand it no longer."
"If you want money, go to work and earn it for yourself," said Joe.
"You can't have any of mine."
"I'll show you whether I will or not. Now, let me tell you: I'll make
more out of them birds this winter than you will. You're awful smart,
but you'll find that there are them in the world that are just as smart
as you be."
"I know what you mean by that," answered Joe, who had fully made
up his mind to see trouble with Dan. "Now let me tell you
something: If I catch you on Mr. Warren's grounds after I take
charge of them, you will wish you had stayed away, mind that. I
took this position because mother needs money, and having
accepted it, I shall look out for my employer's interests the best I
know how. But why do you go against me in this way? You ought to
help me all you can."
"Then why don't you help me?" retorted Dan.
"You don't need it. You are able to help yourself, because you have
no one else to look out for."
"Then I won't help you, neither. You want to keep a close watch over
that shanty of your'n, or the first thing you know, you will come back
to it some dark, cold night, almost froze to death, and it won't be
there."
Joe walked off without making any reply, and Dan stood shaking his
fists at him until he disappeared. Then he turned about to find
himself face to face with his father, to whom he told his story, not
forgetting to make a few artful additions, which he hoped would
have the effect of making the ferryman as angry at Joe as he was
himself.
A disinterested listener would have thought that Joe was the
meanest brother any fellow ever had, and that Dan was deserving of
better treatment at his hands.
"Now, I just want you to tell me what you think of that," said Dan,
as he brought his highly-seasoned narrative to a close. "He's a most
scandalous stingy chap, that Joe of our'n is. He wants to keep his
good things all to himself. And—would you believe it, pap, if I didn't
tell you?—he said he would as soon shoot your dog or mine as look
at 'em, and that if we come fooling around where he was, he'd have
us tooken up, sure pop."
Silas Morgan's eyes flashed, and an angry scowl settled on his
swarthy face.
Dan was succeeding famously in his efforts to arouse his father's ire
against the unoffending Joe—at least he thought so—and he hoped
to increase it until it broke out into some violent demonstration.
"Them's his very words, pap," continued Dan, with unblushing
mendacity. "Since he took up with that rich man awhile ago, he has
outgrowed his clothes, and me and you ain't good enough for him.
Me and Joe could have had just the nicest kind of times up there in
the woods, and by doing a little extry work on the sly, we could have
snared enough of old man Warren's birds, and Hal—um!"
Dan caught his breath just in time. He was about to say that he and
Joe could have snared enough of Mr. Warren's birds and Hallet's to
run the amount of their joint earnings up to two hundred dollars; but
he suddenly remembered that his father was not yet aware that Mr.
Hallet's covers had been freshly stocked, and that that was a matter
that was to be kept from his knowledge, so that Dan could have the
field to himself.
But the ferryman was quick to catch some things, if he was dull in
comprehending others, and Dan had inadvertently given him an idea
to ponder over at his leisure.
"But then I don't care for such trifling things as birds any more," said
Silas to himself. "If Hallet has been fooling away his money for more
pa'tridges, Dan can have the fun of shooting 'em, if he wants it; and
while he is tramping around through the cold looking for 'em, I'll be
snug and warm at home, living like a lord on the money I took out
of that cave up there in the mountings. What was you saying,
Dannie?"
"I said that me and Joe could have made right smart by doing a little
trapping on the quiet," answered Dan. "But he wouldn't hear to my
going up there to live with him. What's grub enough for one is grub
enough for two, and I could have had piles of things that come from
old man Warren's table, and never cost you a red cent the whole
winter. More than that, being on the ground all the while, it wouldn't
be no trouble at all for me to knock over one of them deer now and
then, and that would save you from buying so much bacon; but that
mean Joe of our'n he wouldn't hear to it, and now I'm going to
knock all his 'rangements higher'n the moon."
"What be you going to do, Dannie?" Silas asked, in a voice so calm
and steady that the boy backed off a step or two and looked at him
suspiciously.
Was his father about to side with Joe? Dan was really afraid of it,
and his voice did not have that resolute ring in it when he answered:
"I'm going to set some snares up there where Joe won't never think
of looking for them, and by the time Christmas gets here I'll have
every one of them English birds in the market and sold for cash."
The ferryman thrust one hand deep into his pocket, and shook the
other menacingly at Dan.
"Look a-here, son," said he, in a tone which he never assumed
unless he meant that his words should carry weight with them, "you
just keep away from old man Warren's woods, and let them English
birds be. Are you listening to your pap?"
"What for?" Dan almost gasped.
"'Cause why; that's what for," was the not very satisfactory answer.
"You want to pay right smart heed to what I'm saying to you, 'cause
if you don't, I'll wear a hickory out over your back, big as you think
you be."
"Well, if this ain't a trifle the beatenest thing I ever heard of, I don't
want a cent," began Dan, who was utterly amazed. "Do you want
them—that rich feller to have all the fine shooting to himself?"
"That ain't what I'm thinking about just now," replied the ferryman.
"I want Joe to earn them hundred and twenty dollars; see the p'int?"
"Not all of it?" exclaimed Dan.
"Yes, every cent."
"Can't I make him go pardners with me?"
"No, you can't. I want Joe to have the handling of it all."
"Then you won't never see none of it; you can bet high on that."
"Yes, I reckon I'll see the whole of it. You and Joe ain't twenty-one
year old yet, and the law gives me the right to take every cent you
make."
For a moment Dan stood speechless with rage and astonishment;
but quickly recovering the use of his tongue, he squared himself for
a fight, and demanded furiously:
"And is that the reason you never give me a red for breaking my
back with that ferry? Whoop! hold me on the ground, somebody!"
"If I had a good hickory in my hands, I reckon I could very soon
make you willing to hold yourself on the ground," said his father,
calmly.
"Whoop!" yelled Dan, jumping into the air, and knocking his heels
together. "This bangs me; don't it you? The men who was here just
now said you was one nuisance, and Hobson was another; and I am
so glad that the business is clean busted up, that—"
Silas suddenly thrust out one of his long arms, but his fingers closed
upon the empty air instead of upon Dan's collar. The boy escaped his
grasp by ducking his head like a flash, and then he straightened up
and took to his heels.
CHAPTER VIII.
JOE'S PLANS IN DANGER.
"I don't know what answer to make you, boys. I have no desire to
interfere with your pleasures, and I think you have always found me
ready to listen to any reasonable proposition; but this latest scheme
of yours looks to me to be a little—you know. I don't believe that
Bob's father will consent to it."
"Suppose you give your consent, and then we will see what we can
do with Bob's father. If we can say that you are willing, he'll come to
terms without any coaxing."
"I don't see what objection there can be to it. We can't get into
mischief up there in the mountains, and we'll promise to study hard
every spare minute we get. There!"
"And be fully prepared to go on with our class when the spring term
begins. Now!"
The first speaker was Mr. Hallet, who leaned back in his easy-chair
and twirled his eye-glasses around his finger, while he looked at the
two uneasy, mischief-loving boys who stood before him.
Tom Hallet was his nephew and ward, and Bob Emerson was the son
of an old school-friend who lived in Bellville, ten miles away.
Bob, who was a fine, manly fellow, was a great favorite with both
uncle and nephew, and had a standing invitation to spend all his
vacations with them at their comfortable home among the
Summerdale hills.
To quote from Bob, Mr. Hallet's house was eminently a place for a
tired school-boy to get away to. The fishing in the lake, and in the
clear, dancing streams that emptied into it, was fine; young squirrels
were always abundant after the first of August; and when
September came, the law was "off" on grouse, wild turkeys and
deer. Hares and 'coons were plenty, and Tom's little beagle knew
right where to go to find them. Better than all, according to the
boys' way of thinking, Mr. Hallet was a jolly old bachelor, who
thoroughly enjoyed life in a quiet way, and who meant that every
one around him should do the same.
Taking all these things into consideration, it was little wonder that
Bob Emerson looked forward to his yearly "outings" with the liveliest
anticipations of pleasure.
The Summerdale hills, in days gone by, had been a hunter's
paradise; but, sad to relate, their glory was fast passing away, like
that of many another place which had once been noted for the
abundance of its game and fish.
Mr. Warren, to use his own language, had been foolish enough to
build a hotel at the Beach, and to connect it with Bellville by a stage
route. This brought an influx of strangers, some of whom called
themselves sportsmen, who did more to depopulate the woods and
streams than Silas Morgan, Hobson, and a few others of that ilk,
could have accomplished in a year's steady shooting and angling.
Their advent gave rise to a class of men who had never before been
known in that region—to wit, guides. There were some good and
honest ones among them, of course; but, as a rule, they were a
shiftless, lawless class—men who lived from hand to mouth, and
who looked upon game laws as so many infringements of their
rights, which were to be defied and resisted in any way they could
think of.
Up to the time the hotel was built, these men lived in utter
ignorance of the fact that there were laws in force which prohibited
hunting and fishing at certain seasons of the year; but one year the
District Game Protector came up on the stage to look into things,
and when he went back to Bellville he took with him a guide and his
employer, whom he had caught in the act of shooting deer, when the
law said that they should not be molested.
This unexpected interference with their bread and butter astonished
and enraged the rest of the guides, who at once held an indignation
meeting, and resolved that they would not submit to any such
outrageous things as game laws, in the making of which their
opinions and desires had not been consulted.
They boldly declared that they would continue to hunt and fish
whenever they felt like it, and any officer who came to the hills to
stop them would be likely to get himself into business.
A few of the residents, including Mr. Warren and Mr. Hallet, had tried
hard to bring about a better state of things.
They had gone to the expense of restocking their almost tenantless
woods, and had been untiring in their efforts to have every poacher
and law-breaker arrested and punished for his misdeeds; but all they
had succeeded in doing thus far was to call down upon their heads
the hearty maledictions of the whole ruffianly crew, who owed them
a grudge and only awaited a favorable opportunity to pay it.
This was the way things stood on the morning that Tom Hallet,
accompanied by his friend Bob, presented himself before his uncle,
with the request that he would permit them to keep an eye on his
English partridges and quails during the ensuing winter—in other
words, that he would empower them to act as his game-wardens.
Mr. Hallet was not at all surprised, for the boys had sprung so many
"hare-brained schemes" on him, that he was ready for anything; but
still he took a few minutes in which to consider the proposition
before he made them any reply.
"What in the world put that notion into your heads, anyway?" said
Mr. Hallet, continuing the conversation which we have so
unceremoniously interrupted. "Is it simply an excuse to get out of
school for the winter?"
The boys indignantly denied that they had any idea of such a thing.
They liked their school and everything connected with it; but they
thought it would be fun to spend a few months in the woods. And
since Uncle Hallet would have to employ somebody to act as game-
warden, or run the risk of having all his costly birds killed by
trespassers, why couldn't he employ them as well as any one else?
"Well, you two do think up the queerest ways for having fun that I
even heard of," said Mr. Hallet. "I know something about camp-life,
and you don't; and I tell you—"
"Why, Uncle," exclaimed Tom, "haven't we already spent a whole
week in camp since Bob came up here?"
"A whole week!" repeated Mr. Hallet. "Yes, and it tired you out, and
you were glad enough to get home. I know that 'camping out' looks
very well on paper, but I tell you that it is the hardest kind of work,
even for a lazy person, to say nothing of a couple of uneasy
youngsters, who can't keep still for five minutes at a time to save
their lives. Besides, how do I know that you wouldn't shoot some of
my blue-headed birds, as Morgan calls them?"
"Don't you suppose that we know a ruffed grouse from an English
partridge or quail?" demanded Tom. "We are not so liable to make
mistakes in that regard as others might be. Who is Mr. Warren going
to hire for his warden?"
"I believe he has gone up to Morgan's to-day to speak to Joe about
it."
"I don't know how that will work," said Bob, reflectively. "Joe is all
right, but his father and brother are not, and I am afraid they will
make trouble for him."
"I thought of that, and so did Warren," answered Mr. Hallet, "and it
is a point that you two would do well to consider before you insist on
going into the mountains this winter. I am told that Hobson is furious
over the opening of the new road, and that he and a few of his
friends have threatened to burn the houses Warren and I built up
there in the woods, and to drive out anybody we may put there to
act as game-wardens."
When Tom and Bob heard this, they exchanged glances that were
full of meaning.
Uncle Hallet's words showed them that there was a prospect for
excitement during the coming winter, and the knowledge of this fact
made them all the more determined to carry their point.
"Oh, you needn't look at each other in that way," said Mr. Hallet,
with a laugh. "I know what you are thinking about, and I have no
notion of allowing you to do something to get these poachers and
law-breakers down on you. However I am going to the village
directly, and perhaps I'll drop in and see what Bob's father thinks
about it."
"Don't forget to tell him that we have your full and free consent,"
began Tom.
"But I haven't given it," interrupted Mr. Hallet, adjusting his eye-
glasses across the bridge of his nose and reaching for his paper.
"And that we shall go along with all our lessons just as fast as the
boys in school will," chimed in Bob.
"I'll not forget it; but I shall be much surprised at your father if he
believes it."
Uncle Hallet resumed his reading, and the boys, taking this as a hint
that he had said all he had to say on the subject, put on their hats
and left the room.
"It's all right, Bob," said Tom, gleefully.
"I am sure of it," replied Bob. "We've got Uncle Hallet on our side,
and it will be no trouble for him to talk father over. Now let's finish
that letter to Mr. Morgan, and then go up and put it in his wood-
pile."
So saying, Bob went up the stairs three at a jump, Tom following
close at his heels.
CHAPTER X.
WHY THE LETTER WAS WRITTEN.
When the boys reached the landing at the head of the stairs, they
turned into Tom's room, the door of which stood invitingly open.
Bob seated himself at a table and picked up a pen, while Tom leaned
over his shoulder and fastened his eyes upon the unfinished letter, to
which reference was made at the close of the last chapter.
"Let's see—how far did we get?" said the latter. "I believe we were
talking about a bank they were supposed to have robbed
somewhere in California. Well, say that they took a pile of money—
seventy thousand dollars out of it. But I say, Bob! That's awful bad
printing. I don't know whether Silas can make out to read it or not."
"Then let him get somebody to help him," answered Bob. "I can't be
expected to furnish him with the key, after going to so much trouble
to write the letter."
"But if he can't read it, what use will it be to him?" asked Tom.
"Probably he's got friends who can spell it out for him, and I'm sure
I don't care how much publicity he gives it. 'And there we took out
seventy thousand dollars,'" said Bob. "Go on; what next? They went
to Canada after that, didn't they? There is where all the crooks go
these days."
"Put it down, anyway. 'So we went to Canady (be careful about the
spelling) and staid there till the country got too hot for us.' That
reads all right," said Tom, throwing himself into the big rocking-chair,
and wondering, like the minister in the "One-Hoss Shay," what the
Moses should come next. "Don't forget to say something about the
'hant' who guards the treasure in the cave."
"Can't you wait till I come to the cave?" replied Bob, who could not
print the letter as fast as his friend could think up things to put into
it. "I don't altogether approve of this ghost business, anyway. I am
afraid it will scare the old fellow so badly that he will make no
attempt to find the treasure that is concealed in the cave."
"Don't you worry about that," Tom replied. "All we've got to do is to
word the letter so that he will believe the money is really there, and
he will go after it, even if he knew that he would have to face all the
ghosts that ever haunted the Summerdale hills; and their name is
legion, if there is any faith to be put in the stories I have heard."
"I say, Tom," exclaimed Bob, throwing down his pen and settling-
back in his chair, "wouldn't it be a joke if some of those same ghosts
should take it into their heads to visit us during the winter? It must
be lonely up there in the mountains, when the roads are blocked
with drifts, and all communication with the outside world is cut off,
and wouldn't we feel funny if we should hear something go this way
some dark and stormy night—b-r-r-r?"
Here Bob uttered a hollow groan, drew his head down between his
shoulders, and tried to shiver and look frightened.
"No doubt it would; but we shan't hear anything go this way—b-r-r-
r," replied Tom, imitating Bob's groan as nearly as he could. "Now I
think you had better go on with that letter, and I will draw the map
that is to guide him in his search for the robbers' cave and plunder.
We've wasted a good hour and a half already; and if we don't hurry
up, we shan't be able to give him the letter to-day. Let me think a
moment! There's a deep gorge about a quarter of a mile from
Morgan's wood-pile, and I don't believe it has ever been explored.
That would be a good place to put the cave, wouldn't it?"
Bob said he thought it would, and went on with his writing, while
Tom hunted up a piece of paper and began drawing the map.
Bob pronounced it perfect when his friend presented it for his
inspection, and indeed it ought to have been. There was no one in
the neighborhood who was better acquainted with the hills than
Silas Morgan, and if the map had guided him to a place that really
had no existence, except in Tom's imagination, he would have
known in a minute that somebody was trying to play a trick upon
him.
The letter was finished at last, to the entire satisfaction of both the
boys, and the next thing was to put it where the man for whom it
was intended would be sure to find it.
Do you ask what it was that suggested to them the idea of making
the shiftless and ignorant ferryman the victim of one of their
practical jokes?
Simply an accident, coupled with the want of something to do, and
their innate propensity to get fun out of everything that came in
their way.
On the previous day they made it their business to stand guard over
the English partridges and quails which Uncle Hallet had "turned
down" in his wood-lot, and it so happened that they stopped to eat
their lunch within a short distance of Silas Morgan's wood-pile, but
out of sight of it. They heard the creaking of the ferryman's old
wagon, as his aged and infirm beast pulled it laboriously up the
steep mountain-side, and not long afterward the setters, which
accompanied Silas, wherever he went, spied out their resting-place.
But the animals did not give tongue, as they would no doubt have
done if the boys had been utter strangers to them. They thankfully
ate the bits of cracker and broiled squirrel that were tossed to them,
and then went back to wait for Silas.
"That man has no more right to those valuable dogs than I have,"
said Bob. "They're worth a hundred dollars apiece, and no one ever
gave a guide that much money in return for a single day's woodcock
shooting. Who is he talking to, I wonder?"
"To no one," answered Tom. "He likes to talk to a sensible man, and
he likes to hear a sensible man talk; consequently, he has a good
deal to say to Silas Morgan. That's the fellow he is talking to."
And so it proved. The ferryman was engaged in an animated
conversation with the ferryman, asking and answering the questions
himself, and so fully was his mind occupied with other matters, that
it never occurred to him that possibly his words might be falling
upon ears for which they were not intended.
Tom and his companion had no desire to play the part of
eavesdroppers. They were not at all interested in what Silas was
saying to himself—at least they thought so; but it turned out
otherwise.
Having finished their lunch, they began making preparations to set
out for home; but in the meantime Silas reached the wood-pile, and,
leaning heavily upon his wagon, he gave utterance to his thoughts in
much the same words as those we used at the beginning of this
story.
"I just know that I wasn't born to do no such mean work as I've
been called to do all my life," declared Silas, stooping over, and
throwing the perspiration from his forehead with his bent finger. "I
can't get my consent to slave and toil in this way much longer, while
there are folks all around me who never do a hand's turn. They can
loaf around and take their ease from morning till night, while I—wait
till I tell you. Such things ain't right, and I won't stand it much
longer. The other night I dreamed of that robber's cave, with piles of
gold and greenbacks into it, and yesterday I read about the finding
of that earthen crock that was plumb full of money; so't I know I
shall be a rich man some day. 'Pears to me that day isn't so very far
off, neither. If I should come up here some time and find a letter
telling me where there was a robber's cave with stacks and piles of
money in it, I shouldn't be at all astonished; would you?"
"Not in the least," whispered Bob, giving his friend a prod in the ribs
with his elbow; whereupon Tom laid his finger by the side of his
nose and winked first one eye and then the other, to show that he
fully understood Bob.
"Stranger things than that have happened," continued Silas, in a
voice that was plainly audible to the two boys behind the
evergreens, "and I don't see why it can't happen to me as well as to
anybody else. Wouldn't that be a joyful day to me, though? I'd bust
up that flat the very first thing I did, and tell the fellers that tooted
the horn that I was done being servant for them or anybody else.
No, I wouldn't do that, either," added Silas, after reflecting a minute.
"I'd give it to Dan and Joe to make a living with, and then I wouldn't
have to spend any of my fortune on their grub and clothes."
"What a stingy old hulks he is!" whispered Bob, as the ferryman took
a reluctant step toward the wood-pile. "I say, Tom, don't you think
there is a robber's cave about here somewhere? I should think there
ought to be, with so many ghosts hanging around. It don't look to
me as though they could be here for nothing."
"That's what I think," replied Tom, in the same cautious whisper. "I
shouldn't wonder a bit if there was a freebooter's stronghold
somewhere in these mountains."
"With lots of money in it?" continued Bob.
"Piles of it," said Tom. "As much as there is in the treasury at
Washington."
Bob turned toward his friend with a look of indignant astonishment
on his face.
"And you knew it all the time, and never told Silas about it!" he
exclaimed. "Can't you see how badly he wants it, and how confident
he is that he is going to get it? You ought to have attended to it long
ago."
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.
ebookname.com