import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;

import javax.swing.JComponent;


public class Screen extends JComponent {
	
	
	double y, yv;
	

	BufferedImage buf;
	

	public Screen() {
		y = 50.0;
		yv = 0.0;
		setPreferredSize(new Dimension((int) Game.xdim,(int) Game.ydim));
	    buf = new BufferedImage((int) Game.xdim,(int) Game.ydim, BufferedImage.TYPE_INT_ARGB);
	}
	
	public Graphics2D graphics() {
		return buf.createGraphics();
	}

	
	public void paint(Graphics g) {
		g.drawImage(buf, 0, 0, null);
	}


	public void clear() {
		// TODO Auto-generated method stub
		Graphics g = buf.getGraphics();
		g.setColor(new Color(1.0f,1.0f,1.0f));
		g.fillRect(0, 0, (int) Game.xdim, (int) Game.ydim);
		
	}



	public Graphics2D getGraphics2D() {
		// TODO Auto-generated method stub
		return buf.createGraphics();
	}

}

