Processing for Android: Create Mobile, Sensor-aware, and XR Applications Using Processing 2nd Edition Colubri download
Processing for Android: Create Mobile, Sensor-aware, and XR Applications Using Processing 2nd Edition Colubri download
https://ebookmeta.com/product/processing-for-android-create-
mobile-sensor-aware-and-xr-applications-using-processing-2nd-
edition-colubri/
https://ebookmeta.com/product/processing-for-android-create-
mobile-sensor-aware-and-xr-applications-using-processing-2nd-
edition-andres-colubri/
https://ebookmeta.com/product/corona-sdk-mobile-game-
development-2nd-edition-learn-explore-and-create-commercially-
successful-mobile-games-for-ios-and-android-michelle-m-fernandez/
https://ebookmeta.com/product/cambridge-igcse-and-o-level-
history-workbook-2c-depth-study-the-united-states-1919-41-2nd-
edition-benjamin-harrison/
https://ebookmeta.com/product/medical-surgical-nursing-concepts-
for-interprofessional-collaborative-care-10th-edition-donna-d-
ignatavicius/
Some Spanish American Poets Isaac Goldberg
https://ebookmeta.com/product/some-spanish-american-poets-isaac-
goldberg/
https://ebookmeta.com/product/ground-beef-cookbook-50-delicious-
ground-beef-recipes-2nd-edition-booksumo-press/
https://ebookmeta.com/product/iran-in-an-emerging-new-world-
order-from-ahmadinejad-to-rouhani-1st-edition-ali-fathollah-
nejad/
https://ebookmeta.com/product/midsummer-night-shifts-1st-edition-
various-authors/
CYBORG: Human and Machine Communication Paradigm
(Prospects in Smart Technologies) 1st Edition Kuldeep
Singh Kaswan
https://ebookmeta.com/product/cyborg-human-and-machine-
communication-paradigm-prospects-in-smart-technologies-1st-
edition-kuldeep-singh-kaswan/
Processing
for Android
Create Mobile, Sensor-aware, and XR
Applications Using Processing
—
Second Edition
—
Andrés Colubri
Processing for Android
Create Mobile, Sensor-aware, and XR
Applications Using Processing
Second Edition
Andrés Colubri
■
■Part I: First Steps with Processing for Android���������������������������������� 1
■
■Chapter 1: Getting Started with the Android Mode����������������������������������������������� 3
What Is the Processing Project?��������������������������������������������������������������������������������������� 3
The Processing Language���������������������������������������������������������������������������������������������������������������������� 3
The Processing Development Environment�������������������������������������������������������������������������������������������� 4
Extending Processing������������������������������������������������������������������������������������������������������� 6
The Contribution Manager���������������������������������������������������������������������������������������������������������������������� 7
Summary������������������������������������������������������������������������������������������������������������������������ 16
■
■Chapter 2: The Processing Language������������������������������������������������������������������ 17
A Programming Sketchbook for Artists and Designers�������������������������������������������������� 17
The Structure of a Processing Sketch���������������������������������������������������������������������������� 17
Summary������������������������������������������������������������������������������������������������������������������������ 51
■
■Part II: Drawing and Interaction������������������������������������������������������� 53
■
■Chapter 4: Drawing Graphics and Text���������������������������������������������������������������� 55
Drawing Shapes������������������������������������������������������������������������������������������������������������� 55
More Types of Shapes��������������������������������������������������������������������������������������������������������������������������� 55
Curve Shapes��������������������������������������������������������������������������������������������������������������������������������������� 58
Using Bézier Curves����������������������������������������������������������������������������������������������������������������������������� 60
Shape Attributes����������������������������������������������������������������������������������������������������������������������������������� 66
Shape Styles����������������������������������������������������������������������������������������������������������������������������������������� 67
vi
Drawing Images������������������������������������������������������������������������������������������������������������� 69
Drawing Text������������������������������������������������������������������������������������������������������������������� 70
Loading and Creating Fonts������������������������������������������������������������������������������������������������������������������ 70
Text Attributes��������������������������������������������������������������������������������������������������������������������������������������� 73
Scaling Text������������������������������������������������������������������������������������������������������������������������������������������ 73
Renderers in Processing������������������������������������������������������������������������������������������������ 75
The PShape Class����������������������������������������������������������������������������������������������������������� 76
Creating PShapes��������������������������������������������������������������������������������������������������������������������������������� 76
Loading Shapes from SVG�������������������������������������������������������������������������������������������������������������������� 79
Texturing Shapes���������������������������������������������������������������������������������������������������������������������������������� 81
Summary������������������������������������������������������������������������������������������������������������������������ 82
■
■Chapter 5: Touchscreen Interaction��������������������������������������������������������������������� 83
Touch Events in Android������������������������������������������������������������������������������������������������� 83
Basic Touch Events������������������������������������������������������������������������������������������������������������������������������� 83
Multi-touch Events������������������������������������������������������������������������������������������������������������������������������� 89
Touch-Based Interaction������������������������������������������������������������������������������������������������ 93
Item Selection��������������������������������������������������������������������������������������������������������������������������������������� 93
Scrolling����������������������������������������������������������������������������������������������������������������������������������������������� 95
Swipe and Pinch����������������������������������������������������������������������������������������������������������������������������������� 97
vii
Summary���������������������������������������������������������������������������������������������������������������������� 126
■
■Part III: Sensors������������������������������������������������������������������������������ 127
■
■Chapter 7: Reading Sensor Data������������������������������������������������������������������������ 129
Sensors in Android Devices������������������������������������������������������������������������������������������ 129
Accelerometer������������������������������������������������������������������������������������������������������������������������������������ 129
Gyroscope������������������������������������������������������������������������������������������������������������������������������������������� 130
Magnetometer������������������������������������������������������������������������������������������������������������������������������������ 130
Location���������������������������������������������������������������������������������������������������������������������������������������������� 130
viii
Summary���������������������������������������������������������������������������������������������������������������������� 162
■
■Chapter 9: Geolocation�������������������������������������������������������������������������������������� 163
Location Data in Android���������������������������������������������������������������������������������������������� 163
Using Location API in Processing��������������������������������������������������������������������������������� 164
Location Permissions������������������������������������������������������������������������������������������������������������������������� 165
Accessing Data from Multiple Threads����������������������������������������������������������������������������������������������� 167
Location with Ketai����������������������������������������������������������������������������������������������������������������������������� 171
Using Additional Location Data����������������������������������������������������������������������������������������������������������� 172
Summary���������������������������������������������������������������������������������������������������������������������� 182
■
■Part IV: Wearables and Watch Faces���������������������������������������������� 183
■
■Chapter 10: Wearable Devices��������������������������������������������������������������������������� 185
From Activity Trackers to Smartwatches���������������������������������������������������������������������� 185
Smartwatches������������������������������������������������������������������������������������������������������������������������������������ 186
Summary���������������������������������������������������������������������������������������������������������������������� 195
ix
■
■Chapter 11: Visualizing Time����������������������������������������������������������������������������� 197
From Sundials to Smartwatches���������������������������������������������������������������������������������� 197
Using Time to Control Motion������������������������������������������������������������������������������������������������������������� 198
Square vs. Round Watch Faces���������������������������������������������������������������������������������������������������������� 200
Summary���������������������������������������������������������������������������������������������������������������������� 209
■
■Chapter 12: Visualizing Physical Activity���������������������������������������������������������� 211
Body Sensors��������������������������������������������������������������������������������������������������������������� 211
Step Counter��������������������������������������������������������������������������������������������������������������������������������������� 211
Heart Rate������������������������������������������������������������������������������������������������������������������������������������������� 211
Summary���������������������������������������������������������������������������������������������������������������������� 235
■
■Part V: 3D and Shaders������������������������������������������������������������������� 237
■
■Chapter 13: 3D in Processing���������������������������������������������������������������������������� 239
The P3D Renderer�������������������������������������������������������������������������������������������������������� 239
Hello World in 3D�������������������������������������������������������������������������������������������������������������������������������� 239
Summary���������������������������������������������������������������������������������������������������������������������� 255
■
■Chapter 14: Lighting and Texturing������������������������������������������������������������������� 257
Making 3D Scenes more Realistic with Lights and Textures���������������������������������������� 257
Light Sources and Material Properties����������������������������������������������������������������������������������������������� 257
Texture Mapping��������������������������������������������������������������������������������������������������������������������������������� 261
xi
■
■Part VI: Extended Reality: VR and AR��������������������������������������������� 303
■
■Chapter 16: Basics of VR����������������������������������������������������������������������������������� 305
Brief History of VR�������������������������������������������������������������������������������������������������������� 305
Google Cardboard������������������������������������������������������������������������������������������������������������������������������� 305
Hardware Requirements��������������������������������������������������������������������������������������������������������������������� 306
VR in Processing���������������������������������������������������������������������������������������������������������� 306
Stereo Rendering�������������������������������������������������������������������������������������������������������������������������������� 307
Monoscopic Rendering����������������������������������������������������������������������������������������������������������������������� 309
VR Interaction��������������������������������������������������������������������������������������������������������������� 310
Eye and World Coordinates����������������������������������������������������������������������������������������������������������������� 311
The Line of Sight��������������������������������������������������������������������������������������������������������������������������������� 313
Selecting a Shape with Screen Coordinates��������������������������������������������������������������������������������������� 315
Bounding Box Selection���������������������������������������������������������������������������������������������������������������������� 318
Summary���������������������������������������������������������������������������������������������������������������������� 328
■
■Chapter 17: Basics of AR����������������������������������������������������������������������������������� 329
A Brief History of AR����������������������������������������������������������������������������������������������������� 329
AR on Android������������������������������������������������������������������������������������������������������������������������������������� 330
Requirements������������������������������������������������������������������������������������������������������������������������������������� 331
Getting Started����������������������������������������������������������������������������������������������������������������������������������� 331
Summary���������������������������������������������������������������������������������������������������������������������� 350
xii
■
■Chapter 18: Creating XR Experiences���������������������������������������������������������������� 351
Challenges with XR Apps���������������������������������������������������������������������������������������������� 351
Drawing in VR������������������������������������������������������������������������������������������������������������������������������������� 352
Initial Sketches����������������������������������������������������������������������������������������������������������������������������������� 353
Summary���������������������������������������������������������������������������������������������������������������������� 373
■
■Part VII: Appendixes����������������������������������������������������������������������� 375
■
■Chapter 19: Appendix A: Gradle and Android Studio Integration���������������������� 377
Google Tools for Android Development������������������������������������������������������������������������� 377
Exporting a Sketch As a Gradle Project������������������������������������������������������������������������ 379
Importing into Android Studio�������������������������������������������������������������������������������������� 380
Adding a Processing Sketch to a Layout���������������������������������������������������������������������� 384
■
■Chapter 20: Appendix B: Processing Libraries for Android������������������������������� 389
Extending Processing with Libraries���������������������������������������������������������������������������� 389
Installing Libraries with the Contribution Manager���������������������������������������������������������������������������� 389
Installing Libraries Manually�������������������������������������������������������������������������������������������������������������� 392
Index��������������������������������������������������������������������������������������������������������������������� 397
xiii
xv
xvii
“That’s all,” said Aunt Fanny. “What do you think of it, my merry
men and ladies? Will Philip Badboy Wiseman do for a beginning?”
“It’s perfectly splendid!” cried the children.
“And you don’t mean to eat greedily of flower-pot pudding after
this, or snap each other’s legs with knots in your pocket-
handkerchiefs?”
“Oh no, dear Aunt Fanny. This pop-gun has made us better
already. We mean to be ever so kind, industrious, and unselfish after
this.”
“I wish I had a kite like Johnny’s,” said Peter.
“Who knows, if you try to be a loving, obedient child, but what the
Honorable Mr. Kite may call upon you next spring, all ready for an
airing. I’ll have a talk with my friend Johnny about it.”
“Oh goody! will you?” cried Peter, jumping straight up and down in
the air. “My! how good I’ll be! I’m going to begin right away;” and he
sat down, solemn and stiff, twirling his thumbs one over the other,
and saying, “Look at me! Only see how good I am!” while the rest
laughed merrily at the joke.
Then Aunt Fanny had a kind kiss from all, and bade them good-
night.
The next time Aunt Fanny came she had a funny and rather
mischievous twinkle in her eyes. She did not say a word, while she
unfolded her manuscript but quietly read out the Pop-gun printed
above, and then said her story was called by the comical title of
THE DOG’S DINNER-PARTY.
The children looked at each other, wondering what was coming,
then fastened their eager eyes on the reader, who began as follows:
Once upon a time there lived a funny, bustling, little old
gentleman, who thought that dogs, horses, cats, and monkeys,
ought to live just as he did; that is, first and foremost, to behave
with perfect politeness, learn to read and write, sit at the table and
eat their meals with knives and forks, and sleep in French
bedsteads, all tucked up warm. He even insisted on their wearing
clothes and patent leather boots, and they ran clattering about the
house on their hind legs, with trousers and coats on, and their tails
dangling out behind, like a pocket handkerchief out of a pocket.
The little bustling old gentleman was a bachelor. He had tried
about twenty-nine times to get married, but the ladies, one and all,
insisted that the dogs, cats, and monkeys must be turned out of the
house, if they consented to come in, which was very disagreeable
and unreasonable, and made the old gentleman so mad, he said to
himself he would see them to Jericho first; so making each one in
turn a very low bow, for he was the very pink of politeness, he took
himself off, and that was the last of getting married.
So his family consisted of four fine dogs, six beautiful cats, eight
comical monkeys, one fat cook, and one fat coachman, two thin
housemaids, and nobody knows how many grooms and footmen—
and they all lived together, a great deal happier than Barnum’s
happy family, and what do you suppose was the reason? Why, they
were taught by the bustling little old gentleman to be perfectly
polite. I forgot to tell you that his name was Lord Chesterfield.
One day Beppo—one of the family—a handsome brown and white
spaniel, went out for a walk. As soon as he got out of sight of the
house, he dived into a bramble bush, and scratched off all his
clothes, for they plagued him to death, and he trotted joyously
along, whistling—
This was not exactly the right way to word it, but you see his
education was not yet completed.
Then the little bustling old gentleman wrote the rest of the notes;
for Beppo was rather slow, and ran his tongue out in the most
fearful manner, in his anxiety to spell the words right, and then they
were nicely sealed up in envelopes, and he put them all together in
a pretty little basket.
And now the coachman was ordered to bring out the state
carriage and four horses, and Beppo, sitting up inside on his hind-
legs, very grand, and no doubt exceedingly uncomfortable, carried
the notes of invitation to the most fashionable dogs of his
acquaintance.
Three of the dogs to be invited lived in the house, as you know;
but they had notes as well as the rest, for that is the way to be
perfectly polite. I dare say you have many a time heard people say
something like this—
“Oh, it don’t make any difference what there is for dinner when
you come, because we are so intimate; but I should be mortified to
death, not to have every thing nice when General Fusbos is invited,
as he is such a stranger.”
This is abominable manners—as if you ought not to treat those
you love far better than a stranger. It always makes me very
indignant when such a remark is made to me; and I sincerely hope
you will profit all your life by this hint about true politeness from our
friend Beppo.
You can’t have a great many at a dinner party, you know; so you
must be careful to invite the most agreeable people, and as many
ladies as gentlemen. Beppo knew this as well as you, and so you
may be sure he had taken great pains to have a pleasant party.
The next morning there were a great many people ringing at the
little bustling old gentleman’s door, and each one left a note.
Beppo ran into a corner with them, as fast as they arrived, and
read them in a great hurry. At last one came, very pretty, of a three-
cornered shape, and smelling of roses. The moment Beppo opened
it, and glanced at the contents, he danced around the room for joy,
waving the note in the air with one of his fore-paws. Then he rushed
up to his master, exclaiming—
“She’s coming! my Lord Chesterfield, she’s coming! Just fancy how
delightful to have her sweet face and golden curls among our hairy
muzzles! Oh, we must be very polite, and make her as happy as
possible.”
It was a lovely summer’s day. The sun turned the ripples of the
river into shifting gold, and there was singing, and buzzing, and
whispering, and laughing everywhere; all felt kind and loving. Even
the hideous old scarecrow in the cornfield allowed Beppo, in his joy,
to dash at him and playfully throw him down, bang! on his old red
nose, and he never once attempted to get up; for he said, in his
pine-wood heart—
“I’m a brute, after all, to frighten the poor birds out of their wits.
I’ll just lie down here and take a nap, and let the dear little things
have a good time for once.”
Oh, it was charming to see that even an old scarecrow could be
polite, which, after all, is only another name for loving-kindness.
Just before five o’clock, the nurse brought little Lucy, dressed in
blue, and looking like a fairy. Strange to say, although only four
years old, she was not in the least frightened, but put her soft white
arms around Beppo’s neck, and said, “Oh, I love oo, good dog!” and
hugged him so kindly, that he would have given all the world to have
had her tumble into the water again, so that he might save her life
once more.
The little bustling old gentleman took her by the hand, and
showed her all over his curious old house, with its suits of rusty
armor, great stag horns nailed to the walls, and queer black-looking
paintings; and Beppo followed wherever they went, gently wagging
his tail, and answering every question with admirable politeness.
And now all the dogs who had been invited had come, and were
sitting in the parlor waiting for the dinner-bell to ring, talking and
laughing as pleasantly and properly as the king, or the president, or
you, or I.
Of course, the first thing any one said, after “How-de-do?” was,
“It’s a fine day!” because that’s the solemn rule in all polite society.
Then, of course, they went on to say it was worse weather last
week, and would be better weather next week; and after about a
dozen more deeply interesting remarks upon the weather, the
dinner-bell rang, and made them all jump. But the very next instant
they sat down again, trying to look as if they were in no sort of
hurry, as it would have been very bad manners to rush pell-mell
down stairs. Everybody knows that.
First the little bustling Lord Chesterfield stepped out, leading Lucy
with the utmost consideration and politeness. Then Beppo made a
low bow to a very respectable old lady-mastiff, and begged the
honor of handing her into dinner, to which she graciously consented.
Then a very tall stag-hound, with an uncommonly sharp nose, paired
off with Flora, a beautiful pointer; while a large, grave, middle-aged
Newfoundland dog made himself agreeable to an Italian greyhound
of no particular age; at least she never liked to tell how old she was,
and almost always had the snuffles. Then a pert little black-and-tan
terrier skipped up to a coquettish King Charles, and said “would she
make him the happiest dog in the world?” upon which she shook her
silky ears, and putting her head on one side, and half shutting her
beautiful black eyes, lisped out “she would;” while a fat poodle,
invited because she was so exceedingly genteel, and a Skye terrier,
also used to the very best society, brought up the rear; and thus
they marched two and two, with the utmost propriety, into the
dining-room.
And now see this elegant party at the table. The little bustling old
gentleman at the foot, and Beppo, whose back is turned to you, at
the head, with Lucy at his right hand.
I forgot to tell you that our friend had requested a private
interview with my Lord Chesterfield, about an hour before dinner.
“Well, sir, what do you wish?” he asked.
“My dear master,” said Beppo, respectfully, “you know very well
that the dogs who will come to my dinner-party will none of them
have on coats or pantaloons, or hooped skirts. I do not wish to
mortify them, so please let me wear my natural suit for this once,
and only my gold collar.”
The little bustling old gentleman turned upon him with a look of
rage, enough to petrify a milestone.
“Is this your gratitude?” he roared, “when I am spending all my
days in teaching you to live and dress like a gentleman?”
Then, recollecting all of a sudden that he was setting a very bad
example of politeness, he put on a remarkably sweet expression,
and added in the mildest tone—
“Excuse me; I forgot myself. I believe—well—yes, upon the whole,
as this party is given in your honor, you may do as you please to-
day.”
“Bow, wow, wow!” barked Beppo, in a perfect ecstasy of delight,
and leaping with all four feet in the air. “Bow, w-o-w-w! Oh, my
goodness!” he continued, suddenly stopping; “I forgot myself, or
rather you, sir. Please to forgive me; I could not keep the bark in;
and it is utterly impossible to stop wagging my tail, I am so happy.”
“Ah! how short is life!” sighed Lord Chesterfield; “I am afraid I
shall die before my dogs, cats, and monkeys come to perfection!”
But you ought to have seen how elegantly they arranged
themselves at the table, bowing and smiling the whole blessed time.
It was something worth looking at, I can tell you—all sitting up as
fine as you please, five on each side. The waiters, who were rigged
out in regimentals, tied white napkins around their necks, at which, I
must confess, there was some snarling and a bark or so, and one or
two tried to wriggle out of them; but at a grave, severe look from
my Lord Chesterfield, they gave up with a low whine, which was
much better than could have been expected.
Beppo had a fine piece of beef to carve, and his master a pair of
roasted chickens; but all the rest of the dishes were pies of different
kinds of birds—pigeon-pie, snipe-pie, woodcock-pie, poll-parrot-pie,
owl-pie, cat-bird-pie, and booby-pie, for a booby is a bird as well as
a dunce.
Oh, my goodness! how they did want to dive into these delicious
pies with their paws. If they had dared, they would have behaved
exactly as most people do on board of steamboats, where they
pounce on all the dishes they can reach at once, and empty them
pell-mell on their plates. I have seen oysters, pie, roast beef, salt
fish, and ice cream, all mixed up on the same plate—a perfectly
horrible mess; and that was because these greedy people had not
the first idea of politeness or courtesy one to another, and the want
of it made them behave like pigs.
“Shall I help you to a slice of the chicken, madam?” said Lord
Chesterfield to Lucy.
“If you please,” said Lucy, with a pretty little bow and smile.
“What part do you prefer, madam?”
“I like the merry sort, if you please,” answered the dear little thing
—meaning the merry thought.
Now this was perfect good manners. Some people would have
said, “Any part—I’m not at all particular,” and would have been very
impolite, for then the carver would not be sure he should suit them;
so, when you are asked, always choose a part.
“Will you have chicken?” asked Lord Chesterfield of the
respectable old lady-mastiff.
“Oh, oh! give it to me! I want some,” squeaked out the little black-
and-tan terrier, quick as a flash, before the old mastiff could utter a
syllable.
What an awful look he got from the bustling little old gentleman!
and the mastiff faced round upon him with, “Sir, you’re a
disrespectful puppy,” and glared in a way to frighten him into fits;
while the stag-hound opposite stuck his sharp nose up in the air, and
remarked in a whisper to Flora, the beautiful pointer, that “really,
young America was getting too impudent for any thing.”
Beppo looked imploringly at his master to forgive little Snap this
time, as he was young and silly, and hastened to put a delicious cat-
bird, with crust and gravy, on his plate; and after this the dinner
went on splendidly, except that the greyhound of no particular age
kept her tongue waggling out of her mouth very nearly the whole
time, on account of the snuffles, which prevented her from breathing
freely. It was not very elegant conduct, but as she couldn’t help it,
nobody looked at her; and that, you’ll own, was the politest way of
behaving under the circumstances. The fat poodle and the Skye
terrier talked a little in French about it, to be sure, but as nobody
else understood what they said, and as they smiled all the time, the
rest took it for granted that they were admiring their neighbors, and
felt highly gratified.
Everybody ate and drank with all the decorum and delicacy of our
city aldermen, who ought to be held up as examples of courtesy,
honesty, and moderation, to the whole universe. They did not leave
so much as a bone on their plates; but I am sorry to say they were
in rather too much of a hurry at dessert, for most of them burned
their mouths severely with the hot cracker pudding, and Snap, the
black-and-tan terrier, declared that it must have been made of fire-
crackers.
But, take it all in all, it was a splendid entertainment; and, after it
was over, the ladies went back to the parlors, and talked about the
last fashions. “Ears were to be cut off closer than ever, for terriers,”
said the King Charles; and “red, white and blue collars were
considered rather old-timed,” was observed by the beautiful pointer;
“that is, unless the army did something decided at once, then they
would be the rage again immediately.” The gentlemen of course
talked of nothing but money, money, money, as men, the dogs!?
always do, when they get together, and if Lord Chesterfield had not
made the signal to move, they would have stayed there talking
about money to this day.
Lucy had taken the pretty little King Charles spaniel in her lap, and
they had a most delightful chat together, which ended in their
vowing everlasting friendship to each other, and promising to
exchange visits every day, for, as the King Charles was one of Lord
Chesterfield’s family, this could be very easily done.
When the gentlemen came up stairs, they had coffee, and then,
as it was getting dark, the little bustling old gentleman ordered the
gas to be lighted, and proposed some music. First, Lucy played “Old
Dog Tray,” with one little white finger on the piano, and then she
lisped out, in her sweet way, “I know a pretty ’tory.”
“Ah! tell it!” cried all the company, gathering gently round her, for
there was no pushing, or squealing—“Here, let me come in! don’t
crowd so!” No, indeed! for that would have been any thing but
polite. They all fastened their eyes on the lovely little girl, who stood
resting her arm on Beppo’s neck, so proud and happy to have it
there, and in her sweet voice, like a robin’s song, she began:
[1]
“The dew was falling fast, the stars began to blink,
I heard a voice—it said ‘Drink, pretty creature, drink!’ &c.”—
Wordsworth’s poem of the “Pet Lamb.”
“Oh! I tant say any more,” said Lucy. “What a pity!” and she bent
down her lovely golden head, and blushed.
“Oh yes, what a pity!” echoed all the company. “It was so sweet;
but we thank you very much for this; it was beautiful!”
“Will oo sing for me?” asked Lucy.
“Certainly,” they all cried with the utmost readiness; “our voices
are not very good, and will sound horridly after your sweet tones,
but you may be sure we shall do our best.”
They selected a hunting song with a chorus, and sure enough,
with the exception of the stag-hound, whose voice was melody itself,
you might have supposed it a compound of distressed rats, an old
pump-handle, ungreased cart-wheels, a poker on a tin pan, and the
spiritual rappers quarrelling together; for it was all squeal, howl,
whine, grunt, and groan, of the most dismal description; but as they
really tried with all their might and main to sing a good song,
everybody looked pleased, because they took the will for the deed,
and made the best of it. Do you observe that, my young friends?
Well, never curl your lips with contempt, or make fun of any honest,
kind-hearted effort to entertain you. Try to be pleased and thankful:
take the will for the deed, and, my word for it, you will find a
delicious glow come into your heart, and a lovely expression in your
eyes; all your ugly thoughts will fly away to the bottomless pit, and
you will find yourself really loving the one you meant to ridicule.
Presently there came one of those long, solemn pauses which will
take place, do your best, when you have company, and Lord
Chesterfield hastened to propose a game. As they were nearly all
young and frisky, with the truest politeness, he proposed a
frolicsome play, though he would much rather have had a sober talk
on politics himself. Mind this, if you have a little party, don’t insist on
doing what you like best, and taking all the prettiest and best things,
but study the wishes of your guests, and do what pleases them
most.
So Lord Chesterfield proposed the game of the “Family Coach,” to
assist their digestion, which was hailed with bounds of delight by all
except the old lady-mastiff, and the middle-aged Newfoundland dog,
who preferred to take a quiet chat together, which ended in a nap
on the sofa; but as they smiled and nodded to each other all the
same, the rest concluded they were only shutting their eyes, as very
sentimental people do when they talk, and so no offence was taken
at their sleeping before company, and the poor old things had a very
refreshing time of it.
The little bustling old gentleman appointed himself master of
ceremonies, and there not being dogs enough for a grand frolic,
introduced a few of the cats and monkeys; who were so enchanted
at the chance to come in, that they frisked, and danced, and made a
very narrow escape of screaming for joy and becoming perfectly
riotous with the fun of the thing; and that, you know, would not
have been polite.
I have a great mind to write down the way Lord Chesterfield made
them play this game. I think you will like to know. So here it is.
Usually, you must invent a story about the “Family Coach,” as you
play; but unless you are very bright and quick about it, there is not
much fun. The next time you have a little party, play this game as it
is set down here. I have never seen any written before, and I think,
if you use this story, you will have a real funny time.
In the first place, Lord Chesterfield gave them all a part or name,
which they must by no means forget, and the point is, that when
your name is called, you must get up instantly, twirl around quickly,
and sit down again; and when “Family Coach” is mentioned,
everybody in the play must get up instantly, twirl around quickly, and
sit down again.
There were little Lucy and twenty-eight dogs, cats, and monkeys
to play, and they each took one of these parts:
1. Off-leader
2. Near-leader }Horses.
3. Off-wheeler
4. Near-wheeler
5. Reins.
6. Traces.
7. Pole.
8. Whip.
9. Box.
10. Fore-axles.
11. Hind-axles.
12. Fore-wheels.
13. Hind-wheels.
14. Dog’s tail.
15. Lamps.
16. Foot-board.
17. Steps.
18. Windows.
19. Doors.
20. Linch-pin.
21. Hubs.
22. Spokes.
23. Springs.
24. Coachman.
25. Footman.
26. Old lady.
27. Fat poodle.
28. Coach-dog.
29. Blinders.
“Oh you funny, funny Aunt Fanny!” cried the children, laughing
heartily, “to make dogs and cats teach us politeness; who ever heard
of such a thing before?”
“That’s what I call pretty sharp shooting,” said Fred.
“And the shot must have gone through and through you,”
observed Kitty, quietly. “You remember how you pulled my chair
from under me just as I was going to sit upon it yesterday, and
made me come down bang on the floor.”
“Yes, and you shook the room so, I thought it would crack the
looking-glass; and then you looked round so astonished and silly, I
almost died laughing.”
“Oh, Fred!” exclaimed Aunt Fanny; “is it possible you were so
rude? If I were an absolute monarch, I would condemn you to be
upset once a day for a week in exactly the same manner. I am a
great believer in the kind of punishment the boys call ‘tit for tat.’ If a
boy should cut the string of your kite, I should cut the strings of all
his kites for a whole season, explaining every time—‘That’s for
punishment, my fine friend. I don’t think you’ll cut another boy’s
kite-string in a hurry.’”
Fred turned very red; but, standing up, he said pleasantly, “Here,
Kitty, come and upset me.”
She ran behind his chair, but he did not think she would play this
trick before company, and he turned quickly, with such perfect
confidence, as she snatched the chair away, that he came down with
a most tremendous thump! which made the very windows rattle,
amid the shouts and laughter of the rest.
“How do you like it?” asked Aunt Fanny, quietly.
“Not much,” said Fred, grinning in rather a rueful manner. “I’m
cured, though. I don’t think I shall upset anybody again; and just let
them try it on me—that’s all.”
At this they all laughed harder than ever, and declared that Aunt
Fanny’s rule for punishment was the very “best they had ever heard
of.
“But do you not see, my darlings,” she said, seriously, “that it only
proves the glorious wisdom of Our Saviour’s golden rule? Whenever
you are tempted to play a trick, or say a sharp thing, just stop one
moment, and ask yourself, ‘Would I like to have this done or said to
me?’ If you ask yourself this question honestly, the little monitor
which God has placed in all your hearts, will answer you so faithfully
and kindly, that you would be very naughty children not to listen to
its whisperings.
“And now let me tell you the true definition of politeness. It is ‘real
kindness kindly expressed.’ Don’t forget this. Put this definition in
your pop-guns, and fire it off as often as you can, and, my word for
it, everybody you shoot will come to love you dearly. For my part, I
should like to dine off such shots, red-hot, every day of my life. And
so good night, little Pop-gun youngsters, and pleasant dreams to you
all.”
“Ah, dear Aunt Fanny! please stay a little minute longer,” cried all
the children, running to kiss her. “It’s so very early.”
“Well, I believe I will stay just long enough to ask your advice
about something.”
“Oh dear, yes! Ask away. We love to give advice.” And the six
children immediately tried to look as wise as twelve large owls, or as
Governor Wise of Virginia, who, they said, kept it all in his name,
and nowhere else; while Aunt Fanny, with a very grave face,
proceeded to observe—
“This story finishes the first volume of ‘Pop-Guns.’ Do you think it
will do to go with ‘Nightcaps’ and the rest? or do you advise me to
burn it up?”
“Burn it up!” screamed the children, running again to her and
kissing her. “No, no, no; pray, don’t. Have them printed, and we will
read them twenty times, and play the ‘Family Coach’ too! Let’s play
Family Coach now.”
And so they did; though, as there were only ten of them, Sophie
had to be all the four horses, Kitty the coachman, footman, and old
lady; while mamma, papa, Aunt Fanny, and the rest, were all sorts of
things at once. But they had great fun, and were perfectly wornout
with laughing, particularly when little Bob had to twirl round, which
he always did in such a desperate hurry, that he tumbled over his
own legs, and upset himself every time.
And, after that, the forfeits were enchanting; for Aunt Fanny knew
a great many funny ones; and Fred said he did “wish Aunt Fanny
was a ‘real true child,’ so they could have her to play with them the
whole time;” which speech, she declared, was the very finest
compliment she had ever received; and Uncle Fanny (that’s Aunt
Fanny’s husband) said—
“Well, Peter, I always said you were about six months younger
than either of your children, and now I am surer of it than ever.”
“What makes Uncle Fanny call her ‘Peter?’” whispered Kitty to Lou.
“He always does it. He did it in one of the ‘Mitten’ books.”
“Because he thinks it teases me,” said Aunt Fanny, whose ears are
very sharp, and heard the whisper.
“Why, Peteretta! does it tease you?” said Uncle Fanny.
“There! he is at it, worse than ever: let’s all go and shake him,”
cried Aunt Fanny.
The six children rushed at him pell-mell—and he got a splendid
shaking—little Bob squeezing one knee and tickling him almost to
death; Peter the other, while the rest of the children shook him just
where they could get at him.
“Ah! he’s sorry,” cried Kitty, in a sweet, coaxing voice; “hear how
he sighs!”
Sure enough, Uncle Fanny was sighing, because he could not
laugh any more, he had got so weak; but he caught at dear little
Kitty’s comforting word, and gasped out, “Oh yes, I’m sorry, dreadful
sorry—I’ll never call Peter Aunt Fanny again—I mean, Aunt Peter,
Fannyretta—I mean—oh, Peter!! I will be good!”
Aunt Fanny had given his ear a good pinch, and the children
laughed harder than ever, to see him holding up his hands, and
pretending to be afraid of a little woman about half his size, and
they were just going to shake him again, when he ran for his life,
and, getting out on the front stoop, declared he would not come into
the house again.
So they had to let Aunt Fanny go to him, after she had promised
not to be long before she fired off another pop-gun at them.
And they promised her to be always kind and good to their little
companions, and make the very best use of their time—as Philip
Wiseman did at last—and to “practise true politeness” everywhere,
and towards everybody, like Beppo and his friends.
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.