Second Summer 2002

Lecture Notes Thirty-One: A Video Game in Java: The Alien Landing Game
What do we do today? We build a computer game.

Why do we do that? It's exciting, and we want to write such a game ourselves by the end of the semester.

A simpler one. Yes, but seeing a slightly more complicated one first would help us in getting the prototype clear in our minds.

Alright, let's go for it. Very good. The mechanics is simple, as you will see.

The understanding of it is less trivial. Trivial here (and in mathematics, in general) means "relating to or being the mathematically simplest case". Or commonplace.

You need five files: You will also need a directory of images, called image). Here's a list of the images:
In terms of URLs we have (for the source code)
As for images their addresses are:

Copy each file to your desktop, then compile them, one by one. Use emacs (installation notes indexed in the main page). Bring each Java file in emacs, look at it, compile it. Or do it from the command line.

Why do we need so many files? The game we'll write in class before the end of the semester will be much simpler, but I want you to see what a reasonably nice game looks like.

And you also need an HTML file like this: Yes, this loads the applet in the browser.
    <title>Alien Landing</title>
  <body bgcolor=white>
    <applet code=GameManager.class width=240 height=300>

Then what you do? Run it.

How does it look? It should look like this.

By the way, you also need an audio file. Oh, here it is:

For a thorough understanding of this program I recommend the following sequence of notes:

Basic Java
Java Fundamentals. A Bit Outdated.
Using Objects for Animation
Animating Sprites
Adding Interactivity
Bitmap Loops
Creating Birmap Loops
A Video Game
Building a Video Game
After this, the next logical step is the program presented above.

Last updated: Jul 31, 2002 by Adrian German for A201