100% found this document useful (2 votes)
21 views

Instant ebooks textbook Beginning Game Programming with Pygame Zero: Coding Interactive Games on Raspberry Pi Using Python 1st Edition Stewart Watkiss download all chapters

Games

Uploaded by

kohtzsoyke5l
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
21 views

Instant ebooks textbook Beginning Game Programming with Pygame Zero: Coding Interactive Games on Raspberry Pi Using Python 1st Edition Stewart Watkiss download all chapters

Games

Uploaded by

kohtzsoyke5l
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Experience Seamless Full Ebook Downloads for Every Genre at ebookmeta.

com

Beginning Game Programming with Pygame Zero:


Coding Interactive Games on Raspberry Pi Using
Python 1st Edition Stewart Watkiss

https://ebookmeta.com/product/beginning-game-programming-
with-pygame-zero-coding-interactive-games-on-raspberry-pi-
using-python-1st-edition-stewart-watkiss/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Python PyGame and Raspberry Pi Game Development Sloan


Kelly

https://ebookmeta.com/product/python-pygame-and-raspberry-pi-game-
development-sloan-kelly/

ebookmeta.com

Python PyGame and Raspberry Pi Game Development 1st


Edition Sloan Kelly

https://ebookmeta.com/product/python-pygame-and-raspberry-pi-game-
development-1st-edition-sloan-kelly/

ebookmeta.com

Beginning Robotics with Raspberry Pi and Arduino: Using


Python and OpenCV - PDFDrive.com 1st Edition Jeff Cicolani

https://ebookmeta.com/product/beginning-robotics-with-raspberry-pi-
and-arduino-using-python-and-opencv-pdfdrive-com-1st-edition-jeff-
cicolani/
ebookmeta.com

The Lioness in Bloom Modern Thai Fiction about Women Susan


Fulop Kepner

https://ebookmeta.com/product/the-lioness-in-bloom-modern-thai-
fiction-about-women-susan-fulop-kepner/

ebookmeta.com
The City of Zirdai 1st Edition Maria V Snyder Snyder Maria
V

https://ebookmeta.com/product/the-city-of-zirdai-1st-edition-maria-v-
snyder-snyder-maria-v/

ebookmeta.com

Patient Reported Outcomes An Overview 1st Edition Annabel


Nixon Diane Wild Muehlhausen Willie

https://ebookmeta.com/product/patient-reported-outcomes-an-
overview-1st-edition-annabel-nixon-diane-wild-muehlhausen-willie/

ebookmeta.com

Dangerous Fun The Social Lives of Big Wave Surfers 1st


Edition Ugo Corte

https://ebookmeta.com/product/dangerous-fun-the-social-lives-of-big-
wave-surfers-1st-edition-ugo-corte/

ebookmeta.com

Small Steps To Big Reading Converting Non Readers Into


Readers 1st Edition Hozefa A Bhinderwala

https://ebookmeta.com/product/small-steps-to-big-reading-converting-
non-readers-into-readers-1st-edition-hozefa-a-bhinderwala/

ebookmeta.com

Transnational Advocacy Networks and Human Rights Law


Emergence and Framing of Gender Identity and Sexual
Orientation 1st Edition Giulia Dondoli
https://ebookmeta.com/product/transnational-advocacy-networks-and-
human-rights-law-emergence-and-framing-of-gender-identity-and-sexual-
orientation-1st-edition-giulia-dondoli/
ebookmeta.com
The Role of the Supreme Court in American Government and
Politics 1835 1864 Charles Grove Haines

https://ebookmeta.com/product/the-role-of-the-supreme-court-in-
american-government-and-politics-1835-1864-charles-grove-haines/

ebookmeta.com
Contents
1. Cover
2. Front Matter
3. 1. Creating Computer Games
4. 2. Getting Started with Python
5. 3. Pygame Zero
6. 4. Game Design
7. 5. Graphic Design
8. 6. Colors
9. 7. Tank Game Zero
10. 8. Sound
11. 9. Object-Oriented Programming
12. 10. Artificial Intelligence
13. 11. Improvements and Debugging
14. Back Matter

Landmarks
1. Cover
2. Table of Contents
3. Body Matter
Stewart Watkiss

