
-----------------------------------
newvegasfan01
Sat Feb 12, 2011 10:45 am

game not working
-----------------------------------
I created an asteroids game last summer and all of a sudden when I try to run it, it says that there is no main class so it won't run. Is there a reason why it says that any help is appreciated thanks

-----------------------------------
Insectoid
Sat Feb 12, 2011 11:10 am

RE:game not working
-----------------------------------
Are you missing a source file?

-----------------------------------
newvegasfan01
Sat Feb 12, 2011 11:13 am

Re: game not working
-----------------------------------
I don't think so because I haven't tried to run my game in a few months

-----------------------------------
ProgrammingFun
Sat Feb 12, 2011 11:26 am

RE:game not working
-----------------------------------
Maybe you should upload it so we can see what may be the problem...

-----------------------------------
newvegasfan01
Sat Feb 12, 2011 11:29 am

Re: game not working
-----------------------------------
here is my code
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import javax.swing.Timer;
import java.util.ArrayList;
import java.applet.AudioClip;
//import javax.sound.midi.Track;

public class astroids extends Applet implements KeyListener,ActionListener {
Image offscreen;
Graphics offg;
spacecraft player;
Timer gametimer;
boolean upkey,leftkey,downkey,rightkey;
boolean wkey,akey,skey,dkey;
ArrayList asteroidlist;
ArrayList bulletlist;
ArrayList debrislist;
AudioClip gunsound;
AudioClip explosion;
AudioClip music;

int score;
spacecraft player2;
int score2;
int level;
int bulletsfired;
int bulletsfired2;
String localhighscore;
file highscore;
boolean p2enabled;
boolean startscreen;
boolean pvpmode;

public void Init(){
    asteroidlist=new ArrayList();
   this.setSize(600,600);
      this.addKeyListener(this);
      gametimer=new Timer(20,this);
      player= new spacecraft();
      offscreen = createImage(600, 600);
      offg = offscreen.getGraphics();
     player.xpos= 250;
    player.ypos= 250;
   gunsound=getAudioClip(getCodeBase(),"laser80.wav");
   explosion=getAudioClip(getCodeBase(),"explode1.wav");
   music=getAudioClip(getCodeBase(),"freakynowclip2.wav");
    music.stop();
    music=getAudioClip(getCodeBase(),"WALK ALONE clip.wav");
    music.play();
    player2=new spacecraft();
         player2.xpos= 240;
    player2.ypos= 240;
              level=1;
    bulletlist=new ArrayList();
      debrislist=new ArrayList();
highscore=new file();
localhighscore=highscore.read;
startscreen=true;
pvpmode = false;
    asteroidlist.add (new astroid());
    }
public int stringtoint(String s){
    return Integer.parseInt(s);

}
public void Paint(Graphics g){
     offg.setColor(Color.BLACK);
    offg.fillRect(0,0,600,600);
    offg.setColor(Color.red);
    if (startscreen){
        offg.drawString("Asteroids",(int)300,(int)100);
        offg.drawString("Instructions",(int)300,(int)470);
        offg.drawString("1 Player Press:1",(int)300,(int)450);
        offg.drawString("2 Players Press:2",(int)300,(int)460);
        offg.drawString("3 Toggle PVP " + pvpmode,(int)300,(int)480);
        offg.drawString("",(int)300,(int)454); 
    }else{

    for (int index=0; index