package objects;

import java.awt.BasicStroke;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.image.BufferedImage;
import java.util.Timer;
import java.util.TimerTask;

public class Ship{
	private BufferedImage ship;
	public Rectangle border;	

	
	public Ship(BufferedImage image, int x, int y){
		ship = image;
		border = new Rectangle(0, 0, image.getWidth(), image.getHeight());
		setLocation(x, y);
	}
	
	public void draw(Graphics2D g2){
		g2.drawImage(ship, (int)border.getX(), (int)border.getY(), (int)border.getWidth(), (int)border.getHeight(), null);
		g2.setStroke(new BasicStroke(1));
	}
	
	public void setLocation(int x, int y){
		border.setLocation(x, y);
	}
	public int getX(){
		return (int) border.getX();
	}
	public int getY(){
		return (int) border.getY();
	}
	public int getWidth(){
		return (int) border.getWidth();
	}
	public int getHeight(){
		return (int) border.getHeight();
	}

	public Rectangle getBorder() {
		return border;
	}
	
	
}
