The Essential Guide to HTML5 Using Games to learn HTML5 and JavaScript 1st Edition Jeanine Meyer 2024 scribd download
The Essential Guide to HTML5 Using Games to learn HTML5 and JavaScript 1st Edition Jeanine Meyer 2024 scribd download
com
https://ebookname.com/product/the-essential-guide-to-
html5-using-games-to-learn-html5-and-javascript-1st-edition-
jeanine-meyer/
OR CLICK BUTTON
DOWNLOAD EBOOK
https://ebookname.com/product/phaser-game-prototyping-
building-100s-of-games-using-html5-phaser-js-gaming-frameworks-6th-
edition/
ebookname.com
https://ebookname.com/product/foundation-html5-canvas-for-games-and-
entertainment-1st-edition-rob-hawkes/
ebookname.com
https://ebookname.com/product/underground-infrastructure-of-urban-
areas-3-cezary-madryas/
ebookname.com
Engineering Economy 16th Edition William G. Sullivan
https://ebookname.com/product/engineering-economy-16th-edition-
william-g-sullivan/
ebookname.com
https://ebookname.com/product/teach-yourself-visually-mac-os-x-lion-
teach-yourself-visually-1st-edition-paul-mcfedries/
ebookname.com
https://ebookname.com/product/integrative-treatment-for-adult-adhd-
practical-easy-to-use-guide-for-clinicians-1st-edition-ari-tuckman/
ebookname.com
https://ebookname.com/product/handbook-of-mathematical-formulas-and-
integrals-4th-ed-edition-alan-jeffrey/
ebookname.com
Algebra I Quick Review 2nd Edition Cliffs Notes Jerry
Bobrow (Author)
https://ebookname.com/product/algebra-i-quick-review-2nd-edition-
cliffs-notes-jerry-bobrow-author/
ebookname.com
HTML5
Using Games to Learn HTML5 and JavaScript
CONTENTS
Jeanine Meyer
i
CONTENTS
The Essential Guide to HTML5: Using
Games to Learn HTML5 and JavaScript
Copyright © 2010 by Jeanine Meyer
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or
mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written
permission of the copyright owner and the publisher.
ISBN-13 (pbk): 978-1-4302-3383-1
ISBN-13 (electronic): 978-1-4302-3384-8
The source code for this book is freely available to readers at www.friendsofed.com in the Downloads section.
Credits
President and Publisher: Coordinating Editor:
Paul Manning Debra Kelly
Lead Editor: Copy Editor:
Ben Renow-Clarke Sharon Terdeman
Technical Reviewer: Compositor:
Cheridan Kerr Bronkella Publishing
Editorial Board: Indexer:
Clay Andres, Steve Anglin, Mark Beckner, Brenda Miller
Ewan Buckingham, Gary Cornell,
Jonathan Gennick, Jonathan Hassell, Artist:
Michelle Lowman, Matthew Moodie, April Milne
Duncan Parkes, Jeffrey Pepper,
Frank Pohlmann, Douglas Pundick, Cover Artist;
Corné van Dooren
Ben Renow-Clarke, Dominic Shakeshaft,
Matt Wade, Tom Welsh Cover Designer:
Anna Ishchenko
CONTENTS
To Daniel, Aviva, Anne, Esther, and Joseph, who is still in our lives, and for the newest members of
the family: Allison, Liam, and Grant.
iii
CONTENTS
Contents at a Glance
Contents at a Glance................................................................................................ iv
Contents..................................................................................................................... v
About the Author ...................................................................................................... x
About the Technical Reviewer ............................................................................... xi
Acknowledgments ................................................................................................... xii
Introduction ............................................................................................................ xiii
Chapter 1: The Basics ............................................................................................... 1
Chapter 2: Dice Game ............................................................................................. 21
Chapter 3: Bouncing Ball ........................................................................................ 67
Chapter 4: Cannonball and Slingshot ..................................................................... 97
Chapter 5: The Memory (aka Concentration) Game ............................................ 141
Chapter 6: Quiz...................................................................................................... 179
Chapter 7: Mazes ................................................................................................... 213
Chapter 8: Rock, Paper, Scissors ........................................................................ 259
Chapter 9: Hangman .............................................................................................. 287
Chapter 10: Blackjack............................................................................................ 317
Index ....................................................................................................................... 347
iv
CONTENTS
Contents
Contents at a Glance................................................................................................ iv
Contents..................................................................................................................... v
About the Author ...................................................................................................... x
About the Technical Reviewer ............................................................................... xi
Acknowledgments ................................................................................................... xii
Introduction ............................................................................................................ xiii
Chapter 1: The Basics ............................................................................................... 1
Introduction .....................................................................................................................................................1
Critical requirements .......................................................................................................................................3
HTML5, CSS, and JavaScript features ..........................................................................................................4
Basic HTML structure and tags ..................................................................................................................4
JavaScript programming ...........................................................................................................................10
Building the application and making it your own ..........................................................................................11
Testing and uploading the application..........................................................................................................19
Summary ........................................................................................................................................................19
Chapter 2: Dice Game ............................................................................................. 21
Introduction ...................................................................................................................................................21
Critical requirements .....................................................................................................................................24
HTML5, CSS, and JavaScript features ........................................................................................................24
Pseudo-random processing and mathematical expressions..................................................................24
Variables and assignment statements .....................................................................................................25
Programmer-defined functions .................................................................................................................26
Conditional statements: if and switch ......................................................................................................27
Drawing on the canvas ..............................................................................................................................29
Building the application and making it your own ..........................................................................................38
Throwing a single die .................................................................................................................................40
Throwing two dice ......................................................................................................................................47
The complete game of craps .....................................................................................................................55
v
CONTENTS
vi
CONTENTS
vii
CONTENTS
viii
CONTENTS
ix
CONTENTS
For Jeanine, programming is both a hobby and a vocation. Every day she plays
computer puzzles online (set game, kakuru, hashi, hitori and—often, still—tetris), and she does the
crossword puzzle and ken ken in the newspaper (by hand and in ink—its easier that way). She enjoys
cooking, baking, eating, gardening, travel, and a moderate amount of walking. She greatly enjoys listening
to her mother play piano and occasionally plays the flute. She is an active volunteer for progressive
causes and candidates.
x
CONTENTS
Cheridan Kerr has been involved in Web Development and Design since 1997 when she began working in
a research team for the Y2K Millennium Bug. It was here she learned about the Internet and promptly fell in
love with the medium. In her career she has been responsible for web sites in the early 00s such as Weight
Watchers Australia and Quicken.com.au, and she worked as Creative Services Manager of Yahoo!7 in
Australia on clients such as Toyota, 20th Century Fox, and Ford. Currently she is working as Head of
Digital for an Australian advertising agency.
xi
CONTENTS
Acknowledgments
Much appreciation to my students and colleagues at Purchase College/State University of New York for
their inspiration, stimulation, and support.
Thanks to the crew at friends of ED: Ben Renow-Clarke, who encouraged me even before I quite grasped
the idea of writing this book; Debra Kelly, who is an excellent project manager—which I needed; Cheridan
Kerr, the technical reviewer, who provided important suggestions; and the art manager and many others I
don't know by name.
And lastly, thanks to you, the reader. I am confident you can build on these ideas to make wonderful web
sites.
xii
CONTENTS
Introduction
Theres been considerable enthusiasm about the new capabilities of HTML5, and even suggestions that
no other technologies or products are necessary to produce dynamic, engrossing, interactive web sites.
That may be overstating things, but it is true the new features are exciting. It now is possible, using just
HTML5, Cascading Style Sheets, and JavaScript, to draw lines, arcs, circles and ovals on the screen and
specify events and event handling to produce animation and respond to user actions. You can include
video and audio on your web site with standard controls, or place the video or audio in your application
exactly when needed. You can create forms that validate the input and provide immediate feedback to
users. You can use a facility similar to cookies to store information on the client computer. And you can
use new elements, such as header and footer, to help structure your documents.
This book is based on my teaching practices and past writings. Delving into the features of a technology
or general programming concepts is best done when there is a need. Games, especially familiar and
simple ones, supply the need and thus the motivation and much of the explanation. When learning a new
programming language, my first step is to program the game of craps. If I can build a ballistics simulation
with animation, such as the slingshot game, and make a video or audio clip play when a specific condition
occurs, I am happy. If I can construct my own maze of walls, draw a stick figure for hangman, and store
information on the player's computer, I am ecstatic. And thats what we do in this book. As you see how to
build these simple games, youll build your expertise as well.
This goal of this book, developed with considerable help from the friends of ED staff and the technical
reviewer, is to prepare you to produce your own web sites, including games and other dynamic
applications, with a gentle introduction to the essentials of HTML5 and programming.
At the time of writing this book, not all browsers support all the HTML5 features. The applications have
been tested using Chrome, FireFox, and Safari.
xiii
Exploring the Variety of Random
Documents with Different Content
desire, but it showed that associations of pleasure had been formed
with the lap, and that she felt a vague discomfort in the absence of
these.
Just before she was a month old came an advance in hearing. So far
this sense had remained little more than a capacity for being startled
or made restless by harsh sounds. I had tested it on the twenty-third
day, and found that the baby scarcely noticed the sound of an
ordinary call bell unless it was struck within about six inches of her
ear, and suddenly and sharply at that; and on the twenty-sixth day
she showed no sign of hearing single notes of the piano, struck close
to her, from the highest to the lowest. But the next day, at the sound
of chords, strongly struck, she hushed when fretting with hunger, and
listened quietly for five minutes—her first pleasant experience
through the sense of hearing.
In the following days she would lie and take in the sound of the
chords with a look of content, staring at the same time into the face
of the person who held her, as if she associated the sound with that.
Only a few days later, when she was a month old, I thought that her
pleasure in companionship was increased if she was talked and
crooned to; and it is likely that by this time, though she had not
hitherto noticed voices, she was beginning to get them associated
with the human face—probably to the enhancement of its charm.
There were signs now, too, that touch sensations, in their principal
seat, the lips, were becoming a source of pleasure. The first smile
that I could conscientiously record occurred the day before the baby
was a month old, and it was provoked by the touch of a finger on her
lip; and a day or two later she smiled repeatedly at touches on her
lip. The day before she was a month old, also, when her lips were
brought up to the nipple, she laid hold upon it with them—the first
seizing of any sort, for her hands were still in their original
helplessness, waving vaguely about at the will of the nerve currents.
It is plain that the eyes led in the development of the psychic life. Yet
the baby was still far from real seeing. Professor Preyer believes that
there is at this stage no “accommodation” of the eyes to near and far,
although they can now be focused for right and left: that is, both
yellow spots can be brought to bear in unison on an object, but the
lenses do not yet adjust themselves to different distances. Though
the baby may have perceived direction, then, she could not have
perceived depth in space. It was only when an object chanced to be
at the distance for which her eyes were naturally adjusted that she
could have seen it clearly.
Nor is it likely that even then she saw anything as a definite outline,
but only as an undefined patch. The spot of clear vision in our eyes
is very small (a twenty-five cent piece would cover all the letters I
can take in at once on this page, if I do not let my eyes move in the
least), and the only way we ourselves see anything in definite outline
is by running our eyes swiftly over its surface and around its edges,
with long trained and unconscious skill. The baby had not yet
learned to do this. Her world of vision, much as it pleased her, was
still only patches of light and dark, with bits of glitter and motion. She
could turn her eyes and lift her head a little to make the vision
clearer; but except about her neck, eyes, and in a slight degree her
lips, she had no control of her body. She had gained much in
grouping and associating together her experiences, yet on the whole
she still lived among disjointed impressions.
In the light of such interpretations, the speculative attempts to
arrange a system of cradle education become futile. What can a
swinging ball do for a pupil whose sense apparatus is not yet in
condition to see the outline of the ball definitely? Froebel himself
could not have been expected to know much of the condition of a
baby’s sense apparatus; but modern Froebelians would be better
apostles of his almost Messianic inspiration if they were willing to
throw frankly aside his unfounded speculations and his obsolete
science. The letter killeth, but the spirit giveth life.
Meanwhile, nature has provided an educational appliance almost
ideally adapted to the child’s sense condition, in the mother’s face,
hovering close above him, smiling, laughing, nodding, with all
manner of delightful changes in the high lights; in the thousand little
meaningless caressing sounds, the singing, talking, calling, that
proceed from it; the patting, cuddling, lifting, and all the ministrations
that the baby feels while gazing at it, and associates with it, till finally
they group together and round out into the idea of his mother as a
whole.
Our baby’s mother rather resented the idea of being to her baby only
a collection of detached phenomena, instead of a mamma; but the
more you think of it the more flattering it is to be thus, as it were,
dissolved into your elements and incorporated item by item into the
very foundations of your baby’s mental life. Herein is hinted much of
the philosophy of personality; and Professor Baldwin has written a
solid book, mainly to show from the development of babies and little
children that all other people are part of each of us, and each of us is
part of all other people, and so there is really no separate
personality, but we are all one spirit, if we did but know it.
V
BEGINNINGS OF EMOTION AND PROGRESS IN
SENSE POWERS
The baby entered on her second month well content with her
fragmentary little world of glancing lights and shining surfaces,
chords and voices, disconnected touches and motions. Her smiles
began to be frequent and jolly. It was always at faces that she smiled
now: nothing else seemed half as entertaining. The way in which a
baby, in these early weeks, gazes and gazes up into one’s face, and
smiles genially at it, wiles the very heart out of one; but the baby
means little enough by it.
In this fortnight her pleasures were enlarged by introduction to a
baby carriage. The outdoor sights and sounds were of course
wasted on her at this stage of her seeing and hearing powers; but
she liked the feeling of the motion, and lay and enjoyed it with a
tranquilly beatific look. Perhaps also the fresher air and larger light
sent some dim wave of pleasant feeling through her body.
Some days earlier, when carried out in arms for her first outdoor visit,
she had found the light dazzling, and kept her eyes tight shut. In all I
have said of babies’ pleasure in light, I have meant moderate light:
the little eyes are easily hurt by a glare. There are nursemaids, and
even mothers, who will wheel a baby along the street with the sun
blazing full in his face, and who will keep a light burning all night for
their own convenience in tending him; and in later years his
schoolbooks will get the credit of having weakened his eyes. Nature
protects the little one somewhat at the outset, for at first the eyes
open by a narrow slit, which admits but scanty light: our baby was
just beginning, at a month old, to open her eyes like other folk.
Pleased though the baby was with her new powers, her life at this
period was not all of placid content. Ambition had entered in. It had
already seemed as if the mechanical lifting of the head was passing
into real effort to raise it; and day by day the intention grew clearer,
and the head was held up better. Now, too, appeared the first sign of
control over the legs. Laid on her face on the lounge, the baby did
not cry, but turned her head sidewise and freed her face, and at the
same time propped her body with her knees. This was on the first
day of the month. A few days later she was propping herself with her
knees in the bath every day.
With increase of joy and power came also the beginning of tears.
This, too, was on the first day of the month. The tears were shed
because she had waked and cried some time without being heard.
When she was at last taken up, her eyes were quite wet. As every
nurse knows, wee babies do not cry tears. When they do, it does not
mean that any higher emotional level has been gained, only that the
tear glands have begun to act. Nor have I any reason to suppose
that in this case the baby felt fear at being left alone. It was simply
that she was uncomfortable, and needed attention; and the attention
delaying, the discomfort mounted, till it provoked stronger and
stronger reflex expressions.
The first fright did occur, however, a few days later in the same
week; but it was in a much more primitive form than fear of solitude.
The baby was lying half asleep on my lap when her tin bath was
brought in and set down rather roughly, so that the handles clashed
on the sides. At this she started violently, with a cry so sharp that it
brought her grandfather anxiously in from two rooms’ distance; she
put up her lip at the same time, with the regular crying grimace
known to every nursery,—the first time she had done this,—and it
was fully five minutes before her face was tranquil again.
There had been reflex starting at sounds from the first week, and
Professor Preyer calls this an expression of fright; but to me (and
Professor Sully regards it in the same way) it seemed purely
mechanical. Our baby would even start and cry out in her sleep at a
sound without waking. But now there was clearly something more
than reflex starting. It was not yet true fear, for fear means a sense of
danger, an idea of coming harm, and the baby could have had no
such idea. But there was some element of emotion to be seen, akin
to fear; and (if we regard pleasure and pain as psychologists are
disposed to do, not as emotions in themselves, but only as a quality
of agreeableness or disagreeableness in our feelings) here was the
first dawn of any emotion. Fright, that was but a step above mere
physical shock, led the way into the emotional life.
This probably gives a true hint of the history of emotional
development in the race: for in the animal world, too, fear appears
earliest of all the emotions, and in the simplest forms of fright is
hardly to be distinguished from mere reflex action; and it is caused
oftener by sound than by anything else. When we remember the
theory that hearing is developed from the more ancient motion
sense, we are tempted to trace the origin of fright still farther back, to
the very primitive reflex sensibility to jarring movement, of which I
have spoken before.
And now the baby had come to six weeks old, and could hold up her
head perfectly for a quarter of a minute at a time, and liked greatly to
be held erect or in sitting position. Apparently all this was for the
sake of seeing better, for her joys still centred in her eyes. She had
made no advance in visual power, however, except that within a few
days she could follow with her eyes the motion of a person passing
near her.
Human faces were still the most entertaining of all objects. She
gazed at them with her utmost look of intentness, making
movements with her hands, and panting in short, audible breaths.
Nothing else had ever excited her so, except once a spot of sunlight
on her white bed.
There were signs that her experiences gathered more and more into
groups in her mind, by association. I have spoken of her earlier
association between the nursing position and being fed; now she
would check her hungry crying as soon as she felt herself lifted; and
a few days later, as soon as her mouth was washed out—a
ceremony that invariably came before nursing. At seven weeks old
she opened her mouth for the nipple on being laid in the proper
position. The food association group was enlarging; but sight did not
yet enter into it: the look of the breast did not seem to bring the
faintest suggestion of satisfied hunger, and the baby would lie and
cry with her lips an inch from it. This is natural, for she could never
really have seen it at this stage of the development of vision.
I have said that in such associations there is a germ of memory.
There is a sort of habit memory, too, that appears very early.
Impressions that have been received over and over gather a sort of
familiarity in the baby’s mind; and while he does not yet recognize
the familiar things themselves, yet he feels a change from them as
something strange—it jars somehow the even current of his feelings.
Or where impressions have been especially agreeable, they are
vaguely missed when they are absent. The consciousness of
difference between society and solitude, which our baby had showed
at the end of the first month, was habit memory of this sort.
Professor Preyer thinks that his baby showed habit memory as early
as the first week, perceiving a new food to be different from the old.
Our baby (who knew no food but mother’s milk) experienced a new
taste once or twice, when dosed for colic, and never showed the
faintest sense of novelty at it till she was six weeks old. Then she
was given a little sugar for hiccoughs, and made a face of what
seemed high disgust over it; but this particular face has been
observed more than once, and is known to be common in babies at
a new taste, even a pleasant one. It seems to be caused by a sort of
surprise affecting the face muscles.
A few days later the baby showed surprise more plainly. She lay
making cheerful little sounds, and suddenly, by some new
combination of the vocal organs, a small, high crow came out—
doubtless causing a most novel sensation in the little throat, not to
speak of the odd sound. The baby fell silent instantly, and a ludicrous
look of astonishment overspread her face. Here was not only
evidence of the germs of memory, but also the appearance of a new
emotion, that of genuine surprise; and, like fright, it is one that is
closely related to simple nerve shock. From being startled to being
surprised (as to being frightened) is not a long step.
I have just spoken of the baby as making little sounds. This was a
new accomplishment. Until a few days before, she had made no
sounds except some inarticulate fretting noises, the occasional short
outcry when startled, and the “dismal and monotonous” cry that
began with the first day. This original cry was clearly on the vowel â
(as in fair), with a nasal prefix—ngâ; but late in the sixth week it
began to be varied a little. In the fretting, too, a few syllables
appeared. The new sounds were mostly made in the open throat,
and grew out of the old ngâ by slight changes in the position of the
vocal organs—ng, and hng, and hng-â; but now and then there was
a short wă, gă, or hă, or even a lip sound, as m-bă.
It has been said that the broad Italian ä is of all sounds the easiest,
the one naturally made from an open throat: but the records show
both German and American babies beginning with the flat â or
shorter ă. Our baby scarcely used any other vowel sound for weeks
yet.
Little sounds of content, too, began in the sixth week—mainly
inarticulate grunts and cooing murmurs; but in the course of the
seventh week, besides the sudden crow, there were a few tiny
shouts,—a-a-ha,—a gurgle, and some hard g sounds, ga, and g-g-g,
which passed in the eighth week into a roughened gh, a sort of
scraping, gargling sound, not in the English language.
Our baby had a leaning to throat sounds; but other babies begin with
the lip sounds, and some, it is said, with the trilling l and r. It seems
to be only chance what position of the vocal organs is first used; but
after once beginning to articulate, the baby seems to pass from
sound to sound by slight changes (probably made accidentally in
using the old sounds), and so goes through the list with some
regularity.
This practice in sounds may be at first quite without will, a mere
overflow of energy into the vocal organs; but it is highly important
none the less, for any creature that is to use human speech must get
the speaking muscles into most delicate training. Think what fine and
exact difference in muscular contractions we must make to be able
to say “ball,” and be sure that it will not come out “pall”!
For a week or two now the baby made a good deal of progress in
control of her body. She strove valiantly every day to keep her head
erect, and made some little advance. In the bath she began to push
with her feet against the foot of the tub, so hard that her mother
could not keep the little head from bumping on the other end. She
pulled downward with her arms when her mother held them up in
wiping her. These pushing and pulling movements may have been
made for the pleasure of the feeling, or they may have been
involuntary. Perhaps they were accidental movements, passing
gradually into voluntary ones. In either case, as they developed, the
old irregular movements of legs and arms passed away, as those of
the head and face had done before.
One new bit of muscular control was undoubtedly voluntary—a trick
of putting out and drawing back the tip of her tongue between her
pursed lips. And this was something more than just one new
voluntary movement. The important thing was that she was using the
movement to bring together the evidence of two different senses into
one perception.
When something touches against our fingers, we have one sort of
feeling in them, and quite another when we pass them over the thing
and “feel of it;” and this other, clearer feeling is really a compound
one, made up of the touch sensation in the skin and the muscle
sensation in the moving fingers. It is called “active touch,” and it is a
wonderful key to the world around us—so wonderful that with this
alone it proved possible to educate Laura Bridgman and Helen
Keller. This active touch the baby had now developed in tongue and
lips; not yet in the fingers.
The passive sensation of light had already been blended with muscle
sensation in something the same way, by the voluntary movement of
turning and focusing the eyes; but that complete seeing which we
might call “active sight” is a more complex power than active feeling,
and there were other associations yet to be made before it could be
fully built up. And I hope it will not spoil the interest of the story of the
baby’s sense development if I say here that the plot is going to turn
mainly on these two combinations, muscle sense with sight and
muscle sense with touch; and then recombination of these two with
each other—all welded together by voluntary movements, growing
out of involuntary ones.
All this time the baby had had a daily source of placid pleasure in
listening to chords on the piano—no longer heavy staccato chords,
but flowing ones, in the middle octaves. The baby of theory cares for
nothing but eating and sleeping; but our baby, even after she was
already fretting with hunger, would forget all about it for ten minutes,
if one would take her to the piano. Hunger, after it grew really strong,
was a sensation that swept all before it; but on the whole, food was a
matter of small interest compared with the world of light and touch
and sound.
As for sleep, the baby slept, from the first, in pretty long periods,—six
and seven hours was not uncommon,—and was wide awake
between sleeps. At such times she would lie by the half hour, looking
peacefully about her, or gazing into our faces with smiles. When we
nodded, laughed, and talked to her, her smiles seemed like friendly
responses; but this could have meant nothing, except that with our
demonstrations those little constellations of high lights and glitters,
our faces, bobbed and twinkled in a more amusing manner than
ever.
At eight weeks old came the final stage in mastery of the mechanism
of vision—the power of accommodation, or adjusting the lenses for
different distances. It may have been present even earlier: it is a
hard thing for the observer to know. But the indications are that it
really did happen when I thought, the day the baby was eight weeks
old. She was lying on her mother’s knees, fixing an unusually serious
and attentive gaze on my face, and would not take her eyes away;
indeed, as her mother turned her in undressing, she screwed her
head around comically to keep her eyes fixed. At last, after some
fifteen minutes, she turned her head clear over, and gazed as
earnestly at her mother’s face. To see what she would do, her
mother turned her again toward me, and once more she surveyed
me for a time, and again turned her head and looked directly at her
mother.
What was in the little mind? Was she beginning to discriminate and
compare, for the first time setting apart as two separate things the
two faces that had bent over her oftenest? Or was she simply using,
on the most convenient object, a new power of adjusting her eyes,
which filled her with serious interest by the new clearness it gave to
what she saw? At all events, she would not have looked from one to
the other with such long and attentive regard if she had not been
able to focus both faces, at their different distances; so that I felt sure
the power of accommodation was really there.
But there was more in the incident than just the advance in vision.
Hitherto when the baby had turned her head to look, it had been only
at something that she had already a glimpse of, off at the edge of the
field of vision. Now she turned to look for something quite out of
sight,—something, therefore, that must have been present as an
idea in the little mind, or she could not have looked for it. And in view
of what I have said of the mother’s face as the great educational
appliance in the early months, it is worth noticing that it was this
which gave the baby her first idea, so far as I could detect.
We come a step nearer, too, to true memory, when the baby can
keep thus, even for a few minutes, the idea of something formerly
seen. It was still mainly habit memory, however. She looked for an
accustomed sight in an accustomed place, bringing it to the point of
clear vision by an accustomed movement of the neck muscles.
There was no evidence till considerably later that she was capable of
remembering a single, special experience.
The next day she was singularly bright and sunny, smiling all day at
every one. She stopped in the middle of nursing to throw her head
back and gaze at the bow at her mother’s neck, and would not go on
with the comparatively uninteresting business of food till the bow was
put out of sight. That night she slept eight hours at a stretch, longer
than she had ever done. Was the little brain, perhaps, wearied with
the new rush of impressions, which came with the new power of
focusing?
The day after she would lie a while unusually silent and sober,
looking about her and moving her hands a little; then she would fret
to be lifted and held against one’s shoulder, where she could hold
her head up and look about. She was able now to hold it up a long
time by resting it for a few seconds every half minute or so, against
my cheek, which I held close to give her the chance. But to-day she
was not satisfied with having her head erect: she persistently
straightened her back up against the arm that supported her—a new
set of muscles thus coming under control of her will. As often as I
pressed her down against my shoulder, she would fret, and
straighten up again and set to work diligently looking about her.
After this her progress in holding up her head was suddenly rapid,
and by the end of the month, four days later, she could balance it for
many minutes, with a little wobbling. This uncertainty soon
disappeared, and the erect position of the head was accomplished
for life.
During these last days of the month the baby was possessed by the
most insatiate impulse to be up where she could see. It was hard to
think that her fretting and even wailing when forced to lie down could
mean only a formless discontent, and not a clear idea of what she
wanted. Still, it is not uncommon, when an instinct is thwarted, to feel
a dim distress that makes us perfectly wretched without knowing
why. As soon as she was held erect, or propped up sitting amid
cushions, she was content; but the first time that she was allowed to
be up thus most of the day, she slept afterward nine unbroken hours,
recuperating, probably, quite as much from the looking and the
taking in that the little brain and eyes had been doing as from any
muscular fatigue there may have been in the position.
Such is the “mere life of vegetation” the baby lived during the first
two months. No grown person ever experiences such an expansion
of life, such a progress from power to power in that length of time.
Nor was our little girl’s development anything unusual for a healthy,
well-conditioned child, so far as other records give material for
comparison. Preyer’s boy was later than she in getting his head
balanced, but he arrived at full accommodation (and that is the most
important work of the first two months) at almost exactly the same
age as she; and so did Mrs. Hall’s boy. I do not know of any other
records that make a clear statement on this point.
VI
PROGRESS TOWARD GRASPING.