Game Suggestions

Some suggestions for the minesweeper game

To check whether the right button on the mouse has been clicked:

if ( e.getModifiers() == e.BUTTON3_MASK )

To declare a thread for the timer:

Thread   timer;

To initialize the timer thread:

timer = new Thread(this);

To get the time and use it in the run method:

public void run ( )
{
Date starttime = new Date();
Date currenttime;

...

while (true)
{
time = new Date();
s = Long.toString((time.getTime()-start.getTime())/1000);

...

try
{
Thread.sleep(10);
} catch ( InterruptedException e) {}

...


CS 200 Homepage

Last modified: Friday, 28-Feb-2003 10:14:32 EST