The Javascript Adventure Ron Sims Ii Instant Download
The Javascript Adventure Ron Sims Ii Instant Download
https://ebookbell.com/product/the-javascript-adventure-ron-sims-
ii-55870070
https://ebookbell.com/product/coding-for-kidslearn-javascriptbuild-
the-room-adventure-game-stephen-j-wolf-44412774
https://ebookbell.com/product/the-javascript-workshop-learn-to-
develop-interactive-web-applications-with-clean-and-maintainable-
javascript-code-joseph-labrecque-46663234
https://ebookbell.com/product/the-javascript-workshop-learn-to-
develop-interactive-web-applications-with-clean-and-maintainable-
javascript-code-page-numbers-corrected-joseph-labrecque-46687034
https://ebookbell.com/product/the-javascript-pocket-guide-burdette-
lenny-20016834
The Javascript Anthology 101 Essential Tips Tricks Hacks 1st Edition
Adams
https://ebookbell.com/product/the-javascript-anthology-101-essential-
tips-tricks-hacks-1st-edition-adams-55919770
https://ebookbell.com/product/the-javascript-workshop-joseph-
labrecque-170510052
https://ebookbell.com/product/javascript-explaining-the-javascript-
language-itself-in-detail-from-the-bottom-up-peter-bowen-43403822
Secrets Of The Javascript Ninja 2nd Edition 2nd Edition John Resig
https://ebookbell.com/product/secrets-of-the-javascript-ninja-2nd-
edition-2nd-edition-john-resig-50194942
https://ebookbell.com/product/learning-threejs-the-
javascript-3d-library-for-webgl-second-edition-2nd-revised-ed-
dirksen-55381374
The Javascript Adventure
Learn to Code by Building a Text-based Adventure
Game
Ron Sims II
2015
The Javascript Adventure
Learn to Code by Building a Text-based Adventure Game
All rights reserved. Only the source Javascript code and sample Javascript code
examples found in this publication may be reproduced. No other parts of this
publication may be reproduced in any format without the prior written permission
of the author and publisher.
Source code for the examples in this book are available at:
https://github.com/orangemantis/gamekit/archive/master.zip
© 2012 Google Inc. All rights reserved. Google and the Google Logo are
registered trademarks of Google Inc.
© 2012 Google Inc. All rights reserved. Chrome™ browser is a trademark of
Google Inc.
Throughout this publication trademarked logos, names, marks and images appear
in an editorial capacity. The author and publisher are not associated with any of
the respective parties that hold a claim to any of these trademarks.
While much effort has been made to present the information as correctly as
possible in this publication, the author and publisher of this book assume no
responsibility and provide no warranty for errors, omissions or any damage that
may result from the use of information contained in this publication.
Introduction
This book was created to help people get started writing computer code. Every
attempt was made to keep things as simple as possible. To do this, many
concepts are not covered because frankly they make things way too complicated.
This is not a guide to teach all things programming. It is just a book that helps
people get started.
The concepts in this book are taught by showing you how to build a game. Just
about every line you write will contribute to creating a simple text-based adventure
game. All you will need to get started is a computer with Google’s Chrome
browser, a text editor, an internet connection (to download the starter materials)
and a bit of imagination.
Chapters 1-6 of this book are designed with the beginner in mind. These sections
teach the reader how to write game code from scratch. The examples found in
the first six chapters introduce the Javascript language and many key
programming concepts.
Chapters 7-8 are for intermediate learners that have mastered the concepts
introduced in the first part of the book. This part of the book breaks down how the
included sample game works.
A Note on Format
New code that you must add is in this font and bold!
This is really all you need to know to get started. If you have a question, feel free
to send me a tweet @mantisorange. Keep reading and within minutes you will
have written your first program!
Chapter 1: Hello World, Everybody’s First Program
Computer programming is not hard, it just takes time. Don’t worry, it will be fun
(most of the time). Enough talk, let’s get busy coding. All you need to start is a
modern web browser and a basic text editor. Fortunately, most computers
already have both of these installed.
Note: For Windows we recommend using the Notepad++ text editor. For Mac we
recommend the Text Wrangler editor. Google’s Chrome is recommended for
both platforms.
2. Right click on the page and select Inspect element from the context menu.
The browser window should now be split. One part of the screen should still show
the Google page and the other should have a bunch of technical options like:
Network, Console, Elements and so on. This is the inspector. The inspector is
the main tool in the browser used for programming.
3. In the Inspector look for a tab labeled Console and click on it. The console is
where you make the programming magic happen.
4. Typically somewhere in the console you will see >. This is called the console
prompt, or prompt for short.
If you typed everything correctly, a window should have popped up that said
“Hello World”.
Congratulations! You have just written your first program. Let’s talk about what
you just did.
The console that lives inside the inspector is the place where any valid commands
will be executed. Anything that you type there that follows the rules of Javascript
will be evaluated and performed.
You basically told the browser to tell the user to show the message “Hello World”.
You did this by using the alert function. A function, sometimes called a method,
is special code that tells the computer to do something specific. Functions are the
verbs of computer languages. You may notice that there are parenthesis after the
word alert. The parenthesis are a dead giveaway that you are using function.
Whatever you put in the parenthesis can be used by the function. In
computerese, the thing you put in the parenthesis is called a parameter or param
for short.
In the case of the alert function, you can put any words in the parenthesis and the
browser will popup a window showing whatever you typed. In computerese, words
are called strings. A string must begin and end with quotes. The quotes tell the
computer to just read the text.
alert(Hello World);
Random documents with unrelated
content Scribd suggests to you:
right side of waist drawing the sash downwards to the left and round the
hips at back, next draw upwards across the front from right to left and round
waist at back and tuck the remaining length of sash in front as shown in Fig.
6.
PLATE V
This robe on women is also sometimes tied with a narrow girdle under
the breast instead of the edges being knotted.
PLATE VI
Plate VII.
The decoration on this plate shows the detail of the characteristic
Egyptian winged globe (a), hawk (b), and beetle (scarabæus) (c). Plates I.
and VIII. are examples of the application of winged decoration upon
Egyptian costume.
Three other geometrical borders (d, e, and f) and two all-over patterns (g
and h) are given; g shows an example of the well-known feather or scale
pattern; h (which is similar to e, Plate III.) is a favourite geometric motif,
and was often printed or painted on garments. A very charming effect also
of this pattern was a tunic entirely composed of beads, or beads and reeds,
and worn over the garment shown on Fig. 2, p. 11. Several beaded networks
of this type may be seen on the mummies in the British Museum.
PLATE VII
F.S.H. fec.
DETAILS OF DECORATION
Plate VIII.
The third outstanding type of Egyptian costume may be described as the
“Type of the Petticoat and Cape” (the petticoat was sometimes worn
without the cape). Now this petticoat or skirt, as shown in Plate VIII. and
Fig. 11, consists of a straight cut piece of material threaded through at the
waist with a narrow strip which is knotted round the figure to keep the
garment in position; the cape-like shoulder drapery is an oblong piece of
stuff, to drape which take the corners d and e of Fig. 11A in your hands and
twist them till the triangles a, b, c, and d, e, f, have become cords, and then
knot as shown in the diagram. In the skirt piece, Fig. 11B, sew together the
two short sides. As will be seen in the illustration, a long knotted girdle
about 100 inches in length is worn over the skirt. It passes twice round the
waist, and is knotted at the back as well as the front. In Plate VIII. the deep
ornamental collar is worn over the cape. The collar, which was fastened
down the back, is shown in plan (Fig. 11C).
Fig. 12 shows another method of wearing a similarly cut but rather
longer skirt; in this case there is no waist cord; two pieces of the upper edge
about half a yard apart are taken in the hands and twisted, one is crossed
over the other and tucked inside, the other is pulled up and
PLATE VIII
Fig. 11A
Fig. 11B
Fig. 11C
Fig. 11 Fig. 12
Compare Fig. 12 with Plate II. where the drapery here given has
suggested in its lines a decoration of stripes.
Plate IX.
The noteworthy details of the decorations on this plate are those
illustrated at a and b. These are appendages from girdles such as worn by
male figures; an example is Fig. 21. The material of this appendage may be
possibly of painted leather, wool embroidered linen, or linen with metal
mounts. Many beautiful painted illustrations of this girdle appendage are to
be found in the British Museum; e is from a feather fan.
PLATE IX
F.S.H. fec.
DETAILS OF DECORATION
Plate X.
Plate X. shows the fourth division of Egyptian costume—namely, the
“Type of the Shawl or Drapery.” Several varieties of this type are illustrated
and described on pp. 33, 34, and 35.
Fig. 16
PLATE X
Fig. 17 Fig. 19
Fig. 19A
The width 45” will drape a tall figure, say 5’ 6” in height. The drapery should be narrower for a
lesser height.
and over the right shoulder towards front, then throw the remaining portion
of garment across the chest and backwards over the left shoulder; take
corner a and bring it round under right arm-pit, release corner b which you
first tucked in, and tie it to corner a. The corner c will hang down in a point
at the back.
To drape the costume on Fig. 17, which dates 1300 B.C., take the corner a
of Fig. 17A and hold it at right side of waist in front, pass round the back
and round the left side to front again, tuck in some pleats in centre front,
and pass on round the back to left side of waist under left arm towards the
front; catch up the entire garment and throw over the right shoulder, pass
the upper edge of the garment round the back of the neck and over the left
shoulder and downwards across the breast to right, where the corner b
should be tied to corner a. Corner d hangs down in a point at the back.
For Fig. 18, which dates 1600 B.C., take the corner a of Fig. 18A and hold
it at right side of waist in front, pass the edge a-b round back of waist to the
left side and across the front of waist, pass it round the right side again
under the right arm towards the back and upwards over the left shoulder; tie
the corner a to corner b in front.
For Fig. 19, which dates 550 B.C., tie a waist cord, hold corner a of Fig.
19A at left side of waist in front, and throw the whole garment upwards over
the right shoulder to the back; take the corner c, bring it round under the
right arm, and hold it along with the corner a; draw the edge a-b, which still
hangs over the right shoulder, downwards across the back to left side of
waist. Bring it round to front of waist and pin it to the corners a and c at the
left side of waist in front, passing the garment on round the front; tuck in a
few pleats in centre front into the waist cord, then pass it round right side of
waist and upwards across the back over the left shoulder, downwards across
the breast to right side of waist; here pass a loop of material over the left
wrist as shown in diagram; now pass a girdle round the waist over the entire
drapery, knot it at right side of waist, confining the drapery as illustrated in
Fig. 19.
Fig. 18A
Fig. 18
Here are three other varieties of Egyptian costume. Fig. 20, which dates
sixth century B.C., is an arrangement of a cloak worn by a man (Plan 20A).
Fig. 21 shows an interesting cross-over garment sheathing the upper part of
the body, worn by a Warrior King, 1200 B.C. It was probably made of
leather or quilted linen (plan, Fig. 21A). This figure is also wearing one of
the characteristic belts with appendages (for detail see Plate IX., a and b).
Fig. 22, which dates 1300 B.C., is wearing a robe, as previously described on
Fig. 6, but in addition has a stiff corselet (Plan 22A) of leather or quilted
linen which is fastened at the side; the date of this figure is 1300 B.C.
Fig. 21 Fig. 22
Fig. 21A
Fig. 22A
A COMPARISON
THE INDIAN “SARI”
Before passing from Egyptian costume, it seems interesting to compare
the accompanying illustrations of an ordinary present-day draping worn by
women in India. This long shawl drapery (the “sari”) presents extraordinary
similarities to some of the ancient Egyptian shawls or draperies already
illustrated.
The method of draping is as follows: Tie a waist cord; take the corner b
and fix it to the right-hand side of waist, then pass the edge b-a across the
front of waist, round the left side towards the back, and round the back of
waist again to the right side; now take up some pleats in the drapery and
push them inside the waist cord in centre front of waist, then pass on the
drapery round the waist to back and round to the right side again. Now
catch up all the remaining drapery and throw it upwards across the chest
over the left shoulder. Let the corner c hang down the back, and bring the
corner around towards the front of waist and tuck it in at the left side of
waist, so that it will have the thrown-over portion to the right of it. This
completes this draping of an Indian sari. The width of this sari will drape a
figure of 5’ 4”, most of those worn by Indian women are narrower.
CUTTING OUT
There are practically only two types of garment generally found in the
representations of ancient Assyrian costume: (1) the shawl, and (2) the
tunic. These vary in size and proportion, and are worn either alone, but
more generally in combination.
DECORATION
Except in the earliest examples, decoration is lavish in Assyrian
costume; in fact, the costume of a King when at its richest may be said to be
absolutely covered with ornament. Jewellery, woven and embroidered
patterns, and fringes are used in the utmost profusion. See the illustrations
of the most characteristic ornamental details of this style.
MATERIAL
The materials used seem to have been of linen and wool. The skins and
furs of animals and metal were also in use, but chiefly for military and
hunting costume.
DATES
The earliest type of costume here shown is a rather elaborate shawl
drapery worn without any tunic underneath. Later comes the tunic with
various fringed shawl draperies worn in addition, and some of the latest
types have the tunic worn alone without the shawl draperies. The dates
given for the costumes illustrated in this style have been verified at the
British Museum. It should be remembered, as in the case of ancient
Egyptian costume, that the dresses changed very slowly indeed, and most
styles of this era were worn literally for hundreds of years.
MEN AND WOMEN: THE DIFFERENCE IN THEIR DRESS
The representations of costume which Assyrian art has left us are almost
entirely those of men’s dress. Two examples of women’s dresses are shown
in this volume. The first wears a plain ungirded tunic and a simply draped
shawl covering the figure partially. The second is the dress of a Queen, and
has the tunic almost entirely covered with a voluminous shawl. The wide
belt with narrow belt over it seems to be confined to the men’s costume, as
also the tighter and scantier shawl draperies which exist in singular variety.
For Assyrian and Ancient Persian Styles consult: Layard’s “Monuments of Nineveh”;
Flandin and Coste, “Voyage en Perse”; Botta, “Monuments de Ninïve”; Victor Place,
“Ninïve et Assyrie”; Perrot and Chipiez, “History of Art in Persia”; Racinet, “Le Costume
Historique”; Hottenroth “Le Costume”. Also reproductions and handbooks of the
collections in the British Museum.
Figs. 26, 27, and 28: This drapery is from the figure of the King Gudea,
2500 B.C. (see British Museum). To drape, place the corner b of Fig. 26A
under left arm-pit, and draw the edge b-a round the back of shoulders under
the right arm-pit, across the front of chest, and round the back again, and
under the right arm-pit once more; then throw the edge b-a upwards across
the chest and over the left shoulder; the corner a will then hang down the
back. Take this corner a and tuck it in at the right side of breast, as shown in
illustration (Fig. 26). It should be noted that, unless the left hand is raised,
the left arm and hand are entirely covered by this drapery, the right arm
only being left free for movement. This dignified drapery presents points of
similarity to the Roman “toga” of a much later period.
Fig. 26 Fig. 27 Fig. 28
Fig. 26A
PLATE XI
Fig. 30
Fig. 31: The point to be noted in this figure is the arrangement of a fringe
drapery which goes once round the waist, is thrown over one shoulder, and
hangs down the back.
Fig. 31
Fig. 32: This man, in hunting dress, ninth century B.C., has a small scarf,
fringed only at the ends, wrapped tightly round the limbs, reaching to the
knee.
Fig. 32
Plate XII.
Plate XII. shows a number of characteristic Assyrian ornaments.
a, The sacred tree.
b, c, d, e, f, Repeating patterns on costumes.
g, h, i, j, k, l, Borders on costumes.
m, One of the many rosettes much used in Assyrian decorations.
These should be compared with the decorated costumes shown in the
plates; they would be either woven or embroidered.
PLATE XII
F.S.H. fec.
DETAILS OF DECORATION
Fig. 34A
Plate XIII.—A facsimile drawing, from an enamel tile, is one of the
many representations of the King Assur-nasir-pal, ninth century B.C. The
description of his dress will be better understood by referring to Figs. 34,
35, and 36. The King wears over his long tunic a very beautiful and
dignified shawl drapery, which is fringed, recalling certain Egyptian types
already illustrated, and, indeed, has points of similarity with certain Greek
and Roman draperies. To drape this shawl (see Fig. 34A) fold over on the
line e-f so that e-f, a-b, hangs down outside; then attach the cord e-g as
illustrated, and hold g at right side of waist in front, throwing the rest of the
shawl backwards over the right shoulder. Draw the edge e-f round the back
of neck, and form a
PLATE XIII
Fig. 37 Fig. 38
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
ebookbell.com