Beginning Game Programming


with Pygame Zero

Coding Interactive Games on Raspberry Pi


Using Python
Stewart Watkiss
Redditch, UK

Any source code or other supplementary material referenced by


the author in this book is available to readers on GitHub via the
book's product page, located at www.​apress.​c om/​978-1-4842-
5649-7 . For more detailed information, please visit http://​www.​
apress.​c om/​source-code .

ISBN 978-1-4842-5649-7 e-ISBN 978-1-4842-5650-3


https://doi.org/10.1007/978-1-4842-5650-3

Apress standard
© Stewart Watkiss 2020

This work is subject to copyright. All rights are reserved by the Publisher,
whether the whole or part of the material is concerned, specifically the rights
of translation, reprinting, reuse of illustrations, recitation, broadcasting,
reproduction on microfilms or in any other physical way, and transmission or
information storage and retrieval, electronic adaptation, computer software,
or by similar or dissimilar methodology now known or hereafter developed.

Trademarked names, logos, and images may appear in this book. Rather than
use a trademark symbol with every occurrence of a trademarked name, logo,
or image we use the names, logos, and images only in an editorial fashion and
to the benefit of the trademark owner, with no intention of infringement of the
trademark. The use in this publication of trade names, trademarks, service
marks, and similar terms, even if they are not identified as such, is not to be
taken as an expression of opinion as to whether or not they are subject to
proprietary rights.

While the advice and information in this book are believed to be true and
accurate at the date of publication, neither the authors nor the editors nor the
publisher can accept any legal responsibility for any errors or omissions that
may be made. The publisher makes no warranty, express or implied, with
respect to the material contained herein.

Distributed to the book trade worldwide by Springer Science+Business Media


New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-
SPRINGER, fax (201) 348-4505, e-mail [email protected], or visit
www.springeronline.com. Apress Media, LLC is a California LLC and the sole
member (owner) is Springer Science + Business Media Finance Inc (SSBM
Finance Inc). SSBM Finance Inc is a Delaware corporation.
For my children Oliver and Amelia.

You are the inspiration in my life.


Introduction
This book is designed for anyone wanting to learn programming
through making fun games. It will also be useful for someone who
has already learned the basics of programming and wants to learn
how to add fun graphics and create their own games.

It is focused on making the games rather than teaching


programming theory. In this book, you're more likely to see code
on how gravity affects a missile’s trajectory rather than the most
efficient way to search through data. Even then the code is kept
simple as games should be more about playability rather than
complex physics.

The book starts with a simple text-based game to cover the basics
of programming in Python. It then quickly moves on to creating
simple graphical games in Pygame Zero. The book introduces
object-oriented programming to make it easier to make more
complex games. It also explains how you can create your own
graphics and sounds.

Throughout the book, you will get to apply the new techniques in
a variety of 2D games. As well as some new games, there are some
variations on class games including a space shooter game and
battleships.

The games are designed to run on the Raspberry Pi, although they
can be used on other platforms that support Python 3 with
Pygame Zero .

The games you make will be playable and hopefully fun to play.
They are only the beginning. If all you ever do is copy the code
from this book, then you are only going to learn so much, but by
adapting and improving these games, they can become more
enjoyable as well as helping you learn more than you ever will
from just typing out code that's written down for you. For each of
the games, there is a list of suggestions for you to develop the
games further.

All the code and resource files used in the book are available
from the page to accompany the book at
https://www.apress.com/gb/book/9781484256497 .
Acknowledgments
My family has been very supportive in my maker activities and
while writing this book. Thank you to my wife Sarah for her
support and to my children Oliver and Amelia who have been a
source of inspiration and help while writing the book. Oliver has
been particularly helpful in testing the games and giving me
feedback, and my daughter’s knowledge of music was a great help
while writing about making sounds.

I’d also like to thank the team behind the Raspberry Pi including
the Raspberry Pi Foundation and the community that has grown
around it. I’ve also been inspired by the work of Nicholas
Tollervey who created the Mu editor that is used throughout the
book and Daniel Pope who created Pygame Zero, without which
the book wouldn’t have been possible.

