public void draw(Graphics g) {
		if (img != null && this.active) {
			if (animationsOn) {
				if (counter >= 60 / framesPerSecond) {
					if (frame >= endFrame) {
						frame = startFrame;
					} else {
						frame += 1;
					}
					counter = 0;
				} else {
					counter += 1;
				}
			}
			updateFrame();
			tempGraphics = (Graphics2D) g;
			tempGraphics.translate(0, 0);
			tempGraphics.rotate(rotation * Math.PI / 180, frameWidth / 2,
					frameHeight / 2);
			int posX = x;
			int posY = y;
			int posW = x + (int) (frameWidth * scale);
			int posH = y + (int) (frameHeight * scale);
			if (hFlip) {
				posX = x + (int) (frameWidth * scale);
				posW = x;
			}
			if (vFlip) {
				posY = y + (int) (frameHeight * scale);
				posH = y;
			}
			tempGraphics.drawImage(img, posX, posY, posW, posH, frameX, frameY,
					frameX + frameWidth, frameY + frameHeight, null);
			tempGraphics.rotate(-rotation, frameWidth / 2, frameHeight / 2);
		}
	}