Professional Documents
Culture Documents
Learning C 7 by Developing Games With Unity 2017 Learn C Programming by Building Fun and Interactive Games With Unity Third Edition Micael Dagraca
Learning C 7 by Developing Games With Unity 2017 Learn C Programming by Building Fun and Interactive Games With Unity Third Edition Micael Dagraca
https://textbookfull.com/product/learning-c-by-developing-games-
with-unity-5-x-develop-your-first-interactive-2d-platformer-game-
by-learning-the-fundamentals-of-c-second-edition-greg-lukosek/
https://textbookfull.com/product/learning-c-by-developing-games-
with-unity-5-x-develop-your-first-interactive-2d-platformer-game-
by-learning-the-fundamentals-of-c-second-edition-greg-lukosek-2/
https://textbookfull.com/product/developing-2d-games-with-unity-
independent-game-programming-with-c-1st-edition-jared-halpern/
Developing 2D Games with Unity: Independent Game
Programming with C# 1st Edition Jared Halpern
https://textbookfull.com/product/developing-2d-games-with-unity-
independent-game-programming-with-c-1st-edition-jared-halpern-2/
https://textbookfull.com/product/learning-c-programming-with-
unity-3d-alex-okita/
https://textbookfull.com/product/learning-c-by-programming-
games-2nd-edition-wouter-van-toll/
https://textbookfull.com/product/hands-on-game-development-
patterns-with-unity-2019-create-engaging-games-by-using-industry-
standard-design-patterns-with-c-1st-edition-david-baron/
Learning C# 7 By Developing
Games with Unity 2017
Third Edition
Micael DaGraça
Greg Lukosek
BIRMINGHAM - MUMBAI
Learning C# 7 By Developing Games with
Unity 2017
Third Edition
Copyright © 2017 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or
transmitted in any form or by any means, without the prior written permission of the
publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the
information presented. However, the information contained in this book is sold without
warranty, either express or implied. Neither the author, nor Packt Publishing, and its
dealers and distributors will be held liable for any damages caused or alleged to be caused
directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
www.packtpub.com
Credits
Author
Copy Editor
Micael DaGraça
Safis Editing
Greg Lukosek
"First and most importantly, I would like to thank my parents; they have always worked so
hard and I know that they sacrificed a lot so I could pursuit my dreams. From the bottom of
my heart I thank you mom and dad. To my sister who has supported me in so many ways, I
thank you for helping me start my career as a game designer; without you, my journey
would be much harder. A warm and fluffy thank you to my girlfriend Marta, who helps me
by keeping me motivated and focused on my work; it's been more than a pleasure sharing
my life with you."
Greg Lukosek was born and raised in the Upper Silesia region of Poland. When he was
about 8 years old, his amazing parents bought him and his brother a Commodore C64. That
was when his love of programming started. He would spend hours writing simple basic
code, and when he couldn't write it on the computer directly, he used a notepad.
Greg met the love of his life, Kasia, in 2003, which changed his life forever. They both
moved to London in search of adventure and decided to stay there.
He started work as a 3D artist and drifted away from programming for some years. Deep
inside, he still felt the urge to come back to game programming. During his career as a 3D
artist, he discovered Unity and adopted it for an interactive visualizations project. At that
very moment, he started programming again.
His love for programming overcomes his love for 3D graphics. Greg ditched his 3D artist
career and came back to writing code professionally. He is now doing what he really
wanted to do since he was 8 years old–developing games.
These days, Greg lives in a little town called Sandy in the UK with Kasia and their son,
Adam.
About the Reviewer
Predrag Koncar is a game developer/artist and multimedia researcher, active in both visual
arts and computer science. His primary areas of interest are games and combining
technology and art. He likes to spend his free time painting and actively participates in art
shows. Predrag has worked as a technical and creative director for many online projects,
published over 40 online games, participated in the production of several mobile games,
and also reviewed five books by Packt Publishing. He has a strong background in Unity,
C#, Augmented Reality, Maya, and AI and is a member of Mensa and ACM SIGGRAPH.
www.PacktPub.com
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and
ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a
print book customer, you are entitled to a discount on the eBook copy. Get in touch with us
at service@packtpub.com for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a
range of free newsletters and receive exclusive discounts and offers on Packt books and
eBooks.
https://www.packtpub.com/mapt
Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt
books and video courses, as well as industry-leading tools to help you plan your personal
development and advance your career.
Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Customer Feedback
Thanks for purchasing this Packt book. At Packt, quality is at the heart of our editorial
process. To help us improve, please leave us an honest review on this book's Amazon page
at https://www.amazon.com/dp/1788478924.
If you'd like to join our team of regular reviewers, you can e-mail us at
customerreviews@packtpub.com. We award our regular reviewers with free eBooks and
videos in exchange for their valuable feedback. Help us be relentless in improving our
products!
Table of Contents
Preface 1
Chapter 1: Discovering Your Hidden Scripting Skills and Getting Your
Environment Ready 6
Prerequisite knowledge to use this book 7
Dealing with scriptphobia 7
Downloading Unity 8
Obtaining a free license 9
Teaching behavior to GameObjects 9
Using Unity's documentation 10
The Unity community – asking others for help 13
Working with C# script files 13
Creating a C# script file 14
Introducing the MonoDevelop code editor 14
Opening LearningScript in MonoDevelop 16
The namespace – highlighted in blue 17
Watching for possible gotchas while creating script files in Unity 17
Fixing synchronization if it isn't working properly 19
Adding our script to GameObject 19
Lots of files can create a mess 21
Why does my Project tab look different? 21
Instance? What is this? 24
Summary 24
Chapter 2: Introducing the Building Blocks for Unity Scripts 25
Understanding what a variable is and what it does 26
Naming a variable 26
A variable name is just a substitute for a value 30
Creating a variable and seeing how it works 32
Declaration 33
Assignment 34
Click Play! 34
Changing variables 35
Watching for a possible gotcha when using public variables 35
What is a method? 36
Using the term "method" instead of "function" 36
Table of Contents
[ ii ]
Table of Contents
[ iii ]
Table of Contents
[ iv ]
Table of Contents
[v]
Table of Contents
Summary 204
Chapter 13: Collectables 205
Collectables 205
The coin prefab 206
The Collectable class 210
High score and persisting data 213
Health Points and Health bar 215
Magic Points and Magic bar 217
The code in this chapter 218
Summary 225
Chapter 14: Enemies 226
What makes an enemy? 226
Movement 227
Movement by animation 227
Trigger movement 231
Making it an enemy 237
The code in this chapter 238
Summary 242
Chapter 15: Audio, 3D Games, and Export 243
How to add sound effects and music 243
Where to find sound effects and music 243
Adding music 244
Adding sound effects 248
Through animation 249
Through script 251
How to create a 3D game 252
3D models 253
3D animations 253
Animator 255
How to export and make it playable 257
Code 259
PlayerController.cs 260
Summary 262
Index 263
[ vi ]
Preface
Hello and welcome to the amazing journey of game development. This book is destined for
those who have always wanted to create a game, the ones who have thousands of good
ideas for games and people who inspire to be professional game developers. This book is
destined for you. Here, you will learn the fundamentals of how to create a game from start
to finish using Unity and C#. Step by step, you will be learning how to code and how to use
the game engine to turn your ideas into real projects. At the end of the book, you'll have
created a 2D platform game, and you will know how to create different games using the
same principles that you have learned.
Chapter 2, Introducing the Building Blocks for Unity Scripts, helps you develop the skill of
writing your first executable code.
Chapter 3, Getting into the Details of Variables, teaches you about creating and using C#
variables, followed editing them in Unity Inspector.
Chapter 4, Getting into the Details of Methods, helps you learn more in detail about methods
and how to use them to understand the importance of code blocks and the variables used in
them.
Chapter 5, Lists, Arrays, and Dictionaries, introduces slightly more complex ideas of
handling, lists, arrays, and dictionaries, which allow you to store many values at once.
Chapter 6, Loops, focuses on learn how to "ask" Unity to loop through a section of code and
do something useful.
Chapter 7, Objects, a Container with Variables and Methods, dives into the subjects of
organizing your code and object-oriented programming.
Chapter 8, Let's Make a Game! – from Idea to Development, explains how to turn an idea into a
ready-to-code project and how to break down complex mechanics into pieces.
Preface
Chapter 9, Starting Your First Game, outlines transforming an idea into a real Unity project.
Chapter 10, Writing GameManager, gets you acquainted with the basics of the singleton
approach and also helps you work through the gameplay loop.
Chapter 11, The Game Level, teaches how to create reusable pieces
of a level and also how to populate them to create the illusion of an endlessly running
game.
Chapter 12, The User Interface, showcases how to construct and implement the user
interface in our game.
Chapter 13, Collectables, outlines collectables and storing some data between Unity sessions.
Chapter 14, Enemies, assists in how to create enemies and obstacles, how to animate them
and how to turn simple Game Objects into deadly objects.
Chapter 15, Audio, 3D Games, and Export, assists in implementing audio effects and music,
introduces you to the fundamentals of how to create a 3D game, and finally, how we can
export the game to multiple platforms.
Conventions
In this book, you will find a number of text styles that distinguish between different kinds
of information. Here are some examples of these styles and an explanation of their meaning.
[2]
Preface
Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "This is
the part where you have to write down instructions so that your GameObjects can be
smarter."
New terms and important words are shown in bold. Words that you see on the screen, for
example, in menus or dialog boxes, appear in the text like this: "Go ahead and click Play."
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this
book-what you liked or disliked. Reader feedback is important for us as it helps us develop
titles that you will really get the most out of.
If there is a topic that you have expertise in and you are interested in either writing or
contributing to a book, see our author guide at www.packtpub.com/authors.
[3]
Preface
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help you
to get the most from your purchase.
1. Log in or register to our website using your e-mail address and password.
2. Hover the mouse pointer on the SUPPORT tab at the top.
3. Click on Code Downloads & Errata.
4. Enter the name of the book in the Search box.
5. Select the book for which you're looking to download the code files.
6. Choose from the drop-down menu where you purchased this book from.
7. Click on Code Download.
You can also download the code files by clicking on the Code Files button on the book's
webpage at the Packt Publishing website. This page can be accessed by entering the book's
name in the Search box. Please note that you need to be logged in to your Packt account.
Once the file is downloaded, please make sure that you unzip or extract the folder using the
latest version of:
The code bundle for the book is also hosted on GitHub at https://github.com/
PacktPublishing/Learning-C-7-By-Developing-Games-with-Unity-2017-Third-Edition.
We also have other code bundles from our rich catalog of books and videos available
at https://github.com/PacktPublishing/. Check them out!
[4]
Preface
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do
happen. If you find a mistake in one of our books-maybe a mistake in the text or the code-
we would be grateful if you could report this to us. By doing so, you can save other readers
from frustration and help us improve subsequent versions of this book. If you find any
errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting
your book, clicking on the Errata Submission Form link, and entering the details of your
errata. Once your errata are verified, your submission will be accepted and the errata will
be uploaded to our website or added to any list of existing errata under the Errata section of
that title.
Piracy
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At
Packt, we take the protection of our copyright and licenses very seriously. If you come
across any illegal copies of our works in any form on the Internet, please provide us with
the location address or website name immediately so that we can pursue a remedy.
We appreciate your help in protecting our authors and our ability to bring you valuable
content.
Questions
If you have a problem with any aspect of this book, you can contact us
at questions@packtpub.com, and we will do our best to address the problem.
[5]
Discovering Your Hidden
1
Scripting Skills and Getting
Your Environment Ready
Computer programming is viewed by the average person as requiring long periods of
training to learn skills that are totally foreign and darn near impossible to understand. The
word geek is often used to describe a person who can write computer code. The perception
is that learning to write code takes great technical skills that are just so hard to learn. This
perception is totally unwarranted. You already have the skills needed but don't realize it.
Together, we will crush this false perception that you may have of yourself by refocusing,
one step at a time, on the knowledge that you already possess to write code and develop an
awesome game from scratch.
Let's begin our journey by eliminating any anxiety about writing scripts for Unity and
become familiar with our scripting environment.
Discovering Your Hidden Scripting Skills and Getting Your Environment
Chapter 1
Ready
However, some knowledge of Unity's operation is required. We will only be covering the
parts of the Unity interface that are related to writing C# code. I am assuming that you
know your way around Unity's interface. I will help you, however, to prepare the Unity
layout for efficient scripting.
You've just learned a big lesson: all those fantastic, highly detailed GameObjects are
dumber than a hammer. They don't know anything, and they surely don't know how to do
anything.
So, you proceed to read the Unity Forums, study some scripting tutorials, and maybe even
copy and paste some scripts to get some action going when you click Play. That's great, but
then you realize that you don't understand anything in the scripts you've copied. Sure, you
probably recognize the words, but you fail to understand what those words do or mean in a
script.
You look at the code, your palms get sweaty, and you think to yourself, "I'll never be able to
write scripts!" Perhaps you have scriptphobia: a fear of not being able to write instructions (I
made that up). Is that what you have?
The fear that you cannot write down instructions in a coherent manner? You may believe
you have this affliction, but you don't. You only think you do.
The basics of writing code are quite simple. In fact, you do things every day that are just like
the steps executed in a script. For example, do you know how to interact with other people?
How to operate a computer? Do you fret so much about making a bologna sandwich that
you have to go to an online forum and ask how to do it?
[7]
Discovering Your Hidden Scripting Skills and Getting Your Environment
Chapter 1
Ready
Of course you don't. In fact, you know these things as everyday routines or maybe habits.
Think about this for a moment: do you have to consciously think about the routines that
you do every day? Probably not. After you do them over and over, they become automatic.
The point is that you do things every day following sequences of steps. Who created these
steps that you follow? More than likely, you did, which means that you've been scripting
your whole life.
You just never had to write down the steps for your daily routines on a piece of paper
before you did them. You could write the steps down if you really wanted to, but it takes
too much time and there's no need for it; however, you do in fact know how to. Well, guess
what? To write scripts, you only have to make one small change, start writing down the
steps, not for yourself but for the world that you're creating in Unity.
So as you can see, you are already familiar with the concept of dealing with scripts. Most
beginners of Unity easily learn their way around the Unity interface, how to add assets, and
working in the Scene and Hierarchy windows. Their primary fear and roadblock is their
false belief that scripting is too hard to learn.
Relax! You now have this book. I am going to get really basic in the early chapters. Call
them baby steps if you want, but you will see that scripting for Unity is similar to doing
things that you are already doing every day. I'm sure you will have many Aha moments as
you learn and overcome your unjustified fears and beliefs.
Downloading Unity
You have probably already installed and activated Unity. Where you should look for the
latest Unity version and license might be obvious. However, I've noticed lots of questions
online about where you can get Unity for free, and so I decided to cover this subject. If you
feel that this step is unnecessary for you, skip this part.
The best place to download your Unity copy from is, of course, Unity's official
website: https://store.unity.com/download?ref=personal.
In this book, we will be covering Unity Version 2017.1.1 and higher. We need to download
the latest version of Unity and install it with all components ticked. It's a good idea to install
Unity with the example project. The Unity Example project (the Angry Bots game) is there
for us to play with, experiment, and learn.
[8]
Discovering Your Hidden Scripting Skills and Getting Your Environment
Chapter 1
Ready
Unity has a store where we can also download more example projects and start playing
around with them. To access the store, you can do it online or directly from the Unity
engine, so don't worry if you forgot to check the Unity Example project in the installation
menu because you can download it at any time.
1. Fill in your details so that Unity Technologies can send you your Unity free
license code.
2. Unity will present the License management window. Chose the Unity Personal
(free version).
3. You should receive a verification email with a Confirm email button. Once you
have clicked it, you should be able to log in to Unity.
You are now all set with the latest version of Unity and a free license!
"The behavior of GameObjects is controlled by the Components that are attached to them...
Unity allows you to create your own Components using scripts."
Notice the word behavior. It reminds me of a parent teaching a child proper behavior. This is
exactly what we are going to do when we write scripts for our GameObjects: we'll teach
them the behaviors we want them to have. The best part is that Unity has provided a long
list of all the behaviors that we can give to our GameObjects. This list of behaviors is
documented in the Scripting Reference.
[9]
Discovering Your Hidden Scripting Skills and Getting Your Environment
Chapter 1
Ready
This means that we can pick and choose anything that we want a GameObject to do from
this list of behaviors. Unity has done all the hard work of programming all of these
behaviors for you. All we need to do is use some code to tie into these behaviors. Did you
catch that? Unity has already created the behaviors; all that we have to do is supply a bit of
C# code to apply these behaviors to our GameObjects. Now, how difficult can it really be
since Unity has already done most of the programming?
[ 10 ]
Discovering Your Hidden Scripting Skills and Getting Your Environment
Chapter 1
Ready
Let's open Scripting Reference now and search for a GameObject:
Through the Help menu next to the component name. This will work only for
Unity's built-in, standard components.
This is the place where we can find scripting documentation, answers to our questions, and
a lot of example code. You might feel a bit lost right now, but don't worry, this is quite
normal. The Unity documentation is really easy to use. For the fastest access to relevant
information, use Search scripting... in the top–right corner, as shown here:
[ 11 ]
Discovering Your Hidden Scripting Skills and Getting Your Environment
Chapter 1
Ready
The whole reason Scripting Reference exists is so that we can look for
information as we need it. This will actually make us remember the code
that we write over and over, just like our other daily routines and habits. It
is a very good idea to take a brief look through the most common Unity
objects, such as GameObject, Transform, MonoBehaviour, and Renderer.
Let's not worry about it too much at the moment. We agreed to take baby steps, so
bookmark this link in your web browser for now.
[ 12 ]
Discovering Your Hidden Scripting Skills and Getting Your Environment
Chapter 1
Ready
When we encounter some hurdles, why not ask others? In most cases, there is someone like
you out there with similar issues that have been resolved. A good place to talk about issues
in your project is in the Unity Forums. Go ahead and create a forum account now! Don't be
shy; say "hello" to others! Unity Forums are also the perfect place to read announcements
about upcoming updates.
Use Unity Forums to read about others' work, share your work, and connect with other
developers at http://forum.unity3d.com/.
Use Unity Answers to ask specific questions about issues that you have encountered.
Remember to be very specific, try to describe the problem in detail, and don't ask general
questions. For example, don't ask, "Why is my GameObject not moving?" Instead, ask
specifically, "GameObject not moving when adding a rigid body force" and then describe
the details. Posting your code under the question is also a very good idea.
All of these ways create a .cs file in the Unity Assets folder. From now on, whenever I tell
you to create a C# script, use whichever method you prefer.
[ 13 ]
Discovering Your Hidden Scripting Skills and Getting Your Environment
Chapter 1
Ready
We have created the Scripts folder, which we will be using to organize our C# files. This
folder will contain all of our Unity script files. We have also used Unity to create a C# script
file named LearningScript.cs.
[ 14 ]
Another random document with
no related content on Scribd:
Aunt Sophia Primshock’s eyes, if it could not sneak in through her
ears. On the very next morning after Pee-wee’s brief career upon the
stage he received the following letter:
If any hop-toad can’t learn the pace he has to have his legs
tied together for an hour.
Every feller that gets a new hop-toad gets a piece of
chocolate—
If a hop-toad can’t croak like a frog he has to be turned over
on his back and somebody sit on him till he croaks.
Aunt Sophia looked up, dumbfounded, speechless. She
readjusted her spectacles, as if even they might be deceiving her,
and read:
She read no more. Rather she saw the page in a kind of trance.
Her astonished eyes jumped from one blood-curdling memorandum
to another, picking out the more heartless words and phrases. Given
to the tom-cats ... chased the Robins away ... turned on his back till
he croaks ... hop-toads ... sticks in their mouths....
Horrors, oh horrors! Here before her very eyes was a series of
recipes for cruelty! Directions, suggestions, memorandums written in
cold blood for the torture of hop-toads!
Pee-wee sensed the situation, but it was too late. The hop-toads
were already on their backs, the sticks were in their mouths, they
were croaking, or being fed alive to tom-cats, the robins had been
chased from their nests and their little ones, the boys were standing
around eating chocolate while the toads suffered, the massacre was
on.
“I’ll tell you all about it,” Pee-wee said, facing the awful face of his
outraged aunt. “You see hop-toads, they’re really not hop-toads; do
you see?”
“I do not see,” said Aunt Sophia.
“I’ll tell you all about it. Scout patrols are named after animals;
there’s a patrol at Temple Camp named the Robins, see? My new
patrol is going to be named the Hop-toads, because they’re all going
to be good at scout pace, see? Gee whiz, you don’t care if we make
fellers hold sticks in their mouths, do you? Because they can run
better that way. A hop-toad means a—a scout. I’m a hop-toad.
Maybe I don’t look like one but I am.”
Aunt Sophia was just about convinced—by a very, very narrow
margin. She was convinced, but she remembered the awful things
upon that fly-leaf. She was still a little, just a very little, suspicious.
But she accepted Pee-wee’s explanation....
CHAPTER VI—CARRIED BY A MINORITY
That same memorable Saturday was the day on which Pee-wee’s
troop was to go to its summer quarters at the beloved Temple Camp.
As every scout knows, Temple Camp is a little in from the Hudson
River in the neighborhood of Catskill.
North Deadham is about thirty-five miles north of Bridgeboro.
Roughly speaking, North Deadham would be on a line between
Bridgeboro and Temple Camp. The brilliant idea of spilling the beans
in North Deadham is attributable to Artie Van Arlen, patrol leader of
the Ravens—Pee-wee’s own patrol.
“What do you say if two or three of us start hiking on Friday and
camp along the way and bang into North Deadham in time to foil our
young hero?” said Artie. “Foiling is his middle name, so we’ll try a
little of it. Then we’ll wrap him up and take him along to camp with
us. What do you say?”
“You mean hike all the way?” asked Connie Bennett of the Elks.
“Sure.”
“Declined with thanks,” said Connie. “Let him stay there a while.
What’s the use of starting out hunting for trouble? He’s wished onto
the Ptomaine Committee or whatever they call it; let them worry for a
while.”
“Anybody in the Silver Foxes want to hike it?” Artie asked.
“We promised Mr. West of the West Shore Railroad, we’d go that
way,” said Roy; “we can’t break our words. The train will be waiting
for us.”
“Some scouts!” said Grove Bronson of the Ravens.
“I’d just love to stop at North Deadhead for our young hero,” said
Hunt Ward of the Elks, “but you know how the directors of the
railroad would feel.”
“Sure, a scout’s honor is to be trusted,” said Roy.
“How about his feet?” Artie shot back. “Can you walk from the
station to the train? You make me tired, you fellows.”
“If you’re so tired what do you want to hike for?” Roy asked.
“You’re so wide awake and full of pep, what do you want to go to
Fried ham or Dead-ham for? I should worry about Deadville or
whatever you call it. Right away when we get rid of Pee-wee you
want to go and get him. They’ve just had whooping cough at Temple
Camp; isn’t that bad enough? The raving Ravens are raving again,
no wonder the railroads are losing money with the Raven Patrol
walking all over the country.”
“Who’ll volunteer?” Artie said.
“A large chunk of silence,” said Roy.
“I won’t,” called one.
“Neither will I,” shouted another.
“Not for mine,” piped up a third.
“We’ll all volunteer not to hike,” said Roy. “Let the scouts in the
books do the hiking.”
“I will,” said Grove Bronson.
“He hasn’t got the railroad fare,” shouted Roy.
“All right,” said Artie, “you and I’ll hike together, Grove; we’ll take
the north turnpike—”
“Be sure to put it back when you get through with it,” said Roy,
“and give our kindest regards to the animated animal cracker and if
you’re going to hike from Deadtown to camp the best way is to follow
the Franklin Turnpike as far as Idaho and take the second turn to
your left. That’ll take you into the Great Salt Lake. Don’t hurry, take
your time.”
“The pleasure is ours,” said Artie.
“If you don’t get to camp till next summer it’ll be all right,” said Roy.
“Tell Pee-wee he’ll find us near the lake and we hope he’ll drop in.”
CHAPTER VII—MENTAL TELEGRAPHY
Thus it happened that while Scout Harris, friend and champion of
the dumb creatures, was preparing to receive the tribute that was
due him, two scouts of his patrol were tramping along the dusty road
as the sun went down, on the last part of their long hike to North
Deadham. They crossed the frontier of the village unnoticed. The
only sentinel there was a rooster on a fence and he was asleep at
his post, or rather his perch.
The invading column passed through McCrockett’s Lane and
rested under a weeping willow tree, where they kindled a little fire
and brewed some coffee and fried some bacon. If the weeping
willow could but have known their business it would have laughed
rather than wept.
Their supper finished, the invaders trampled the fire out and
played mumbly peg under the tree just as if nothing were going to
happen. Scout Harris said afterward that just at that time (seven
thirty) a strange desire for fried bacon came over him and that he
smelled coffee. Thus soul speaks to soul across space in the mystic
realm of scouting!
At exactly eight o’clock by a cow-bell in a neighboring field,
verified by their own trusty scout watches, the invaders followed a
northwesterly course through the village square into Gordon’s Hollow
and thence to Main Street and to a certain commissary where they
made ready for the terrible work in hand by two stimulating ice cream
cones, which sent the blood coursing through their veins and gave
them strength and courage.
Passing the district school with great caution they succeeded in a
skilfully conceived flank move around the entire police department,
who was standing on a corner talking with an unsuspecting citizen.
This was at exactly seven minutes after eight by the town hall clock
which wasn’t going, no doubt in honor of the great occasion.
Singular to relate, at precisely four minutes after eight by Pee-
wee’s reliable scout watch, and just as he was starting with his
cousin Prudence for the church lecture hall, he was conscious of a
shivering and decided to return and get his scout jacket. It was at
that very moment that the invading legion partook of ice cream
cones. Perhaps it was only a coincidence but so strong was the
thought of ice cream cones in Pee-wee’s mind that he bought two
(treating his cousin Prudence) on their way to the church. A most
singular and harrowing thing to relate is that these two separate
parties almost met in Pop Carroway’s Candy Parlor.
The lecture room of the church was ablaze with light from eight
kerosene lamps. One of these had a reflector on it, to be used
perhaps as a sort of spotlight on the hero’s entrance.
Aunt Sophia, by reason of her collection of aches and pains, did
not attend this gala meeting. She stayed at home with her cats. But
the minister was there and the Girl Scouts from South Deadham and
Deadham Centre were there.
This gay outpouring of nearly fifty people was not exactly in honor
of Pee-wee. It was a Girl Scout rally intended to stir up interest in the
local movement. But since Pee-wee, like a true scout, was always
prepared to take whatever came along, he appropriated all the stray
glory that was floating around.
Being the only boy in town, he was something of a lion and was
viewed with becoming awe by the spectators as he sat wedged in
between his cousin Prudence and one of the other girls on the
platform. His martial appearance was somewhat modified when he
pulled up his rebellious stocking, but his frown was terrible and his
belt axe was so skilfully displayed as to strike dismay to the most
courageous heart.
His nine merit badges (the final badge still lacking) were revealed
upon his sleeve. He and the two maidens who flanked his sturdy
form occupied but two chairs and from the rear of the little meeting
room Artie Van Arlen and Grove Bronson, lurking there unseen,
beheld the picture of these three as a sort of human sandwich (the
kind sold at railroad stations) with the middle part of almost
microscopic proportions. All of the valor in Scout Harris’s diminutive
body seemed to be squeezed up into his head by the flanking
pressure of his feminine hostesses and he gazed out upon the
assemblage, silent, uncomfortable, terrible.
The organization business of the evening being concluded and a
couple of songs about the woods having been sung, Miss
Sympathea Softe arose, replaced a straying lock of hair with skilful
daintiness, wriggled a little with becoming stage fright, and
proceeded to explain the happy idea which the Girl Scouts had hit on
in the Black Beauty Award.
CHAPTER VIII—A PREDICAMENT
“Humanity and kindness,” she said in finishing, “are as broad as
the skies. So we planned not to confine our award to our local circle
or even to Girl Scouts everywhere. There are Boy Scouts as well
and we must not forget them.”
“There are more of them than there are Girl Scouts,” Pee-wee
spoke up, “because I can prove it—”
“And their activities are reported in newspapers throughout our
country—”
“They’re in Boys’ Life too,” Pee-wee announced vociferously, to
the great amusement of the audience.
“The Boy Scouts,” continued Sympathea, “have an award called
the First Aid to Animals Badge. It is the intention of our little troop to
tender the Black Beauty Cross to every scout winning that award.
The first one that we are going to honor is the cousin of one of our
members, Prudence Primshock; a scout from Bridgeboro, New
Jersey, a star scout who has won the badge that stands for
humaneness in his troop—Walter Mincepie Harris—”
“Good night, he’s disguised as a mince pie,” Grove whispered to
Artie; “the plot grows thicker, as Roy would say.”
“Excuse me,” said Sympathea blushing, “I mean Walter Woods
Harris. I’m just a little nervous and (great and reassuring applause) I
hardly know what I’m saying. We all know that Boy Scouts are
heroes, that their hearts are always on the left, I mean on the right, I
mean they’re in the right place. Walter—Scout Harris, will you please
stand up and—”
“Hold while there is yet time!” came a voice from the rear of the
little lecture room. “Water Mincepie Harris is not what he seems! He
has disgraced the beloved mince pie and he is trying to deceive you
all!”
“It’s Grove Bronson!” shouted Pee-wee, jumping from his seat.