abstract class Game extends Applet implements Runnable, KeyListener
MANIFEST FILE CODE
code:
Main-Class: GalacticWar
PS thanks a lot for helping me man. if you actually solve this problem... well... iunno i'll thank you.
gsquare567
Posted: Thu Dec 07, 2006 8:06 pm Post subject: (No subject)
whats with this wtd hasnt responded on the hour! is he sick or sumtin?
gsquare567
Posted: Sun Dec 10, 2006 2:32 pm Post subject: (No subject)
anyone???
gsquare567
Posted: Wed Dec 13, 2006 9:57 pm Post subject: (No subject)
ok, this is REALLY buggin me, so im just taking random guesses, hoping someone can help. so it says applet notinited, i thought, well maybe its the init method. well, here it is, i checked EVERYTHING i could, but there is something missing/incorrect. help! please!
code:
public void init()
{
backBuffer = new BufferedImage(screenWidth, screenHeight, BufferedImage.TYPE_INT_RGB);
g2d = backBuffer.createGraphics();
sprites = new LinkedList<AnimatedSprite>();
addKeyListener(this);
gameStartup();// implemented by subclass
}
and here is the method implemented by the subclass.
code:
void gameStartup()
{
// load sounds and music
music.load("music.midi");
shoot.load("shoot.au");
explosion.load("explode.au");
// load the health/shield bars
barFrame = new ImageEntity(this);
barFrame.load("barframe.png");
barImage[0] = new ImageEntity(this);
barImage[0].load("bar_health.png");
barImage[1] = new ImageEntity(this);
barImage[1].load("bar_shield.png");
// load powerups
powerupShield = new ImageEntity(this);
powerupShield.load("powerup_shield2.png");
powerupHealth = new ImageEntity(this);
powerupHealth.load("powerup_cola.png");
powerup250 = new ImageEntity(this);
powerup250.load("powerup_250.png");
powerup500 = new ImageEntity(this);
powerup500.load("powerup_500.png");
powerup1000 = new ImageEntity(this);
powerup1000.load("powerup_1000.png");
powerupGun = new ImageEntity(this);
powerupGun.load("powerup_gun.png");
// load the background
background = new ImageEntity(this);
background.load("bluespace.png");
// create the ship
shipImage[0] = new ImageEntity(this);
shipImage[0].load("spaceship.png");
shipImage[1] = new ImageEntity(this);
shipImage[1].load("ship_thrust.png");
shipImage[2] = new ImageEntity(this);
shipImage[2].load("ship_shield.png");
// load the bullet
bulletImage = new ImageEntity(this);
bulletImage.load("plasmashot.png");
// load the explosion
explosions[0] = new ImageEntity(this);
explosions[0].load("explosion.png");
explosions[1] = new ImageEntity(this);
explosions[1].load("explosion2.png");
// load the asteroids
for(int i = 0; i < 5; i++)
{
bigAsteroids[i] = new ImageEntity(this);
bigAsteroids[i].load("asteroid" + (i+1) + ".png");
}
for(int i = 0; i < 2; i++)
{
medAsteroids[i] = new ImageEntity(this);
medAsteroids[i].load("medium" + (i+1) + ".png");
}
for(int i = 0; i < 3; i++)
{
smlAsteroids[i] = new ImageEntity(this);
smlAsteroids[i].load("small" + (i+1) + ".png");
}
for(int i = 0; i < 4; i++)
{
tnyAsteroids[i] = new ImageEntity(this);
tnyAsteroids[i].load("tiny" + (i+1) + ".png");
}
// start in pause mode
pauseGame();
}
i checked that all files were written correctly, although i wasnt sure if a MIDI file's extension was mid or midi so i tried both, and neither worked, so i assume it doesnt matter. also, the au extension is for an AU file, and png is for PNG... so i know those are correct.
what could be the problem? just throw things PLEASE!
Neville
Posted: Wed Dec 13, 2006 11:40 pm Post subject: (No subject)
I would start by debugging as much as you can. Do you use an IDE with built in debugging? This way you could step through and see where it is failing. If not, try writing an output file with little messages to see how far along your init() goes before it fails. That way you can narrow down the problem. It's most likely an exception being thrown somewhere.