import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.util.*;

class Paddle extends Object
{
	private int x, y, vel, width, height,p;
	public int player;
	private Point pos;
    Image reket1=Toolkit.getDefaultToolkit().getImage("reket1.gif");
    Image reket2=Toolkit.getDefaultToolkit().getImage("reket2.gif");
    
	public Paddle(int player)
	{
	    //System.out.println(player);
	    p=player;
		x = 0;
		y = 0;
		vel = 0;
		width = 10;
		height = 110;
		pos = new Point(0,0);
	}
	
	public void setPosition(Point position)
	{
		pos = position;
		x = pos.x;
		y = pos.y;
	}
	
	public void setPosition(int xpos, int ypos)
	{
		x = xpos;
		y = ypos;
		pos.setLocation(x,y);
	}
	
	public void setVelocity(int v)
	{
		vel = v;
	}
	
	public int getVelocity()
	{
		return vel;
	}
	
	public Point getPosition()
	{
		return pos;
	}
	
	public int getWidth()
	{
		return width;
	}
	
	public int getHeight()
	{
		return height;
	}
	
	public void paint(Graphics aPen)
	{
	    //System.out.println(player);
		//aPen.setColor(new Color(255,255,255));
		//aPen.fillRect(x - width/2, y - height/2, width, height);
	    if(p==1){aPen.drawImage(reket1,x - width/2, y - height/2, width, height,null);}
	    if(p==2){aPen.drawImage(reket2,x - width/2, y - height/2, width, height,null);}
	}
}