protected void update()
  {
      if (count == 0)
             AudioPlayer.play("Content/Audio/bgMusic2.wav",true);
	count++;     
        //THE TITLE SCREEN
    if (SideScroller.isAtTitleScreen)
    {
      if (input.isKeyPressed(Keys.Space))
      {
        SideScroller.isAtTitleScreen = false;
        new CountDown();
      }
      else
        return;
    }
    else if (SideScroller.isGameOver)
    {
      if (input.isKeyDown(Keys.Space))
      {
    	  SideScroller.isGameOver = false;
          SideScroller.isAtTitleScreen = true;
          loadLevel("data/"+this.currentLevelPath+"_level.txt");
          character.moveTo(32,400);
          camera.setPosition(0,0);
          character.lives = 3;
          character.score = 0;
          new CountDown();
      }
    }
    character.move(0,3);
    character.update(gameTime, camera, input);
    if (character.isAlive())
    {
    	camera.follow(character);
        collider.collide(character,gameMap);
        CheckBoxes(); 
    }
   //Checki enemy Collision
    for(int i = 0; i < enemies.size(); i++)
    {
      AICharacter enemy = ((AICharacter)enemies.get(i));
      enemy.move(0,1);
     collider.collide(enemy,gameMap);
     enemy.update(gameTime,camera);
     if (character.isAlive() && enemy.isAlive())
     {   
         if (collider.collide(character,enemy) == 1)
	 {
            if(enemy.getName().equals("flower_monster"))// && character.getEffect()!=character.playerEffect.HYPER)
            {
               /* if((character.getEffect() != character.playerEffect.MARIO))
                {
                    character.setEffect(character.playerEffect.MARIO);
		}else*/   
                character.die(); 
            }else
              {     
		enemy.die();
		character.score+= 100;
		AudioPlayer.play("Content/Audio/step.wav");
		if (character.score>=1000)
               {
	    	  character.lives++;
           	  character.score=0;				
               }
            }			
	   }else if (collider.collide(character,enemy) == -1)
	   {
               // if((character.getEffect()==  character.playerEffect.MARIO))
                //{
                     character.die();
              //  }else if(character.getEffect() == character.playerEffect.HYPER)
               // {
                 //   enemy.die();
               // }else
                //{
                 //   character.setEffect(character.playerEffect.MARIO);
	//	}
	    }
	}
    }
    //Check bonus colision
    for(int i = 0; i < bonuses.size(); i++)
    {
      AICharacter Bonus = ((AICharacter)bonuses.get(i));
      collider.collide(Bonus,gameMap);
      Bonus.update(gameTime,camera);
     if (character.isAlive() && Bonus.isAlive())
     {
         if (collider.collideswithbonus( character,Bonus))
	 {
                if(Bonus.getName().equals("HpUp") || Bonus.getName().equals("Shroom"))
                    character.lives++;     
                Bonus.die();
                bonuses.remove(i);	
                System.gc();
	   }
	}
    }
    checkEndOfLevel();
  }