Wednesday, April 16, 2014

Where We Are in Eclipse

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) {
  }
 }
}

No comments:

Post a Comment