Get Learning C# programming with Unity 3D Alex Okita free all chapters
Get Learning C# programming with Unity 3D Alex Okita free all chapters
com
https://textbookfull.com/product/learning-c-programming-
with-unity-3d-alex-okita/
OR CLICK BUTTON
DOWNLOAD NOW
https://textbookfull.com/product/c-game-programming-cookbook-for-
unity-3d-2nd-edition-jeff-w-murray/
textboxfull.com
https://textbookfull.com/product/beginning-game-ai-with-unity-
programming-artificial-intelligence-with-c-sebastiano-m-cossu/
textboxfull.com
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/
textboxfull.com
https://textbookfull.com/product/developing-2d-games-with-unity-
independent-game-programming-with-c-1st-edition-jared-halpern-2/
textboxfull.com
https://textbookfull.com/product/game-programming-in-c-
creating-3d-games-creating-3d-games-sanjay-madhav/
textboxfull.com
https://textbookfull.com/product/deep-reinforcement-learning-in-unity-
with-unity-ml-toolkit-1st-edition-abhilash-majumder/
textboxfull.com
Learning C# Programming
with Unity 3D
Learning C# Programming
with Unity 3D
Second Edition
Alex Okita
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made
to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all
materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all
material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been
obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future
reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized
in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying,
microfilming, and recording, or in any information storage or retrieval system, without written permission from the
publishers.
For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://www.
copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400.
CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For organizations that have been
granted a photocopy license by the CCC, a separate system of payment has been arranged.
Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for
identification and explanation without intent to infringe.
v
vi Contents
8. Extended........................................................................................................................................ 579
8.1 What We’ll Be Covering in This Chapter ........................................................................ 579
8.2 Review .............................................................................................................................. 579
8.3 Readability .........................................................................................................................581
8.3.1 ?: Notation ..........................................................................................................581
8.3.2 If ........................................................................................................................ 582
8.3.3 Smell ................................................................................................................. 583
8.3.3.1 Comments ......................................................................................... 583
8.3.3.2 One Responsibility Rule ................................................................... 583
8.3.3.3 Duplicated Code ............................................................................... 584
8.3.3.4 Naming ............................................................................................. 584
8.3.4 What We’ve Learned ........................................................................................ 584
8.4 Git Revisited ..................................................................................................................... 584
8.4.1 Git Branch and Merge ....................................................................................... 585
8.4.2 Merge Conflicts ................................................................................................. 588
8.4.3 What We’ve Learned .........................................................................................591
8.5 Recursion ...........................................................................................................................591
8.5.1 A Basic Example ............................................................................................... 593
8.5.2 Understanding Recursion .................................................................................. 593
8.5.3 In Practice ......................................................................................................... 594
8.5.4 What We’ve Learned ........................................................................................ 601
8.6 LINQ ................................................................................................................................. 601
8.6.1 Lambdas and Arrays ......................................................................................... 601
8.6.1.1 A Basic Example .............................................................................. 601
8.6.2 Var ..................................................................................................................... 602
8.6.3 LINQ From ....................................................................................................... 603
8.6.4 Strange Behaviors in LINQ .............................................................................. 604
8.6.5 LINQ on Lists ................................................................................................... 605
8.6.6 Monsters Linq ................................................................................................... 608
8.6.7 What We’ve Learned .........................................................................................611
8.7 Reflection ...........................................................................................................................613
8.7.1 A Basic Example ................................................................................................615
8.7.2 Reflection MethodInfo .......................................................................................615
8.7.3 What We’ve Learned .........................................................................................618
8.8 Dynamic............................................................................................................................ 620
8.8.1 ExpandoObject ...................................................................................................621
8.8.2 Expando Reader ................................................................................................ 622
8.8.3 What We’ve Learned ........................................................................................ 623
8.9 Bitwise Operators ............................................................................................................. 624
8.9.1 Big Endian and Little Endian ........................................................................... 624
8.9.2 Signed or Unsigned ........................................................................................... 625
8.9.3 Bitwise Or | ....................................................................................................... 627
8.9.4 Enums and Numbers ......................................................................................... 627
8.9.5 Bitwise And & .................................................................................................. 628
8.9.6 Bitwise Exclusive Or ^ (xor) ............................................................................. 629
8.9.7 Setting Bitwise Flags ........................................................................................ 630
8.9.8 Bitwise Shortcuts | = and ^ = .............................................................................631
8.9.9 Bits in Numbers ................................................................................................ 632
8.9.10 Bit Shifting >> and << ..................................................................................... 632
8.9.11 What We’ve Learned ........................................................................................ 634
8.10 Attributes .......................................................................................................................... 635
8.10.1 A Basic Example ............................................................................................... 635
8.10.2 Custom Attributes ............................................................................................. 639
Contents xvii
This book was written as an answer for anyone to pick up a modern programming language and be pro-
ductive. You will be able to start a simple game in Unity 3D from scratch. By the end of this book, you
will have the basic skills to eventually become a capable unity game programmer, or at least know what
is involved with how to read and write some code.
You should have general computer skills before you get started. Come prepared; you’ll need a modern
Windows or OSX computer capable of running modern software with an internet connection. After this
book, you should be armed with the knowledge required to feel confident in learning more.
Each chapter has example code organized by chapter and section. We’ll try to make a fun project start-
ing with the basic functions of a typical game and we’ll see how the basic game can be expanded upon
and we’ll learn a bit about what’s involved with a larger project.
1.1 Why Read a Book: Why This Book May or May Not Be for You
You could go online and find videos and tutorials to learn; however, there is a disadvantage when it
comes to learning things in order and in one place. Most internet video or tutorial websites may gloss
over or dwell on a subject. You could skip ahead, but then what are you paying for?
Online content is often brief and doesn’t go into much depth on any given topic. It is incomplete or still
a work in progress. You’ll often find yourself waiting weeks for another video or tutorial to come out.
Just so you know, you should find the act of learning exciting. If not, then you’ll have a hard time con-
tinuing through to the end of this book. To learn any new skill, a lot of patience is required.
I remember asking an expert programmer how I’d learn to program. He told me to write a compiler.
At that time, it seemed rather unfair, but now I understand why he said that. It is like telling someone
who wants to learn how to drive Formula 1 cars to go compete in a race. In both cases, the “learning”
part was left out of the process.
It is very difficult to tell someone who wants to learn to write code where to begin. However, it all
really does start with your preparedness to learn. Your motivation must extend beyond the content of
this book.
You may also have some preconceived notions about what programming is. I can’t change that, but
you should be willing to change your thoughts on the topic if you make discoveries contrary to your
knowledge. Keep an open mind.
As a game developer, you should find the act of making a game, or simply learning how to make a
game, is just as fun as playing a game. If your primary goal is only to make that game that you’ve had in
your head for years, then you might have a problem. You may find this book a tedious chore if learning
C# is just something in the way of making your game.
Computer artists often believe that programming is a technical subject that is incompatible with
art. I find the contrary to be true. Programming is an art, much as literature and design are an art.
Programming just has a lot of obscure rules that need to be understood for anything to work.
No, programming is not too hard to learn. Writing a massive multiplayer online role-playing game
is quite hard. Learning how to write a simple behavior isn’t hard; like drawing, you start off with the
basics drawing spheres and cubes. After plenty of practice, you’ll be able to create a real work of art.
This applies to writing code, that is, you start off with basic calculations and then move on to the logic
that drives a complex game.
1
2 Learning C# Programming with Unity 3D
During my transition from artist to programmer, I found that there was very little by way of help, docu-
mentation, web pages, or similar to complete the transition from an artist to a programmer. Many people
assumed that you were either a programmer to begin with, or not interested in making that transition.
After a long discussion, with my then girlfriend—now wife, about what a variable is, I decided it was
time to write a book.
1.3.2 Logic
In 1848, George Boole gave us Boolean logic. It would take nearly a century between the Difference
Engine and the first general programmable computer to make its appearance. Thanks to George, today
our computers count in binary (1s and 0s), and our software thinks in terms of true or false.
In 1887, Dorr Eugene Felt built a computing machine with buttons; thanks to him, our computers have
keyboards. In the 1890s, a tabulating machine used paper with holes punched in it representing 1s and 0s
to record the US census. Back then it saved US$2 million and 6 years of work.
There was a moment in time where a trinary computer existed. In 1840, Thomas Fowler created a compet-
ing mechanical computer which worked with −1, 0, and +1. Even as late as 1958 an electronic version was
created in the Soviet Union, but its usefulness lost out to binary which was easier to build and used less power.
In the 1900s, between Nicola Tesla and Alexander Graham Bell, modern computers were imminent
with the invention of the transistor. In 1936, Konrad Zuse made the Z1 computer, another mechanical
computer like that of Babbage, but this time it used a tape with holes punched in it like the tabulating
machine. He’d later move on to make the Z3 in 1941.
Between the 1930s and the 1950s, Turing informed the computer scientists that computers can, in theory,
solve anything calculable, calling this concept Turing completeness. All of these components were lead-
ing toward our modern computer.
In the mid-1940s, John Von Neumann demonstrated, with the help of his theory, that the computer
can be built using simple components. In this way, the software that controls the hardware can add the
complex behavior. Thanks to Tesla and Bell, the Z3 was made completely of electronic parts. It included
the first use of logic while doing calculations, making it the first complete Turing-complete computer.
In 1954, Gordon Teal at Texas Instruments introduced the silicon-based transistor, a key component for
building solid-state electronics that are used today in every computer.
1.4.1 C# Paradigm
In poetry, a haiku follows a 5-7-5 syllable tempo. A sonnet follows an iambic pentameter with 10 syl-
lables per line and rhymes in a specific pattern. Not all prose needs to end in rhyme like haiku, but many
do. Rhyming and tempo are paradigms used in poetry.
Modern programming paradigms include object oriented, functional, imperative, and logic program-
ming. Some programming languages use one or more of these paradigms together. For instance, F# is an
imperative, object oriented, and functional language. However, Haskell is purely functional.
C# (pronounced “see sharp”) is a combination of many different paradigms. As the name infers, C#
is a C-style language and primarily expressed using the object-oriented paradigm. How C# expresses its
different paradigms, and how you choose to write with it, is greatly up to you. Due to this flexibility, C#
offers a variety of uses reaching far beyond game development.
You may have heard of C++, another multiparadigm language. It is often used by programmers
who need detailed control over memory management and many other aspects of their final product.
This attention to detail and design is required to produce a refined final product.
C# is an imperative language, that is to say, it carries out operations in order. It is also object oriented,
so each object is allowed to do things on its own. Finally, it is also memory managed, aka garbage col-
lected, so your computer’s memory is organized for you. However, it does provide the flexibility to man-
age memory if you require that level of control. Just as well, C++ has recently added garbage collection
features to match C#.
It’s no surprise that at this time many game engines would show up on the scene to cater to the mod-
ding community and the independent game developer. The large game engines found themselves top
heavy by focusing on large publishers. Companies such as RenderWare and Gamebryo found themselves
poorly positioned to compete against newcomers who focused on the independent developers such as
Unity 3D.
With the independent game developer in mind, many game engines focused on affordability and cross-
platform development. Tools such as Game Maker, Unreal Engine, and of course Unity 3D allowed
for many more people to learn and build games without the multimillion-dollar investment formerly
required for game production.
As new versions of .NET were introduced, the language that went along with it was also upgraded,
though with different version numbers. Confusing? Yes. Unfortunately, to add to the confusion there’s
also three versions of .NET that include .NET Standard, .NET Framework, and .NET Core. The differ-
ences between these have no effect on what we’ll be learning in this book, so I’ll leave that research up to
you to do on your own. For now, we’re not so concerned with the version of either so long as the features
we learn about the C# language work within the context of Unity.
C# is used by a large community of general application programmers, not just game engineers. Unity
3D is also a cross-platform game engine, and a developer working on either OSX or Windows can both
share and use files for Unity 3D. C# is the same on both Mac and PC as well as Android and iOS for
mobile, so there is no concern over what operating system you’re going to use.
When data is combined with logic and then written into a single file, it’s called a class. Classes are also
data and, as such, can be managed with more logic. Classes are used to create objects in the computer’s
memory and can be duplicated to have a life of their own.
Classes are used to build objects. Each piece of data within the class becomes a part of that object.
Different chunks of data inside of a class are called class members. Class members can also be chunks
of logic called functions or methods. If that is not clear right now, don’t worry we’ll go into detail on that
in Chapter 2.
Objects created from a class are called instances. In a game with a horde of zombies, each zombie is
duplicated or instanced from a zombie class. Each zombie has unique values for each attribute or data
element in the class. This means hit points and positions are unique for each duplicate zombie object.
Similar to families, objects can inherit properties from one another. The child, sometimes called a
subclass, inherits attributes from its parent. For instance, the child created from a zombie may inherit
the parent’s hunger for brains. To be useful, the child zombie can also add new objects and change the
objects it inherited from its parent class. As a result, now the child zombie might have tentacles that the
parent didn’t have.
Objects talk to each other through events and messages. Shooting at zombies can create an event, or
in programmer terms, it “raises” an event. The bullet impact event tells the zombie class to then take
necessary steps when hit by a bullet. Events command the class to take actions on its data, which is where
functions come in.
Functions, also known as methods, are sections of logic that act on data. They allow your class to cre-
ate additional events and talk to yet more objects. As the player presses the trigger and moves the joystick
around, yet more events can be raised and messages can be sent. Events and messages allow the player
to interact with your world; logic events and objects together build your game.
A basic game might have several different classes, each one named according to its purpose. Each one of
these classes contains the text that is your actual C# code. Just so you know, by default Windows will hide
the extensions of your files. As a result, if classes appear as simply Weapon or Monster and there is no exten-
sion.cs, then you should go into the Tools menu, select Folder Options/View, and enable file extensions.
As an exercise, we’ll be building a simple game involving monsters and shooting. We’ll start with a
basic skeleton with simple object classes and simple movement behaviors. From this we’ll build on some
basic events when the player presses keys, moves the mouse, and shoots at targets.
1.5.3 Iteration
Programming is an iterative process. It’s irregular to write an entire class or function without test-
ing it many times. The general flow is to write a part of a function, test it, add a bit more, test again,
and repeat until the function accomplishes its goal. Even then, many functions often work together in
sequence. Often, you’ll write a function, verify that it’s working, write another function, and verify some
more. Then you’ll have them work with one another and test again, all the while you’ll be changing and
re-arranging your code to fix mistakes.
Most of the time you’ll start off with a bunch of placeholders until you get around to finishing your
code. As you’re adding features and finishing code, you’ll have chunks of work that aren’t finished.
This is a part of game development and a part of learning as well.
The combination of the central processing unit (CPU) and operating system is often called a platform.
Each platform requires a unique native machine code to execute or run. Building code for each platform
is called a target. Unity 3D converts the bytecode into a native machine code and can target Mac, PC,
Android, and iOS.
Native machine code is the set of instructions that directly talk to the CPU and operating system (think
of the holes punched into a card and fed to a machine). Unity 3D is a simple way to generate the complex
set of instructions for your computer to run. Code that talks directly to the hardware is referred to as
“low-level” programming.
There are layers of software between you and the computer’s hardware. When writing C# for games
using Unity 3D, your code is compiled by .NET. Unity 3D then takes the bytecode from .NET and com-
piles a target platform into a native machine code.
Both Unity 3D and .NET are the layers underneath your code and the computer’s hardware, putting
you on a higher level. This is often referred to as a computer layer abstraction. That is why C# is usually
considered a high-level programming language.
Programming at a lower level requires much more knowledge of memory management and a wide
variety of other APIs that might include graphic cards, physics, sound, and everything else that runs a
game. Writing for a layer involves an in-depth knowledge of both the layers below and above the one
you’re writing for.
The computer hardware, such as CPU, graphics card, memory, and storage, live on the lowest level.
Above them is the basic input/output system (BIOS) and software that starts the hardware when you
press the Power button. Above that is your computer’s operating system and drivers that talk to the hard-
ware. Finally, Unity 3D lives above the operating system and your code lives above Unity 3D.
That is why we’re going to use Unity 3D to write games and not start from scratch in raw C++.
Otherwise, we’ll have to spend a few years learning about physics, rendering, and assembly language or
the instruction set that your CPU uses to operate.
In the short-story our author excelled, but here too his tendency was
not toward plot. The objectivist in fiction tends toward the
impressionistic sketch, and Chekhov was a master in sensing a
mood outside of himself and relentlessly reproducing the impression.
Of “Darling,” Tolstoi has said that the author intended to laugh at
Darling, sneer at her self-sacrifice; but in spite of his plan he had
created a character of beauty.
Olenka Plemyannikof, the daughter of a retired “college assessor,”
cannot live unless she is loving some one. She loves her father, her
mother, her relatives, and when at school she had fallen in love with
the French-master. Observing her rosy cheeks and kind expression,
and the naïve smile playing on her face when she is pleased, every
one feels attracted to her, and frequently women stop in the midst of
a conversation and grasp her hand, exclaiming, “You darling!”
Koukin, manager and proprietor of the Tivoli pleasure gardens,
occupies the wing in the Plemyannikofs’ house. Troubles connected
with rainy evenings, when his audiences are small, touch Olenka’s
kind heart, and she stays awake at night until he comes home, so
that she may smile encouragement through her window. At length
they marry, and their life runs smoothly, Olenka helping her husband
in many ways. Her radiant face alone draws people, and she tells
them that the theatre is the greatest thing in the world. “What a
wonderful man you are!” she says adoringly to her husband. But
when on a business trip to Moscow Koukin dies; and Olenka feels
then that the end of the world has come for her.
Three months after, returning from church one day, she meets Vassili
Andreyich Pastovalof, manager of a timber merchant’s yard, and he
tells her that she should bear submissively the fate which God willed.
His grave voice stays in her memory—and shortly afterward they are
married. They live happily, and now it seems to Olenka that she has
been in the timber trade all her life. She echoes her husband’s
opinions—whatever he thinks, she thinks, wherever he wants to go,
or not to go, she does the same. When her friends suggest
recreation, her reply is, “I and Vassichka have no time to frequent
theatres. We are business people, with no time for trifles. Besides,
what good is there in theatres?”
Thus they live harmoniously for six years. But one cold morning,
after drinking some hot tea, Pastovalof steps into the yard without his
hat and catches a chill. Four months later Olenka is again a widow.
Not till six months after her husband’s death does she remove her
weeds and open the house shutters, so great is her grief. Then it is
rumored that she takes tea with a regimental veterinary surgeon,
Smirnin, who occupies one of the wings of her house. He is
separated from his wife, but contributes to his son’s support. Olenka
becomes absorbed in this new interest, for she cannot live without
lavishing her affection on some one. Their happiness is interrupted
by Smirnin’s being called away with his regiment; and now the
woman is once more desolate.
The years pass and Olenka is entirely without fixed opinions, has
nothing to speak about, so she grows old-looking and dormant. She
has nothing to reflect. But one night Smirnin comes back. He has
retired from the army, is reunited with his wife, and wants to settle
down in the town. Olenka offers him her house free to live in, saying
that the wing is quite enough for her; so the man and the woman and
their child come to Olenka’s house. And in the little boy she finds an
object to love, even taking him into her own rooms, where they play
and study together. Then Olenka develops opinions on education,
and grows young again.
Master of an alert, firm style, and skilled not only in penetration but in
effective expression, Chekhov has a place in Russian literature
which is less difficult to designate than is usual in the case of one
only a few years dead. Certainly his themes are neither big nor vital
enough, nor yet sufficiently human, to accord him position beside the
philosophical Tolstoi, the titanic Turgenev, and the iron-hearted
Dostoevski (a greater novelist than short-story writer). Rather do his
workmanship, power of characterization, and subtle, sardonic humor
point to a solitary niche close to the grim and morbid Andreev. His
appeal—always intellectual—to his own people is tremendous, and
in Germany his vogue is still important. It seems safe to say that
among Russian fictionists he stands in the first rank of the second
company.
To represent Chekhov’s work, I have chosen “In Exile,” which follows
complete in a new translation, because, while it exhibits all his
mature characteristics, it is less unpleasant on the one hand and on
the other less trivial than many of his other short-stories. But of its
qualities the reader may now judge.
IN EXILE
By Anton Chekhov
Old Simon, nicknamed Wiseacre, and a young Tartar, whom no one
knew by name, sat on the river-bank before a bonfire. The other
three ferrymen were in the hut. Simon, a man of sixty, gaunt and
toothless, but broad of shoulder and still hale in appearance, was
drunk. He had meant to go to sleep long ago, but there was a flask in
his pocket, and he feared that his comrades in the hut might ask him
to pass it around. The Tartar felt ill and tired; shivering in his rags, he
was recounting what a comfortable home he had had in his native
province, and what a handsome, clever wife he had left there. He
was hardly more than twenty-five years old, but now, before the
blaze of the bonfire, his pale, melancholy face seemed to be that of a
mere lad.
“It’s no paradise here, to be sure,” Wiseacre agreed with him. “You
can see for yourself: water, bare banks, and everywhere clay—
nothing more.... Holy Week has passed, there’s ice on the river, and
only this morning it snowed.”
“It’s miserable! Miserable!” said the Tartar, as he glanced round him
in terror.
Some ten paces away flowed the dark, cold river. It seemed to
grumble as it noised its way past the corroded clay bank and rapidly
bore itself onward somewhere towards the distant sea. At the very
edge of the bank there rose the dark, massive form of a barge, the
kind called karbass by the ferrymen. Looking in the distance towards
the opposite bank, one could see numerous fires, flaring and
retreating, and resembling so many leaping serpents. It was the
burning of last year’s grass. And beyond the fires, again darkness.
The sound of floating ice beating against the barge could be heard. It
was damp, cold....
The Tartar glanced up towards the sky. There were just as many
stars here as at home, and the same surrounding darkness; yet
there was something lacking. Somehow, at home, in the Simbirsk
province, there were no such stars and no such sky.
“It’s miserable! Miserable!” he repeated.
“You’ll get used to it!” said Wiseacre, and laughed. “You are still in
your teens, and silly. Your mother’s milk hasn’t as yet dried upon
your lips. Of course it seems to your foolish mind that there is no one
more miserable than you; but the time will come when you yourself
will say, ‘May God grant every one such a life!’ Now, look at me. In
another week the water will be normal again; I shall take charge of
the ferry-boat; you will go jaunting through Siberia, while I shall
remain here and resume making my way from bank to bank. I’ve
been doing it twenty-two years, night and day. The pike and the
salmon under the water; I above it. And thank God for that! I want
nothing. May God grant every one such a life!”
The Tartar threw more brushwood into the fire, and, moving closer to
it, said:
“I have an ailing father. When he dies, my mother and my wife will
join me here. They have promised.”
“What do you want with a mother and a wife?” asked Wiseacre.
“You’ll repent it, brother. It’s the devil that’s putting you up to it, curse
his soul! Don’t listen to him, the accursed one! Don’t give in to him.
When he gets your mind on women, just spite him; tell him, ‘I don’t
want them!’ When he talks freedom to you, get stubborn; tell him, ‘I
don’t want it! I want nothing—neither father, nor mother, nor wife, nor
freedom, nor house, nor anything! I want nothing, confound their
souls!’”
Wiseacre took another gulp from his flask, and continued:
“Now, look at me, brother. I am not a simple muzhik, but a sexton’s
son, in fact; and when I lived in freedom in Kursk I wore a frock-coat;
but now I’ve gotten so that I could sleep naked on the ground and
eat grass. And God grant every one such a life! I want nothing, and I
fear no one. I’m on good terms with myself, and I cannot imagine
any one richer and freer than I. When I was banished from Russia, I
insisted from the very first day: ‘I want nothing!’ The devil he talks to
me of wife, and of home, and of freedom; and I back at him: ‘I want
nothing!’ I insisted on mine, and, as you see, I live well, and do not
complain. Give way to the devil but an inch, and you are lost. There’s
no deliverance, you sink into the bog over your very head, and
there’s no getting out. Not alone your brother, the stupid muzhik; but
nobles and educated men are lost. Some fifteen years ago they sent
here one of that gentry. He didn’t share some property with his
brothers, tampered somehow with a will. They say he comes from
the dukes or the barons—or perhaps he is only an official—how
should one know? Well, this gentleman arrived here, and the first
thing he did was to buy himself a house and some land. ‘I intend,’ he
said, ‘to live by the sweat of my brow, because,’ he said, ‘I am no
longer a gentleman, but a convict.’ ‘Well,’ said I to myself, ‘may God
help him, he means well!’ He was at that time a fussy, bustling young
man; did his own mowing and now and then caught fish, and rode
sixty versts a day on horseback. That was his one misfortune. From
the very first year he made trips to Girino, to the post-office there.
Times were and he would be on my ferry-boat, sighing: ‘Ah, Simon,
it’s rather a long time since they have sent me money from home!’
‘There’s no need,’ I’d go on telling him, ‘of money, Vassili Sergeyich.
What good is it? Throw it aside,’ I argued with him. ‘All that’s gone
by; forget it as if it never were; as if you had only dreamt it; and begin
life anew. Don’t listen,’ I said to him, ‘to the devil. It’ll lead to no good;
it’ll only draw a noose around your neck. Now it’s money you want,
and later it’ll be another thing—there’s no end to it. If it’s happiness
you seek, first of all desire nothing. Yes.... If,’ I said to him, ‘fate has
treated you and me badly, there’s no begging charity of her, no
falling at her feet; rather should one treat her with scorn and laugh at
her—then she too will laugh.’ So I spoke to him.... Two years later I
ferried him over to this side—and he all overjoyed and laughing. ‘I
am going,’ he said, ‘to Girino to meet my wife. She has taken pity on
me,’ he said, ‘and is coming out here. She’s a fine woman, good-
hearted.’ He almost choked from happiness. The next day he
brought his wife. She was young, handsome, in a pretty hat; and in
her arms a girl baby; and all sorts of baggage with her. As to Vassili
Sergeyich, he fussed around her, couldn’t stop feasting his eyes on
her or stop raving about her. ‘Yes, brother Simon, even in Siberia
people live.’ ‘All right,’ I said to myself. ‘Don’t be too sure of that.’
And from that time on, mark it, he began to make weekly visits to
Girino: to see if any money had come from Russia. He needed no
end of money. ‘She,’ he said, ‘is sacrificing her youth and beauty in
Siberia for my sake, and is sharing with me my bitter lot; and
therefore,’ he said, ‘I should give her every possible pleasure.’ ... To
make it cheerful for her, he started up an acquaintance with the
officials and with all sorts of trashy people. Well, all this company
had to be furnished food and drink; then a piano had to be had, and
a shaggy little dog for the sofa—the deuce take it!... In a word,
luxury, extravagance! She did not live long with him. How could she?
Here she saw only mud, water, cold, no vegetables or fruits, and all
around her uneducated people, full of drink, and without manners—
and she a spoiled lady from St. Petersburg.... Naturally, she grew
sick of it. And the husband too was no longer what he had been, but
a convict.
“It was one Assumption Eve, three years later, that I remember some
one shouting from the opposite bank. I crossed over, and whom
should I see but the lady herself, all wrapped up—and with her a
young gentleman, one of the officials. A troika!... I ferried them over
to this side; the troika was ready; ah, but you should have seen them
fly! Hardly the wink of an eye and there was not a trace of them.
“And in the morning Vassili Sergeyich came running here. ‘Simon,
has my wife passed this way with a gentleman in spectacles?’ ‘Yes,
she did pass this way,’ I said to him. ‘Go and seek the wind in the
fields!’ He gave chase to them, but returned in five days. When I
ferried him across to the other side, he threw himself down in the
bottom of the boat, and began to beat his head against the planks
and to whine. ‘What else had you to expect?’ I said to him. I laughed
and reminded him: ‘Even in Siberia people live!’ But he only beat his
head the harder.... Then he began to hanker after freedom. He heard
his wife was in Russia, and of course he wanted to go there and to
take her away from her lover. Almost every day he would go to the
post-office or to the government offices. He presented petition after
petition, begging for pardon and for permission to return home. He
told me he had spent a couple of hundred rubles on telegrams alone.
He sold his land, while he mortgaged his house to Jews. He grew
gray and bent; his face yellow—a consumptive, in fact. Speaking to
you, he would always go: khe-khe-khe ... and his eyes full of tears.
For eight years he kept on handing in those petitions, but after that
he had come to life and grown jolly again. You see, he had thought
of another luxury. His daughter had grown up. And he feasted his
eyes on her and didn’t get enough of it. She really was an attractive
girl—pretty, black-browed, and rather spirited in manner. Every
Sunday he’d take her with him to Girino to church. They’d stand
hand in hand on the ferry, and he not taking his eyes from her. ‘Yes,
Simon,’ he would say, ‘even in Siberia people live. Even in Siberia
there is happiness. Just look what a daughter I’ve got! You can’t find
another like her if you seek a thousand miles around!’ The girl, as I
said, was really a beauty.... But I thought to myself: ‘Just wait....
She’s a young girl; the blood tingles, and one wants to live, and what
sort of life is to be had here?’ And, comrade, to make the story short,
she really began to ail.... She got to coughing, and coughing, to
pining away; and now she is very sick, can hardly stand on her legs.
Consumption! There’s your Siberian happiness for you—the deuce
take it!—that’s how even in Siberia people live.... Now he’s begun to
chase after doctors, and to bring them back home with him. Let him
but hear there’s a doctor or a healer within two hundred or three
hundred versts, and off he goes after him. It’s terrible to think how
much money he has spent on doctors. I’d rather drink up the
money.... She’ll die, any way. She’ll die, there’s no gainsaying that,
and then he’ll be lost altogether. He’ll hang himself from sorrow, or
he’ll escape to Russia—and then you know what will happen. He’ll
be caught, sentenced to hard labor; he’ll taste the knout....”
“That is well,” murmured the Tartar, trembling with cold.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com