public void collide(Character character, Map map)
  {
    if (!character.isAlive())
      return;
    topLeftTile = new Point(character.getTilePosition().x-1,character.getTilePosition().y);
    bottomLeftTile = new Point(character.getTilePosition().x-1,character.getTilePosition().y+1);
    bottomTile = new Point(character.getTilePosition().x,character.getTilePosition().y+1);
    topTile = new Point(character.getTilePosition().x,character.getTilePosition().y);
    rightTile = new Point(character.getTilePosition().x,character.getTilePosition().y);
    leftTile = new Point(character.getTilePosition().x-1,character.getTilePosition().y);
    if(map.getTile(bottomTile).IsMaterialized() || map.getTile(bottomLeftTile).IsMaterialized())
     {
          character.moveTo(character.getPosition().x, bottomTile.y*SideScroller.TILE_SIZE-character.getSprite().getHeight());          
          if(character.isJumping && character.isontheGround)         
             character.isJumping = false;
            character.isontheGround = true;         
    }
    if(map.getTile(topTile).IsMaterialized()||map.getTile(topLeftTile).IsMaterialized() )
    {
        character.applyForce(0, -character.getForce().y);
    } 
    
    //So we dont get out of bounds
   if(character.getPosition().x-SideScroller.TILE_SIZE > 0 && character.direction == Direction.Left|| 
      character.getPosition().x+SideScroller.TILE_SIZE  <= 210*SideScroller.TILE_SIZE && character.direction == Direction.Right)
   {
    if(map.getTile(rightTile).IsMaterialized() && character.direction == Direction.Right )
    {
         if(character.isBonus)
            character.changeRoute();
        character.applyForce(-character.getForce().x, 0);
    }
    if(map.getTile(leftTile).IsMaterialized() && character.direction == Direction.Left)
    {
        if(character.isBonus)
            character.changeRoute();
       character.applyForce(-character.getForce().x,0);     
    }
   }else 
       character.applyForce(-character.getForce().x, 0);
    if(map.getTile(character.getTilePosition()).killsCharacter())
    {
        character.die();      
    }
}