public void draw(Graphics g) {

        //dectects direction and if the dragon is hit to figure out what sprite to draw to the screen
        if (xDirection > 0 && !collision) {
            g.drawImage(rightsprites.get(spriteCounter), super.bounds.x, super.bounds.y, null);
        }
        if (xDirection < 0 && !collision) {
            g.drawImage(leftsprites.get(spriteCounter), super.bounds.x, super.bounds.y, null);
        }

        if (xDirection > 0 && collision) {
            g.drawImage(rcollisionSprite, super.bounds.x, super.bounds.y, null);



        }
        if (xDirection < 0 && collision) {
            g.drawImage(lcollisionSprite, super.bounds.x, super.bounds.y, null);

        }











    }