public void init() {
        super.init();

        // set up input manager
        initInput();

        // start resource manager
        resourceManager = new ResourceManager(
        screen.getFullScreenWindow().getGraphicsConfiguration());

        // load resources
        renderer = new TileMapRenderer();

        // load first map
        map = resourceManager.loadNextMap();

        // load sounds
        soundManager = new SoundManager(PLAYBACK_FORMAT);
        bgSound = soundManager.getSound("/sounds/megaman8bit.wav");
        watergunSound = new SoundClip("/sounds/watergun.wav");
        URL urlSound = WashStart.class.getResource("/sounds/megaman8bit.wav");
        bgSoundClip= new SoundClip("/sounds/megaman8bit.wav",true);//agrega el loop al soundclip

        // start music
        midiPlayer = new MidiPlayer();
        Sequence sequence =
            midiPlayer.getSequence("/sounds/music.midi");
        bgSoundClip.play();
        toggleDrumPlayback();
        
        bullets = new ArrayList<Bullet>();
        angle=0;
        
        lives = 3;
        score = 0;
        municiones = 3;
        introCounter = 2700;
        
        
        
        iGameOver = ResourceManager.loadImage("gameover.png");
        iLives = ResourceManager.loadImage("toothbrush.png");
        
        
        iIntro = ResourceManager.loadImage("logo.jpg");
        iIntro2 = ResourceManager.loadImage("intro.gif");
        iIntro3 = ResourceManager.loadImage("intro2.png");
        iIntro4 = ResourceManager.loadImage("intro2.png");
        iMenu = ResourceManager.loadImage("menu.jpg");
        iPause = ResourceManager.loadImage("pause.png");
        iInstr = ResourceManager.loadImage("instr.png");
        iCredits = ResourceManager.loadImage("credits.jpg");
        iBoy = ResourceManager.loadImage("chooseboy.jpg");
        iGirl = ResourceManager.loadImage("choosegirl.jpg");
        iLevel = ResourceManager.loadImage("levelcomplete.png");
        //iLoose = ResourceManager.loadImage("youloose.png");
        iWin = ResourceManager.loadImage("youwin.png");
                
        bIntro = true;
        bMenu = false;
        bInstr = false;
        bCredits = false;
        bBoy = true;
        bGirl = false;
        bLevel = false;
        bLoose = false;
        bWin = false;
        bPause = false;
        bSound = true;
        bPlayer = false;
        
        fileName = "scores.txt";
        scorelist = new LinkedList<Integer>();
        bscores = false;
    }