private void setImage(String name) {
        BufferedImage im = registry.getImageLoader().getImage(name);
        if (im != null) {
            AffineTransform tx = null;
            AffineTransformOp op = null;

            if (direction == Direction.LEFT) {
                //rotate the image based on where you're shooting
                tx = new AffineTransform();
                tx.rotate(Math.atan(slope), im.getWidth() / 2, im.getHeight() / 2);

                op = new AffineTransformOp(tx, AffineTransformOp.TYPE_BILINEAR);
                image = op.filter(im, null);

                width = im.getWidth();
                height = im.getHeight();

                //flip horizontally
                tx = new AffineTransform();
                tx = AffineTransform.getScaleInstance(-1, 1);
                tx.translate(-width, 0);
                op = new AffineTransformOp(tx, AffineTransformOp.TYPE_BILINEAR);
                image = op.filter(image, null);
            } else {
                //rotate the image based on where you're shooting
                tx = new AffineTransform();
                tx.rotate(-Math.atan(slope), im.getWidth() / 2, im.getHeight() / 2);

                op = new AffineTransformOp(tx, AffineTransformOp.TYPE_BILINEAR);
                image = op.filter(im, null);

                width = im.getWidth();
                height = im.getHeight();
            }
        }
    }