I’m also grateful to all the support from the team at Apress, to
Jessica Vakili for her support in putting the book together, and to
Sai Yamanoor for the technical review. There are also many other
people who helped to contribute through reviews and getting the
book production ready.
Table of Contents
Chapter 1:​Creating Computer Games
Inspiration Rather Than Imitation
Playing Games
Create the Resources
Development Cycle
Making Programming Enjoyable
Python and Pygame Zero
Compiled vs.​Interpreted
Choosing a Programming Environment
Summary
Chapter 2:​Getting Started with Python
Using the Mu Editor
Python Programming
Variables
Strings and Format
Lists
Dictionaries
Tuples
Conditional Statements (if, elif, else)
Simple Quiz Game
Loops – While, For
While Loop
For Loop
Forever Loop – while True
Changing Loop Flow – break and continue
Functions
Variable Scope
Refactoring the Code
Further Improvements
Summary
Chapter 3:​Pygame Zero
Pygame Zero Development
Compass Game
Required Files
Running Mu in Pygame Zero Mode
Adding a Background Image
Adding an Actor
Moving the Sprite Around the Screen
Making the Movements More Realistic
Keeping Game State
Detecting Collisions
Change in Direction
Keeping Score
Adding a Countdown Timer
Final Code for Compass Game Version 0.​1
Summary
Chapter 4:​Game Design
What Makes a Game Enjoyable?​
Challenging but Achievable
Choices and Consequences
Rewards and Progress
Likeable Characters
Storyline/​Historical Relevance
Educational
Takes an Appropriate Level of Time to Play
Inclusivity
Age Appropriate
Improving Compass Game
Updated Timer
Adding Obstacles
Adding a High Score
Try and Except
Summary
Chapter 5:​Graphic Design
Creating a Theme
File Formats
Bitmap Images
Vector Images
Useful Tools
LibreOffice Draw
Inkscape
GIMP
Blender
Create Using Code
Other Sources
Summary
Chapter 6:​Colors
Color Mixing
Bouncing Ball
Background Color Selector
Handling Mouse Events
Creating the Color Selector
Summary
Chapter 7:​Tank Game Zero
Vector Image of Tank
Creating a Dynamic Landscape
Calculating the Trajectory
Detecting a Collision
Complete Game Code
Improving the Game
Summary
Chapter 8:​Sound
Recording Sound Effects
Creating Artificial Sound Effects
Recording Audio on the Raspberry Pi
Connecting a USB Microphone
Using arecord
Audacity
Recording Sounds with Audacity
Creating Music with Sonic Pi
Downloading Free Sounds and Music
Adding Sound Effects in Pygame Zero
Playing Music in Pygame Zero
Piano Game Created with Tones
Summary
Chapter 9:​Object-Oriented Programming
What Is Object-Oriented Programming?​
OOP Classes and Objects
Creating a Class, Attributes, and Methods
Creating an Instance of a Class (Object)
Accessing Attributes of an Object
Terminology
Encapsulation and Data Abstraction
Inheritance
Design for Object-Oriented Programming
Matching Pairs Memory Game
Creating the Classes
Program File
Summary
Chapter 10:​Artificial Intelligence
Memory Game with AI
A Good Memory
Battleships
Summary
Chapter 11:​Improvements and Debugging
Additional Techniques
More About Pygame Zero
More About Pygame
Adding Fonts
Scrolling Screen
Reading from a CSV config file
Joysticks and Gamepads
Creating Arcade Games for Picade
RetroPie
Debugging
Error Messages
Check for Variable Names
Print Statements
IDE Debugging Tools
Rubber Duck Debugging
Performance
Space Shooter Game
Summary
Where Next?​
Appendix A:​Quick Reference
Pygame Zero
Useful Keywords
Actor (Sprite)
Background Image or Color
Sound Effects
Mouse Events
Keyboard Events
Displaying Text
Python 3
Lists
Dictionaries
Conditional Statements (if, elif, else)
Loops
Python 3 Modules
Random
Math
Time
DateTime
Appendix B:​More Information
Python
Pygame Zero
Pygame
Index
About the Author and About the Technical
Reviewer
About the Author
Stewart Watkiss

is a keen maker and programmer. He has


a master’s degree in electronic
engineering from the University of Hull
and a master’s degree in computer
science from Georgia Institute of
Technology.

