private boolean saveGame(File fout){
		DataOutputStream file;
		try{
			file = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(fout)));
		}catch(FileNotFoundException ex){
			return false;
		}
		try{
			//write status
			file.writeInt(score1);
			file.writeInt(score2);
			file.writeInt(level);
			
			//write options
			file.writeBoolean(gravExists);
			file.writeBoolean(gravVisible);
			file.writeBoolean(unlimitedLives);
			file.writeInt(numAsteroids);
			file.writeInt(startingLevel);
			file.writeBoolean(isSinglePlayer);
			
			//write players
			file.writeInt(player1.getX());
			file.writeInt(player1.getY());
			file.writeDouble(player1.getAngle());
			file.writeDouble(player1.getVX());
			file.writeDouble(player1.getVY());
			file.writeDouble(player1.getVAngle());
			file.writeInt(player1.getLives());
			if (player2 == null){
				file.writeInt(0);
			}else{
				file.writeInt(1);
				file.writeInt(player2.getX());
				file.writeInt(player2.getY());
				file.writeDouble(player2.getAngle());
				file.writeDouble(player2.getVX());
				file.writeDouble(player2.getVY());
				file.writeDouble(player2.getVAngle());
				file.writeInt(player2.getLives());
			}
			file.writeInt(bullets.size());
			for (Bullet bullet:bullets){
				file.writeInt(bullet.getX());
				file.writeInt(bullet.getY());
				file.writeDouble(bullet.getAngle());
				file.writeDouble(bullet.getVX());
				file.writeDouble(bullet.getVY());
				file.writeDouble(bullet.getVAngle());
				file.writeInt(bullet.getColor().getRGB());
				file.writeInt(bullet.getShooter());
				file.writeDouble(bullet.getDist());
			}
			file.writeInt(asteroids.size());
			for (Asteroid asteroid:asteroids){
				file.writeInt(asteroid.getX());
				file.writeInt(asteroid.getY());
				file.writeDouble(asteroid.getAngle());
				file.writeDouble(asteroid.getVX());
				file.writeDouble(asteroid.getVY());
				file.writeDouble(asteroid.getVAngle());
				file.writeInt(asteroid.getType());
			}
			if (rogueSpaceship == null){
				file.writeInt(0);
			}else{
				file.writeInt(1);
				file.writeInt(rogueSpaceship.getX());
				file.writeInt(rogueSpaceship.getY());
				file.writeDouble(rogueSpaceship.getAngle());
				file.writeDouble(rogueSpaceship.getVX());
				file.writeDouble(rogueSpaceship.getVY());
				file.writeDouble(rogueSpaceship.getVAngle());
			}
			if (alienShip == null){
				file.writeInt(0);
			}else{
				file.writeInt(1);
				file.writeInt(alienShip.getX());
				file.writeInt(alienShip.getY());
				file.writeDouble(alienShip.getAngle());
				file.writeDouble(alienShip.getVX());
				file.writeDouble(alienShip.getVY());
				file.writeDouble(alienShip.getVAngle());
				file.writeInt(alienShip.getLives());
			}
			
			file.close();
		}catch (IOException ex){
			return false;
		}
		return true;
	}