public void init() {

		eCount = 0;
		sCount = 0;
		dCount = 0;

		ac = getAudioClip(getDocumentBase(), "sounds/mystery.wav");
		acFall = getAudioClip(getDocumentBase(), "sounds/end.wav");
		acShot = getAudioClip(getDocumentBase(), "sounds/laser.wav");

		score = 0;

		// add keyboard listener
		addKeyListener(this);
		addMouseListener(this);
		addMouseMotionListener(this);

		// prepares the double buffered image
		offScreenImage = createImage(450, 600);
		offScreenBuffer = offScreenImage.getGraphics();

		// set Font and Color in the offScreenBuffer

		// prepare images
		mt = new MediaTracker(this);
		gridImg = Toolkit.getDefaultToolkit().getImage(
				"images/starsAndspace.png");
		topbar = Toolkit.getDefaultToolkit().getImage("images/topbar.png");
		bulletImg = Toolkit.getDefaultToolkit().getImage("images/laser.png");

		intro0 = Toolkit.getDefaultToolkit().getImage(
				"images/menu/invader_main.png");
		intro1 = Toolkit.getDefaultToolkit().getImage(
				"images/menu/invader_play.png");
		intro2 = Toolkit.getDefaultToolkit().getImage(
				"images/menu/invader_challenge.png");
		intro3 = Toolkit.getDefaultToolkit().getImage(
				"images/menu/invader_scores.png");
		intro4 = Toolkit.getDefaultToolkit().getImage(
				"images/menu/invader_menu.png");
		scores0 = Toolkit.getDefaultToolkit().getImage(
				"images/menu/scores0.png");
		scores1 = Toolkit.getDefaultToolkit().getImage(
				"images/menu/scores1.png");
		gameover0 = Toolkit.getDefaultToolkit().getImage(
				"images/menu/invader_gameover.png");
		gameover1 = Toolkit.getDefaultToolkit().getImage(
				"images/menu/invader_gameover_menu.png");

		doodleRImg = Toolkit.getDefaultToolkit().getImage(
				"images/Galaga_ship.png");
		doodleLImg = Toolkit.getDefaultToolkit().getImage(
				"images/Galaga_ship.png");
		doodleSImg = Toolkit.getDefaultToolkit().getImage(
				"images/Galaga_ship.png");

		batM1 = Toolkit.getDefaultToolkit().getImage(
				"images/monsters/black_hole.png");
		batM2 = Toolkit.getDefaultToolkit().getImage(
				"images/monsters/black_hole.png");
		batM3 = Toolkit.getDefaultToolkit().getImage(
				"images/monsters/black_hole.png");

		greenS0 = Toolkit.getDefaultToolkit().getImage("images/p-green-s1.png");
		greenS1 = Toolkit.getDefaultToolkit().getImage("images/p-green-s0.png");
		starB = Toolkit.getDefaultToolkit().getImage("images/star.png");
		starW = Toolkit.getDefaultToolkit().getImage("images/star.png");
		expl = Toolkit.getDefaultToolkit().getImage("images/explosion.png");
		whiteP = Toolkit.getDefaultToolkit().getImage("images/p-white.png");
		astr = Toolkit.getDefaultToolkit().getImage("images/asteroid.png");
		reward1 = Toolkit.getDefaultToolkit()
				.getImage("images/electricity.png");
		reward2 = Toolkit.getDefaultToolkit().getImage("images/heart.png");
		reward3 = Toolkit.getDefaultToolkit().getImage("images/clock.png");

		// brown block animation
		brownP1 = Toolkit.getDefaultToolkit().getImage(
				"images/brown/p-brown-1.png");
		brownP2 = Toolkit.getDefaultToolkit().getImage(
				"images/brown/p-brown-2.png");
		brownP3 = Toolkit.getDefaultToolkit().getImage(
				"images/brown/p-brown-3.png");
		brownP4 = Toolkit.getDefaultToolkit().getImage(
				"images/brown/p-brown-4.png");
		brownP5 = Toolkit.getDefaultToolkit().getImage(
				"images/brown/p-brown-5.png");
		brownP6 = Toolkit.getDefaultToolkit().getImage(
				"images/brown/p-brown-6.png");

		gridF = Toolkit.getDefaultToolkit().getImage(
				"images/forest/gridbg-f.png");
		borderF = Toolkit.getDefaultToolkit().getImage(
				"images/forest/border-f.png");
		dblueF = Toolkit.getDefaultToolkit().getImage(
				"images/forest/dblueF.png");
		greenF = Toolkit.getDefaultToolkit().getImage(
				"images/forest/greenF.png");
		whiteF = Toolkit.getDefaultToolkit().getImage(
				"images/forest/whiteF.png");
		greenS0F = Toolkit.getDefaultToolkit().getImage(
				"images/forest/greenS0F.png");
		greenS1F = Toolkit.getDefaultToolkit().getImage(
				"images/forest/greenS1F.png");

		brownF1 = Toolkit.getDefaultToolkit().getImage(
				"images/forest/brownF1.png");
		brownF2 = Toolkit.getDefaultToolkit().getImage(
				"images/forest/brownF2.png");
		brownF3 = Toolkit.getDefaultToolkit().getImage(
				"images/forest/brownF3.png");
		brownF4 = Toolkit.getDefaultToolkit().getImage(
				"images/forest/brownF4.png");
		brownF5 = Toolkit.getDefaultToolkit().getImage(
				"images/forest/brownF5.png");
		brownF6 = Toolkit.getDefaultToolkit().getImage(
				"images/forest/brownF6.png");

		myImages = new ArrayList();
		// add all images
		myImages.add(doodleRImg);// 0
		myImages.add(starB); // 1
		myImages.add(starW); // 2
		myImages.add(brownP1); // 3
		myImages.add(brownP2); // 4
		myImages.add(brownP3); // 5
		myImages.add(brownP4); // 6
		myImages.add(brownP5); // 7
		myImages.add(brownP6); // 8
		myImages.add(whiteP); // 9
		myImages.add(astr); // 10
		myImages.add(batM1); // 11
		myImages.add(batM2); // 12
		myImages.add(batM3); // 13
		myImages.add(greenS0); // 14
		myImages.add(greenS1); // 15
		myImages.add(borderF); // 16
		myImages.add(expl); // 17
		myImages.add(astr); // 18
		myImages.add(reward1); // 19
		myImages.add(reward2); // 20
		myImages.add(reward3); // 21

		// load images to Media Tracker
		for (Image i : myImages) {
			mt.addImage(i, 0);
		}
		try {
			mt.waitForAll();
		} catch (InterruptedException e) {
			System.out.println(e.getMessage());
		}

		// create main characters
		doodle = new Doodle(1, 190, 540, 60, 59);

		myGuys = new ArrayList<Character>();
		myGuys.add(doodle);

		myBullets = new ArrayList<Character>();

		myMonsters = new ArrayList<Character>();

		myPlatforms = new ArrayList<Character>();
		// generates first 12 random platforms
		// for (int i = 0; i < 12; i++) {
		// Platform plat1 = randomPlatform();
		// myPlatforms.add(plat1);
		// }

		int yp = 500;
		int xp = (int) (Math.random() * 400);

		Scanner s = null;
		File file = new File("scores.txt");
		String path = file.getAbsolutePath();

		try {
			s = new Scanner(new BufferedReader(new FileReader(path)));

			while (s.hasNext()) {
				String name = s.next();
				int num = s.nextInt();

				Person p = new Person(name, num);

				people.add(p);

			}
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} finally {
			if (s != null) {
				s.close();
			}
		}

		// myPlatforms.add(new Platform(1, xp, 500, 58, 15));
	}