He has over 20 years of experience in


the IT industry, working in computer
networking, Linux system administration, technical support, and
cyber security. While working toward Linux certification, he
created the web site www.penguintutor.com . The web site
originally provided information for those studying toward
certification but has since added information on electronics,
projects, and learning computer programming.

Stewart often gives talks and runs workshops at local Raspberry


Pi events. He is also a STEM Ambassador and Code Club
volunteer, helping to support teachers and children learning
programming.

About the Technical Reviewer


Sai Yamanoor

is an embedded systems engineer working for an industrial gases


company in Buffalo, NY. His interests, deeply rooted in DIY and
open source hardware, include developing gadgets that aid
behavior modification. He has published two books with his
Random documents with unrelated
content Scribd suggests to you:
The Project Gutenberg eBook of Rockabye,
Grady
This ebook is for the use of anyone anywhere in the United States
and most other parts of the world at no cost and with almost no
restrictions whatsoever. You may copy it, give it away or re-use it
under the terms of the Project Gutenberg License included with this
ebook or online at www.gutenberg.org. If you are not located in the
United States, you will have to check the laws of the country where
you are located before using this eBook.

Title: Rockabye, Grady

Author: David Mason

Illustrator: Temple

Release date: September 7, 2023 [eBook #71584]

Language: English

Original publication: New York, NY: Royal Publications, Inc, 1957

Credits: Greg Weeks, Mary Meehan and the Online Distributed


Proofreading Team at http://www.pgdp.net

*** START OF THE PROJECT GUTENBERG EBOOK ROCKABYE,


GRADY ***
Rockabye, Grady

by DAVID MASON

Illustrated by TEMPLE

When on Pru'ut, you must do as the natives


do—and that includes dying as they do!

[Transcriber's Note: This etext was produced from


Infinity July 1957.
Extensive research did not uncover any evidence that
the U.S. copyright on this publication was renewed.]
On the charts, it's P-1345-AZ, and a thin blue line marked with
cryptic letters indicates that a Mallor Lines cargo ship stops three
times in each local year. The Guide will tell you a little more; that it's
a small hot planet, covered with fern forests and swamps, and
inhabited by one of the innumerable primate-human species of the
universe. It was also inhabited, for a while, by one Terran, James
Grady.
The natives call it Pru'ut, which, freely translated, means "the world."
They refer to themselves as Kya, which means "people." James
Grady, being a realist, called it the Mudhole, and added a descriptive
adjective or two; but he did not find it nearly as unpleasant a place
as a few others in which he had been in the course of forty years of
wandering.
Pru'ut has no inclination, and only one season, which is rather like a
rainy August on Earth. When Grady arrived, he stepped from the
landing stage of the Mallor Lines' Berenice into six inches of gluey
mud; the sun was seldom out long enough to harden the surface of
Pru'ut.
"It's not an easy place," the departing agent, Jansen, told Grady.
"Rain, and heat, and getting along with the locals."
"Anything the matter with 'em?" Grady asked. He was watching the
tall, yellow-pale shapes of natives loading bales into the Berenice's
cargo slings.
"Nothing much," Jansen said. "Sane as any primitives. All kinds of
complicated rules and taboos, and naturally they'll get as mad as hell
at you if you scratch a single rule. Most of the data on that is in the
agent's notebooks. You add anything to the record that seems to be
worth putting down, the way the rest of us have."
"And if they get mad at you, they stop packing plants," the Berenice's
mate put in. "Which will make the Mallor Company mad at you, too.
This place is a regular bargain basement for drug materials. At least
eight different drug plants, all of them worth as much as uranium.
More, in some ways."
"Mm." The ex-agent picked up a handful of brown leaves from a
table. "This, for instance. It's a distant relation of coca. The natives
chew it for fun, but it's the source of a first class anesthetic. And this.
If your kidneys ever break down, the doctors use this stuff to keep
you alive. Kerosin, it's called. Anyway, you'll find price lists and
descriptive material in the files. You've worked for Mallor before,
haven't you?"
"Yes," Grady said. "I put in three years on Tengo, in Port City. Then I
quit for a while. Had something else to do."
"Oh? What?"
Grady's face cracked into a slight grin. "Little bit of an argument. The
Mutiny. I joined the local army, if you could call it that. I had my own
gun, so they made me a major on the spot."
"The Mutiny?" The Berenice's mate had heard of that brief and
savage war, in which a handful of settlers and local militia had
beaten off the troops of a powerful state, and had actually won. The
mate hastily readjusted his opinion of Grady upward. A trader's
agent was one thing; a man who had fought through the Mutiny was
something more than that. The mate opened his mouth to ask more
of the story; but the Berenice's air-horn cut him off with a long wail.
"Take-off in twenty minutes," the mate said, as the noise subsided.
"You ready, Jansen?"
The ex-agent nodded, and shook hands with Grady. "Good luck," he
said, and started for the ship, the mate following.
"Yeah," Grady said, closing the door of the agency. He had
completely put the Berenice out of his mind by the time the roar of
her departure split the wet air of Pru'ut. He was, in fact, well on his
way to settling down as a permanent resident by that time.
A year later, the Berenice had called twice, and her captain and mate
were calling Grady by his first name. He had also acquired a native
woman, who, in accordance with one of the innumerable customs,
could not call him by name at all. She referred to him as Kotasa,
which is a sort of title. He, also in accordance with customs, called
her Shallra, which was not her name, but that of her mother. Grady
was also extremely careful not to speak to her mother at all, because
of another custom.
Grady—Kotasa to his wife, and Shassa to the rest of the village—
fitted in well, better than any Terran had until his coming. Grady had
spent most of his life living in odd places and with strange people;
and had come to the conclusion that it was always a good idea to be
a conservative by local standards. He could recall, quite clearly, the
day he had found what was left of Steynert, who had tried to change
the dietary habits of the inhabitants of Kree.
By comparison with the Kree, the Kya were an easy people to get
along with. Their lives were not hard, since Pru'ut was a fertile world,
and full of food sources. The Kya farmed their garden patches,
fished, and hunted, and spent the remaining time gathering plants for
Grady and reciting endless and complex genealogies. Grady paid for
the plants with goods from the trade warehouse, and listened gravely
to the genealogies, making mental notes whenever anything was
mentioned that might be of practical use. He did not consider himself
as a collector of scientific information; he was a practical man, and
he selected information for practical ends.
Shallra was the best wife he had ever had, and Grady had lived on
several worlds. She spoke little, and when she did, it was direct and
to the point. She was affectionate, but, like most Kya,
undemonstrative. She had been brought up to consider that males
were equals, but that certain male privileges, such as the lodge
magics and the use of horn pipes, were inviolable. Grady had lived
on one world where men were considered very much superior to
women, and had found that the attitudes which result are not as
pleasant as they might seem. And lastly, Shallra was probably the
best cook on Pru'ut, if not the best on several worlds.
The Kya generally liked and trusted Grady, and, after two years, he
was almost one of them. Standing on the agency porch, in the weak
sunlight, he seemed to have acquired the same yellowish skin and
lean face, and he was dressed in the same loose kilt. Shallra came
out to stand beside him, and they looked like any other Kya.
"The sun," she said gravely. "There will be a dance tonight."
Grady nodded. "Like to see it," he said. "The dance, I mean."
"It is for men," Shallra said. "Koor," she pointed at the sun, "is a god
belonging to men. The women dance when the sky clears in the
night."
"Men's dance, eh?" Grady said, sucking on his pipe. "You're
probably right about it being all right for me to go. But I'd better
check with the Chief anyway."
He started down the log-paved walk, toward the Chief's house on the
other side of the village. He could see it clearly at the far end of the
long, muddy street, but it was necessary to walk along a twisting
detour, rather than directly toward it. There was an acre of ground in
the center of the village, filled with crumbling, empty huts, and no
Kya walked through this ground. It belonged to Sa'ahah, whose
ghost walked in a wide circle around the hut where a jealous rival
had speared him in his sleep.
The house was the usual Kya affair, on tall stilts, with painted signs
on its facade, but much more elaborate as befitted the Chief's
position. He was Anla-Who-Speaks-for-the-Ancestors. There were
several other kinds of chief, but it was Anla whom Grady consulted
before trying anything in the least unusual. Anla sat on his porch
now, regarding the sun through slitted eyes.
Grady greeted him in proper form, and Anla returned the greeting,
rising and bowing.
"Is there any reason why this person may not attend the dance of
Koor with his brothers on this night?" Grady asked.
Anla thoughtfully pulled his lower lip; then, nodding, he said, "No,
there is no reason not to."
Then Grady made the mistake. He made it in full view of Anla's
mother-in-law, who sat peering balefully out from her special room in
the corner of the Chief's house; and of Anla's wife, and of his wife's
innumerable relations, who were clustered on the porch. When
Grady saw their silent staring, he looked down at his feet, and he
saw what it was that he had done. Anla saw it too, and the two men
looked up again, and at each other, very gravely.

Grady did not say he was sorry. It would have been of no use
whatever. Nor did he point out that the sun came out so infrequently
that his mistake was one which could be excused. Among the Kya
there are very few mistakes which can be excused, and stepping on
the shadow of a chief is not one of them.
Neither did Anla make any reference to the long friendship between
them, because there would have been no point in doing so. Anla's
eyes grew darker, and the wrinkles at their corners deepened, but
his words were calm, the correct words for such a time.
"Your name was Shassa," Anla said. "You have broken the ghost-
cloak of the Chief, and your name cannot be Shassa. From this
place and this time I take back your name, Shassa, and you have no
name."
Grady did not say anything, because a Kya cannot hear the words of
a man without a name; besides, there was nothing to say, though a
great deal to think about. The Berenice was due in four days. Four
days during which a man without a name would have to avoid the
custom which decreed that such a man must be killed. Killed as soon
as possible, because each day he continued to live was a day which
must be removed from the calendar, a day on which no man's birth
date might be celebrated, or any animal killed for food, or any root
taken from a garden.
Grady turned, and walked slowly, with a stiff back, down the path
away from the Chief's house. To run, or to show fear, would be fatal;
the Kya were themselves in a state of shock at the thing which had
happened, and it would be an hour or more before they began to
prepare for what they had to do. Therefore, Grady held his spine
straight, feeling a cold spot between his shoulderblades where the
first iron-headed arrow might strike in.
Ahead of him, through the village, the silent children ran on light feet,
darting into the houses and out again—the children, who were the
bearers of news. He saw three of them dash toward the agency, and
enter it; and in a moment, as he came up the path, Shallra came out
on the porch, carrying a clay pot in her hands.
"You who were Kotasa," she said, "take this, and drink it to free me
of your name."
It was the standard form of divorce among the Kya, and if the eyes of
Shallra had not been bright with tears, Grady might have slipped. He
took the clay pot, but he did not drink, because he could smell the
faint and bitter odor about it, which was not the odor of the fruit wine
that it should have held.
"Why?" he asked her, quietly.
"Because it is an easier death than the knife and the arrow," she
said, and added, "When you were Kotasa, you were—a good man
for me. Drink the wine." She said it pleadingly. He shook his head.
"I am sorry," Shallra said, and there is nothing harder for a Kya to
say. But she added something even harder for a Kya woman to say;
his name, his proper name, which she had always known but could
never use. Then she walked away, and out of Grady's life, because
he was now a man without a name.
He set the pot down carefully on the agency's steps and went inside.
As he closed the door, there was a high, whistling noise, and a sharp
thud against the door planks. He did not need to look to know that an
arrow stood in its wooden panels.
Grady closed the heavy wooden shutters carefully, not even jumping
when a second arrow whickered through the last shutter as it swung.
He lit a table lamp and took the heavy, seldom-used rifle from the
wall. He did not need to check it; he had oiled and cleaned it once a
week for two years. Instead, he laid it on the table and took a book
down from a shelf.
"General Code of the Federation Authority," Grady read the words on
the spine, and opened it. "Extent of responsibilities of individuals on
mandated planets...."
Under the circumstances, Grady discovered, he could kill any
number of Kya if he were so inclined. The Authority would require a
full report, in quadruplicate, of the circumstances—and as another
arrow struck the door, Grady wondered wryly who would make out
that report.
Also, Grady was not in the least inclined to kill any Kya. If doing so
would have saved his life, he would have shot any number of them
without any particular qualms. But there were no reasons at all to
think that killing any of them would do Grady any good. And Grady
thoroughly understood why it was that they had to kill him. He was
no more angry with the Kya than he had been with the Imperial
Guards, five years before, when they had come up Kanno Hill with
their band playing and their bayonets gleaming. He could remember
how military and colorful they had looked, in comparison to the
overalled, grimy rabble who stood beside him; and how they had
come up that hill again and again, fewer of them each time, and the
band losing a bit of verve on the last. Grady's anger then had been
at the damned fool, whoever he was, who ordered those useless
charges; and his anger now was with himself, because it had been
his own mistake.
There was a growing murmur outside the agency. The villagers were
gathering in the street, and in the yards behind the building. There
was no way out now, and nowhere to go if there had been a way out.
Grady got up, and walked to the door. He opened the sliding panel a
crack and peered out.
The rain had begun again, and through its thin gray curtain he could
see the ranks of villagers, silent, standing around the house, along
the railings, and watching. The men stood in front, each holding his
weapons, his bow bent in his hands. There was Lahrsha, who had
been brother in the Lodge to Grady, and whose blood had been
mixed with his to seal the tribal bond. There was Ahl, whose small
son Grady had nursed through a bad week. There were Grady's
friends and neighbors and brothers, each with an arrow on the nock
for Grady.
"It's a queer thing to happen," Grady said to himself, aloud. The
sound of his own voice startled him; he had become so much a Kya
that to him a man without a name should not have a voice.
The arrows struck oftener now. Grady saw a small group of men
move away, and then return, carrying a short log.
The door, Grady thought. They'll break it down, and come in, with
their grave faces and their polite ways, and they'll cut my throat. And
it won't matter if I kill one or two or ten of them; they'll do it anyway.
They won't hear an argument, because they can't hear me at all,
without a name; they won't even hear any noise I make when they
finish me off.
The log had begun to beat against the door, with a steady thunder.
Grady opened a cabinet, and took out a jar of brown liquid. Quickly
he drank it and sat down, his face graying. His head fell forward on
his arms, and the book of regulations fell to the floor, atop the unfired
rifle.
The Berenice swung outward, riding home to port with an empty
hold. The Mallor Company would not be pleased, but there were
other jobs. And the mate, sitting across the messroom table from
James Grady, put the matter in its simplest terms.
"Just one of those things," the mate said. "You can't be blamed.
They'll take another agent without any fuss, I imagine."
"No doubt of it," Grady said. "Can't say I'm glad to leave, though. It
was a good place."
"I still don't get it," the mate said. "We came in and found you in the
agency, out cold with coca. The door was down, and arrows all over
the place. Why didn't they come in and dig a knife into you?"
"Customs and taboos," Grady said. "I took a chance on it, but I was
pretty sure I was right. Common sense—by their standards. Man's
asleep—his ghost is walking around. If you kill him in his sleep, you
free his ghost, which is very bad, very strong magic. So you have to
wake him up to kill him. And they couldn't wake me up; I was full of
that coca leaf, enough for a week."
*** END OF THE PROJECT GUTENBERG EBOOK ROCKABYE,
GRADY ***

Updated editions will replace the previous one—the old editions will
be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright in
these works, so the Foundation (and you!) can copy and distribute it
in the United States without permission and without paying copyright
royalties. Special rules, set forth in the General Terms of Use part of
this license, apply to copying and distributing Project Gutenberg™
electronic works to protect the PROJECT GUTENBERG™ concept
and trademark. Project Gutenberg is a registered trademark, and
may not be used if you charge for an eBook, except by following the
terms of the trademark license, including paying royalties for use of
the Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is very
easy. You may use this eBook for nearly any purpose such as
creation of derivative works, reports, performances and research.
Project Gutenberg eBooks may be modified and printed and given
away—you may do practically ANYTHING in the United States with
eBooks not protected by U.S. copyright law. Redistribution is subject
to the trademark license, especially commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the free


distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund from
the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only be


used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law in
the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name
associated with the work. You can easily comply with the terms of
this agreement by keeping this work in the same format with its
attached full Project Gutenberg™ License when you share it without
charge with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the terms
of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.

1.E. Unless you have removed all references to Project Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears, or
with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:

You might also like