public Entity(EntityType t1,Level l1){
        t=t1;
        l=l1;
        sp = new Sprite(t1);
        switch(t){
            case BAT:
                health=15;
                break;
            case PLAYER:
                health=25;
                break;
            case SNAKE:
                health=25;
                break;
            case SPIDER:
                health=35;
                break;
            case GOBLIN:
                health=75;
                break;
            case TROLL:
                health=150;
                break;
            case GHOST:
                health=190;
                break;
            case BEHEMOTH:
                health=270;
                break;
            case DRAGON:
                health=500;
                break;
            default:
                health=20;
                break;
        }
        maxhealth=health;
        spawn();
        ai= new AI(this,20);
    }