Quantcast
Channel: I Teach History: Programming
Viewing all articles
Browse latest Browse all 51

Where We Are in Eclipse

$
0
0
So far we have just begun to scratch the surface of the Eclipse IDE.  Even though we just have a few lines of code, we've started exploring some new methods and new techniques.  As I mentioned, I am new to Eclipse as well, but with practice and trusting the process, we will do just fine.

Here's the code we have so far:

package com.version001.griff;

public class Game implements Runnable {

public static int width = 300;
public static int height = width / 16 * 9;
public static int scale = 3;

private Thread thread;
private boolean running = false;

public synchronized void start() {
running = false;
thread = new Thread(this, "Display");
thread.start();
}

public synchronized void stop() {
running = false;
try {
thread.join();
} catch (final InterruptedException e) {
e.printStackTrace();
}
}

public void run() {
while (running) {
}
}
}

Viewing all articles
Browse latest Browse all 51

Trending Articles