Introducing JavaScript Game Development : Build a 2D Game from the Ground Up 1st Edition Graeme Stuart download pdf
Introducing JavaScript Game Development : Build a 2D Game from the Ground Up 1st Edition Graeme Stuart download pdf
com
https://textbookfull.com/product/introducing-javascript-
game-development-build-a-2d-game-from-the-ground-up-1st-
edition-graeme-stuart/
OR CLICK BUTTON
DOWNLOAD NOW
https://textbookfull.com/product/introducing-javascript-game-
development-build-a-2d-game-from-the-ground-up-1st-edition-graeme-
stuart-2/
textboxfull.com
https://textbookfull.com/product/monogame-mastery-build-a-multi-
platform-2d-game-and-reusable-game-engine-jarred-capellman/
textboxfull.com
https://textbookfull.com/product/building-a-2d-game-physics-engine-
using-html5-and-javascript-tanaya/
textboxfull.com
https://textbookfull.com/product/introducing-game-theory-a-graphic-
guide-2nd-edition-ivan-pastine/
textboxfull.com
https://textbookfull.com/product/mobile-game-development-with-unity-
build-once-deploy-anywhere-1st-edition-jonathon-manning/
textboxfull.com
https://textbookfull.com/product/nature-spirituality-from-the-ground-
up-lupa/
textboxfull.com
Graeme Stuart
Introducing JavaScript Game Development
Graeme Stuart
Market Harborough, Leicestershire, United Kingdom
Part I: Drawing����������������������������������������������������������������������������������1
Chapter 1: HTML5 and the Canvas Element������������������������������������������3
HTML Primer���������������������������������������������������������������������������������������������������������3
Drawing to the Canvas������������������������������������������������������������������������������������������5
Style the Page to Highlight the Canvas�����������������������������������������������������������������7
Experiment with fillStyle���������������������������������������������������������������������������������������9
Rendering Text����������������������������������������������������������������������������������������������������10
More Shapes and Lines���������������������������������������������������������������������������������������13
Summary������������������������������������������������������������������������������������������������������������16
iii
Table of Contents
iv
Table of Contents
Chapter 9: Inheritance����������������������������������������������������������������������125
Set Up a Template���������������������������������������������������������������������������������������������125
Newton’s Laws of Motion����������������������������������������������������������������������������������127
A General-Purpose Mass Class�������������������������������������������������������������������������128
A Simple Approach to Inheritance���������������������������������������������������������������������133
Asteroids�����������������������������������������������������������������������������������������������������������134
The Ship������������������������������������������������������������������������������������������������������������137
Summary����������������������������������������������������������������������������������������������������������140
v
Table of Contents
Index�������������������������������������������������������������������������������������������������207
vi
About the Author
Graeme Stuart is a self-taught developer
with 15 years of experience building data
analysis tools and web-based applications
using JavaScript, Ruby, and Python. He has a
PhD in energy management, and much of his
programming skill was originally developed
to that end. He taught JavaScript games
programming to first-year undergraduates for
a while, and this book is the result. He now
mostly uses complexity science to encourage
a deep understanding of agile approaches
to software engineering and to justify his
outlandish research ambitions.
vii
About the Technical Reviewer
Aditya Shankar started programming in 1993
when he was first introduced to the world of
computers. With no access to the Internet or
online tutorials at the time, he wrote his first
game in GW-BASIC by painstakingly retyping
code from a book he found at the local library.
After graduating from the Indian Institute
of Technology Madras in 2001, he spent nearly
a decade working as a software consultant,
developing trading and analytics systems
for investment banks and large Fortune 100
companies, before eventually leaving his corporate life behind so he could
focus on doing what he loved.
A self-confessed technology geek, he has spent his time since then
working on his own projects and experimenting with every new language
and technology that he could, including HTML5. During this time, he
became well known for singlehandedly re-creating the famous RTS game
Command and Conquer, as well as Commandos: Behind Enemy Lines,
entirely in HTML5.
Apart from programming, Aditya is passionate about billiards, salsa
dancing, fitness, and personal development. He maintains a personal
website where he writes articles on game programming, personal
development, and billiards, and shares his popular game demos.
When he’s not busy writing or working on his own projects, Aditya
does consulting work with companies to help them launch new software
products and games.
ix
Introduction
This book provides a full set of exercises in which we will build a fully
functional HTML canvas game. Though not a direct clone, the game is
inspired by the 1979 Atari classic, Asteroids. The code is provided for you
and is introduced piece by piece over the various chapters of the book.
If you’d like to try Asteroids, or if you’ve never played it, the the modern
Atari version can be played at https://atari.com/arcade#!/arcade/
asteroids/play. I’ve made a few different gameplay decisions for the
game we create in this book, and I encourage you to attempt to adapt the
game in any direction you like as we go along, if you feel confident in doing
so. It’s all good practice!
Typically, each chapter introduces an area of game design in a generic
way, develops the ideas towards implementing an aspect of the Asteroids
game, and urges you to think about alternative approaches. Towards the
end of the book, the game will be complete, and you should have all the
skills necessary to build a quality game of your own.
During most of the exercises, you’re encouraged to be creative. Go
through the material provided, consider the challenges presented, and
explore the impact of modifying the provided code. There’s no “correct”
way to design a game like this—it involves making many decisions, and the
provided code is only one of thousands of possible ways to do it. So, please,
try it your way if you feel confident enough. That’s a great way to learn
something.
xi
PART I
Drawing
The HTML canvas element, true to its name, provides a blank canvas on
which we can draw our game. Drawing is a fundamental aspect of working
with the HTML canvas element, so in these first few chapters we will
explore how drawing works and learn the fundamentals necessary to draw
our own designs with simple lines and fills. We will also develop some of
the game elements necessary for our Asteroids game clone.
CHAPTER 1
H
TML Primer
HTML (HyperText Markup Language) documents describe content on
the web. When you access a web page, you’re typically downloading and
viewing an HTML document. HTML is a way to organize and add semantic
meaning to multimedia content (text, images, videos, and more) and to
link between documents in a “web” of information.
HTML5 is the current version of the HTML standard. The standard
was originally developed in the early 1990s and has evolved a little since
then. The modern standard allows for the extremely rich experience of
the modern World Wide Web. We’ll be working with the HTML canvas
3
© Graeme Stuart 2017
G. Stuart, Introducing JavaScript Game Development,
https://doi.org/10.1007/978-1-4842-3252-1_1
Chapter 1 HTML5 and the Canvas Element
element, so let’s create our first HTML document and add a canvas
element to it.
Create a file called exercise1.html and type in the basic HTML template
shown in Listing 1-1.
<!doctype html>
<html>
<head>
<title>This is an HTML canvas</title>
</head>
<body>
<h1>This is an HTML canvas</h1>
<canvas id="asteroids" width="400" height="400"></canvas>
</body>
</html>
4
Chapter 1 HTML5 and the Canvas Element
contents are to be rendered and how they behave. The <body> element
contains the content of the document and in this case includes a level one
header <h1> and a <canvas> element.
The <canvas> element provides a JavaScript API (application
programmable interface) for drawing simple shapes and lines. It’s this API
that we will use to render our game.
D
rawing to the Canvas
<script> elements contain JavaScript code that’s executed by the browser.
Add the <script> shown in Listing 1-2 into your document <body> after
the <canvas> element.
<script>
var canvas = document.getElementById("asteroids");
var context = canvas.getContext("2d");
context.strokeStyle = 'dimgrey';
context.lineWidth = 5;
context.rect(75, 75, 250, 250);
context.stroke();
// this is a comment, it has no effect!!!
</script>
You’ll need to reload the page in order for the script to run. The
script runs line by line once the page is loaded. The first line calls the
getElementById method on the global document object. The document
object is defined automatically and provides a programmable interface into
the entire HTML document. The document is loaded into memory as a
tree-like structure often referred to as the DOM (Document Object Model).
In this case we’re using getElementById to get a reference to the <canvas>
element within the DOM using the id value we specified in the HTML.
5
Chapter 1 HTML5 and the Canvas Element
6
Chapter 1 HTML5 and the Canvas Element
<style media="screen">
body {
text-align: center;
font-family: sans-serif;
}
7
Chapter 1 HTML5 and the Canvas Element
canvas {
background-color: black;
}
</style>
Styles allow us to control how the content of the document looks when
it’s rendered by the browser. In this case, we’re specifying that we want the
<body> element to be centrally aligned with a sans-serif font (this applies
to all child elements of the body element, as font-family is inherited by
default). We’re also specifying that <canvas> elements should be drawn
with a black background color. After reloading the page, you should see
something similar to Figure 1-2.
This allows us to see exactly where the canvas edges are and
understand that the rectangle is positioned as specified within the canvas.
I won’t cover styles much more in this book, but they’re a very powerful
technology providing exquisite control over how to render HTML content.
8
Chapter 1 HTML5 and the Canvas Element
9
Chapter 1 HTML5 and the Canvas Element
<script>
var canvas = document.getElementById("asteroids");
var context = canvas.getContext("2d");
context.strokeStyle = 'lightgrey';
context.fillStyle = 'dimgrey';
context.lineWidth = 5;
context.rect(75, 50, canvas.width - 150, canvas.height - 100);
context.stroke();
context.fill();
</script>
R
endering Text
The canvas treats text a lot like a collection of shapes. The outline can be
drawn with the context.strokeText method, or text can be filled with
the context.fillText method. Both methods must be passed a text
string and the (x, y) coordinates (in pixels) at which to render the text.
Before rendering text it’s useful to change the font from the default using
context.font.
Add the two lines in Listing 1-5 to your script.
It seems like nothing has happened, but actually, the text has been
drawn. The problem is that the fillStyle is still set to the same color as
the filled rectangle. The text color and the background color are the same,
so nothing visibly changes.
10
Chapter 1 HTML5 and the Canvas Element
<script>
var canvas = document.getElementById("asteroids");
var context = canvas.getContext("2d");
context.strokeStyle = 'lightgrey';
context.fillStyle = 'dimgrey';
context.lineWidth = 5;
11
Chapter 1 HTML5 and the Canvas Element
The changes are all in the second half of the script. We set the familiar
context properties to some sensible values (note the use of hexadecimal
color codes). We then set a new property context.textAlign to the value
"center". This tells the context to use the central point in the text as the
“anchor.” So, when we actually render the text, the central point in the
text is positioned at the x-coordinate we provide rather than the default
leftmost point. The final few lines set a message variable and draw the text.
First we fill it and then we draw an outline (experiment with swapping the
order of these method calls). This is just the same as before except this
time we’re calculating the x-coordinate rather than specifying a literal
value (such as 110, as before). In this case, we’re aligning the text centrally
on the horizontal axis so we divide the width by 2. See Figure 1-5.
12
Chapter 1 HTML5 and the Canvas Element
context.strokeStyle = '#FFFFFF';
context.lineWidth = 2;
context.beginPath();
context.arc(200, 140, 20, 0, Math.PI * 2);
context.moveTo(200, 160);
context.lineTo(200, 220);
context.moveTo(180, 300);
context.lineTo(185, 260);
context.lineTo(200, 220);
context.lineTo(215, 260);
context.lineTo(220, 300);
context.moveTo(240, 130);
context.lineTo(225, 170);
13
Chapter 1 HTML5 and the Canvas Element
context.lineTo(200, 170);
context.lineTo(175, 180);
context.lineTo(170, 220);
context.stroke();
The script starts by setting the stroke color to white and the line width
to 2 pixels. Then we see two new methods of the context object. The
context.beginPath method begins a new path or resets the current path.
We need to call this because we already had an active path left over from
when we drew the original rectangle. If we don’t call it (try commenting it
out), then we continue the original path, and a line will be drawn from the
rectangle to our first circle. You’ll learn more about paths in Chapter 2.
The circle is drawn using the context.arc method. This method
can be used to draw any circle or portion of a circle. The method takes
five arguments, as follows: the first pair of arguments includes the (x, y)
coordinates (in pixels) of the center of the circle. The third argument is
the radius of the circle, and the fourth and fifth arguments are the starting
angle and finishing angle of the arc (measured in radians). To draw a full
circle, these angles should be 0 and 2π. We access the value of π via the
Math.PI method. We’ll use the built-in JavaScript Math object extensively
in later chapters.
The remaining method calls are all either context.moveTo or context.
lineTo until we finally call context.stroke to draw the path. The context.
moveTo and context.lineTo methods both take two arguments, and in both
cases these are the (x, y) coordinates specifying a location on the canvas in
pixels. They each do exactly what you would expect. To move the “pen” to
a location without drawing a line, call context.moveTo. To draw a line from
the current location to the given location, call context.lineTo.
Follow the code line by line and see how each line of code is necessary
to draw the stick figure shown in Figure 1-6. Try removing or editing some
of the lines to see what happens. Play around until you can predict the
effect of a change.
14
Chapter 1 HTML5 and the Canvas Element
The final image should appear like Figure 1-7. Note how the position
in the code where you insert the new lines makes a difference. If you place
the new code after the context changes, the text outline will be drawn with
a thicker, white line.
15
Chapter 1 HTML5 and the Canvas Element
S
ummary
In this chapter we’ve had a very quick run-through of the basic
technologies we’ll be using to create our game. We’ve created our first
HTML document and viewed it in the browser, we’ve styled our document,
and we’ve written code to manipulate our canvas element.
We’ve seen that the HTML <canvas> element has a programmable
interface, and we’ve used HTML <script> elements with JavaScript code
to draw to the canvas. We’ve been introduced to some of the methods
available in the canvas context and used them to render a motivational
poster to the canvas. And we’ve seen that the interface gives us tools for
drawing lines and filling shapes and that we can control the thickness of
lines and the color of lines and shapes.
We learned a little about the coordinate system and how paths are
constructed. In Chapter 2, we’ll expand on this and try to get a deeper
understanding of how to master the art of drawing what we want on the
HTML canvas.
16
CHAPTER 2
Understanding Paths
Chapter 1 introduced some of the basic methods for drawing to the canvas.
This chapter presents a follow-up exercise that looks more closely at the
canvas coordinate system and explores how to construct paths. These
concepts are critical to understanding the canvas and designing your own
drawing code.
We’ll also start to add a bit more structure to our code. Complex code
can be difficult to comprehend—adding structure is the main way to keep
the complexity under control. Structuring code into functions allows
the development of simpler code that uses those functions. This chapter
introduces functions and goes through the process of refactoring, a crucial
skill that’s necessary to manage code of any complexity.
17
© Graeme Stuart 2017
G. Stuart, Introducing JavaScript Game Development,
https://doi.org/10.1007/978-1-4842-3252-1_2
Chapter 2 Understanding Paths
<!doctype html>
<html>
<head>
<title>More drawing to canvas</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>More drawing to canvas</h1>
<canvas id="asteroids" width="400" height="400"></canvas>
<script>
var canvas = document.getElementById("asteroids");
var context = canvas.getContext("2d");
// Grid drawing code goes here
</script>
</body>
</html>
body {
text-align: center;
font-family: sans-serif;
}
canvas {
background-color: black;
}
18
Chapter 2 Understanding Paths
context.strokeStyle = "#00FF00";
context.lineWidth = 0.25;
If you refresh the page, nothing is drawn. That’s because we’re still only
building a path and haven’t yet asked for it to be drawn. Repeat the same
pattern with the horizontal grid lines:
19
Chapter 2 Understanding Paths
Again, we’re drawing each horizontal line in turn from the left of the
canvas (x = 0) to the right (x = canvas.width). The y-coordinate starts at
0 and increases by 10 pixels each iteration until it reaches canvas.height.
Nothing is actually drawn to the canvas until we call context.stroke():
context.stroke();
This then draws the path onto the canvas, as shown in Figure 2-1.
20
Exploring the Variety of Random
Documents with Different Content
[Turning to the defendant.] Well now, the last of these
documents before the order was finally drawn up and issued, the
Court has already seen, because it was put in.
It is 1263-PS, RF-365, My Lord, it was in Jodl’s Document Book
Number 2, Page 104.
Will you look at the original, please.
There is an unfortunate omission from Page 110 in Dr. Exner’s
book, which I am perfectly certain is quite inadvertent. Will you look
at the document dated 15 October 1942?
My Lord, I think that is the first in your bundle. It is Page 110. It
is first in the single documents. It is Page 110 of Dr. Exner’s book,
and I apologize to him because I have just seen the marginal writing.
It was covered over before, and I had not seen it. I apologize.
My Lord, the...
It is a note, is it not, Witness, signed Warlimont, your deputy, 15
October. I think you will find it the second document in your file. I do
not want to read it all again because it has been read, but you see:
“The Proposal of the Amt Ausland Abwehr will be submitted as
Appendix 1.”
The Tribunal will find Appendix 1, in which he says—in which it
is suggested, under letter “A,” that sabotage troops who do not wear
uniforms should be court-martialed. You have said “no.” You have
given your reasons. I will not worry you about that any more. And
then “B”; members of sabotage units, who are in uniform but are
guilty of dishonorable activities are after capture to be put into
special confinement. Do you say that that does not go either?
And then, if you will go back to 15 October, just the second
paragraph down:
“The Chief of WR”—that is the Legal Department—“has
made a statement to the effect that the order was to be
drawn up in such a way that it will take into account our own
interests...”
Is it “our own interests,” Witness? “Take into account our own
interests”?
JODL: Yes, “our own interests.”
MR. ROBERTS: “...our own interests while considering the
future conduct of the war. In this way he wanted to avoid
repercussions which would run counter to our further
intentions. Sabotage is an essential part of conducting war
in time of total warfare; we ourselves have strongly
developed this method of fighting.”
And you write against that, do you, “But the English make much
more use of it”?
JODL: Yes, it is an undeniable fact that at that time of the war
the English made much more use of it than we.
MR. ROBERTS: Is that a reason for making a law, an order of
this kind, to try and discourage the English from using sabotage
detachments?
JODL: No, that is certainly not a reason. It is only a denial of the
statement that we had strongly developed this method of fighting;
hence my remark, “Yes, but the English to a much greater extent
than we.” That, of course, has nothing at all to do with the reason for
the order.
MR. ROBERTS: Then I am not going to take more time on that
particular document, except—have you got a document dated 14
October with 1, 2, 3, 4 at the end? I think it is on a separate page,
the 1, 2, 3, 4.
JODL: Yes.
MR. ROBERTS: It says:
“With the view in mind—to prevent the enemy’s fighting the
war by using sabotage troops—following questions have to
be clarified before formulating an order:
“1) Have we ourselves the intention of dropping sabotage
Units in the zone of rear echelons of the enemy, or also far
back in the interior?
“2) Who will drop more sabotage troops, the enemy or we?
“3) Can we establish the principle: Sabotage troops do not
conduct legal war; they are to be exterminated in the
fighting without mercy?
“4) Do we attach importance to first arresting the single
members of this group for interrogation by
Counterintelligence and not killing them immediately?”
These were the considerations which were discussed in your
office before the orders were drawn up.
JODL: These were questions—not points of view—questions
which were raised in the Armed Forces Operations Staff as a result
of the Armed Forces communiqué. Fortunately, the submission of all
these documents proves the complete correctness of everything I
said here 2 days ago. The staff, the Legal Department, and the
Ausland department racked their brains and pondered how they
could draw up the executive order implementing the Führer’s
additions to the Wehrmacht communiqué. Neither they nor I came to
any conclusion, and no proposal was made to the Führer; nothing
was done. That is what I stated here the day before yesterday, and
that is what, fortunately, you yourself have proved by submitting
these documents.
MR. ROBERTS: You have said, I think, that part of the Führer’s
order disgusted you?
JODL: Yes.
MR. ROBERTS: And you have said in your interrogation that
circulating this order was one of the things which went against your
inner conscience—one of the few things. “Your inner convictions”—to
use your actual words.
JODL: In the preliminary interrogation I said that it was one of
the few—or the only—order I received from the Führer which I, in my
own mind, completely rejected.
MR. ROBERTS: You rejected it, but these young men went on
being shot, did they not?
JODL: I have already described exactly how the commanding
generals at the front, vigorously supported by me, interpreted this
order in the mildest imaginable way in practice; actually, only very
few such incidents occurred, and I believe that most—at any rate,
nearly all that came to my knowledge—were highly justified, because
the fighting methods of those people were not methods of honest
soldiers.
MR. ROBERTS: You see, you talk about your “inner
convictions.” I think Keitel spoke about his “inner conscience.” But
should we have heard anything about these convictions and this
conscience if Germany had not lost the war?
JODL: No, but then we might have heard of the strangled at
Dieppe in a similar trial.
MR. ROBERTS: It is very late and—now, I just want to deal with
a few examples, very very quickly, of the order being carried out, as
you said it was only carried out a few times. I just, first of all, want to
refer to UK-57, which is Page 309 of Document Book 7, the German
copy Page 33—German copy Page 344. I am sorry, I had given you
the wrong number. I can read this out. It is a report which is initialed
by Keitel.
“On 16 September 1942”—mark the date, that is more than
a month before the Commando Order came into force—“10
Englishmen and 2 Norwegians landed on the Norwegian
coast, dressed in the uniform of the British Mountain Rifle
Regiment, heavily armed and equipped with explosives of
every description. After negotiating difficult mountain
country, they blew up important installations in the power
station Glomfjord on 21 September. A German sentry was
shot during the incident. Norwegian workmen were
threatened that they would be chloroformed if they resisted.
For this purpose the Englishmen were equipped with
morphium syringes. Seven of the participants have been
arrested. The others escaped into Sweden.”
Then follow seven names, which I read out to this Court, I think,
in January. They were shot on 30 October 1942. That would be, shot
as a result of the order which you circulated, although it was not in
existence when those men blew up that power station. You told me
some little time ago that that power station was a proper military
target. These men were in uniform. Can you begin to justify that?
JODL: No, I cannot justify that, and I will not justify it. I consider
it completely illegal, because this order could certainly not have been
retroactive; but I did not learn of this affair at the time. Of UK-57 I
read the first and second parts here for the first time; the third part I
read in April 1944.
MR. ROBERTS: Well, now, there are other exhibits dealing with
this matter which I am not going to put to you. They have been
referred to before, and I do not want to be cumulative. I would like
you—or perhaps I will ask you one question first.
I think it was laid down, was it not, that every action taken under
this Führer Order was to be reported in the Wehrmacht report?
JODL: Yes, that was ordered.
MR. ROBERTS: Yes, I just want to give you an example of the
Wehrmacht report.
526-PS, USA-502, My Lord, it is 7a, Page 15. It is dated 10 May
1943, German Page 21 of the small book.
[Turning to the defendant.] It is a notice from the “Q” branch of
your staff.
“On 30 March 1943 in Toftefjord an enemy cutter was
sighted. Cutter was blown up by enemy. Crew: 2 dead men,
10 prisoners.
“Cutter was sent from Scalloway (Shetlands) by the
Norwegian Navy.
“Arms: Two Colt machine guns, two mounted machine
guns, a small transmitter ... 1,000 kilograms of explosives....
“Purpose: Forming an organization for sabotaging strong-
points, battery positions, staff and troop billets, and
bridges....
“Führer order executed by the SD.
“Wehrmacht report of 6 April announces the following:
“In northern Norway an enemy sabotage unit was engaged
and destroyed on approaching the coast.”
That was false, was it not?
JODL: I confirmed this communiqué of 6 April which included
the contribution from the commander in Norway as I received it on 6
April; this brief formulation always originated with the commander at
the front. But what actually happened is set down in this note of 10
May which, most unfortunately, I never saw, because on 10 May
1943 I traveled by train to Bad Gastein to begin a cure for a severe
case of lumbago; and so, unfortunately, I saw this document for the
first time here in Nuremberg. I am sorry, because this would have
been one of the few cases in which I might have been able to
intervene.
MR. ROBERTS: Yes, but, Witness—keep it in front of you—
because you see the action was not taken on 10 May; it was taken
before, or on 6 April. Look at the last paragraph:
“Wehrmacht report of 6 April announces the following:
“...enemy sabotage unit engaged and destroyed on
approaching the coast.”
Whereas, in fact, they had been taken prisoner and then shot
like dogs by the SD.
JODL: Yes, I have just said that. Before this contribution of 6
April, I heard nothing about the whole matter, but only on the 10th of
May did it come to our knowledge, and then the Armed Forces
Operations Staff drew up this note. The whole investigation into
these events was made by the Intelligence Service, the office of
Canaris, together with its Security Police; it was not the SD; that is
wrong; it was the Security Police.
Unfortunately I did not know of these details; the Intelligence
Service knew them. I was concerned with the whole question only
because I had to edit the Armed Forces communiqué; otherwise I
would never have dealt with the Commando Order; I was quite
innocent of it.
MR. ROBERTS: Now I just want to show you one more
instance. It is 2610-PS.
It is, My Lord, in small Document Book 7a, Page 23, the
German small book Page 41.
Now, I want you to notice, Witness, this is the only document
which I rely on, which is not one of your own captured
contemporaneous German documents. This is a report from the
Judge Advocate General’s Department, United States Army. It
concerns 15 United States personnel who were shot under this
order. If you look at the second page:
“On the night of 22 March 1944, 2 officers and 13 enlisted
men of the Special Reconnaissance Battalion of the Army
of the United States disembarked from some United States
Navy boats and landed on the Italian coast near Stazione di
Framura. All 15 men were members of the United States
Army and were in the military service of the United States.
When they landed they were all properly dressed in the field
uniform of the United States Army and they had no civilian
clothes. Their mission was to demolish a railroad tunnel on
the main line between La Spezia and Genoa. That rail line
was being used by the German Forces to supply their
fighting forces on the Cassino and Anzio Beachhead
fronts.”
That was a good military target, that tunnel, was it not?
JODL: Yes, a military target, absolutely.
MR. ROBERTS: And all 15 men were shot because of the order
that you circulated...
JODL: I did not understand. The order which—which I
circulated; yes.
MR. ROBERTS: Which you circulated on the 19th of October.
You circulated a supplementary order to the Führer Order, the last
paragraph of which, I think, disgusted you. That is 503-PS.
JODL: It would be more correct to say “which you had to
circulate.”
MR. ROBERTS: I will take that question up in a moment. I do
not agree. I must not argue with you, but I must put some questions.
General Dostler, who ordered the shooting of those men, he
himself, you see, was also shot by sentence of this court martial.
I am going to turn now from the Commando Order and...
JODL: May I say something else about this document?
MR. ROBERTS: Yes, anything you like.
JODL: This incident never came to my knowledge; at least, I
have no recollection of it. As far as I know, it never appeared in the
Armed Forces communiqué, because General Dostler did not report
the incident to his commanding officer, Kesselring, who might have
been able to take, and might have taken, a different course in this
affair.
MR. ROBERTS: Why do you say that you had to circulate this
order? No man can compel another to circulate an order for murder,
unless he does it.
JODL: I have explained at length that this order could not simply
be interpreted as an order to murder, but that very serious and
justified doubts and considerations could arise with regard to
international law and with regard to the justness of this order. In any
case, you should have complete appreciation of such a delicate
situation, because even now, in my position here, I cannot say or do
as I like, and that exactly is what I experienced during these last 5½
years.
MR. ROBERTS: You could have refused. You could have said,
and the other generals could have said, could you not: “We are all
honorable soldiers. We will not publish and issue those orders”?
JODL: Certainly under other circumstances it might have been
possible, first, if at the time I had not had that conflict with the Führer,
and secondly, if the British Ministry of War had made my task a little
easier. However, these events and the statement made by the British
on the 2d of September put the Führer into a rage against which I
was powerless. How much I tried to resist, for that the document
itself is the best proof, because the threat of punishment and
detailed justification for it were directed against me personally.
THE PRESIDENT: Mr. Roberts, would that be a convenient time
to break off?
[A recess was taken.]
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