/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package brokensnake;

import java.awt.Point;

import java.awt.Rectangle;
import java.util.ArrayList;

/**
 *
 * @author Zemlaynin
 */
public class UserWarrior
{
 ArrayList<Rectangle> rects = new ArrayList<Rectangle>();
 public int xShift = 0;
 public int yShift = 0;
 public UserWarrior(Point startPoint)
 {
  rects.add(new Rectangle(startPoint.x-5, startPoint.y-5, 10, 10));
 }
 
 public ArrayList<Rectangle> getRects()
 {
  return rects;
 }
 
 public void add()
 {
  
 }
 
 public void shift()
 {
  for (int i = 0; i < getRects().size(); i++)
  {
   getRects().get(i).translate(xShift, yShift);
   if(getRects().get(i).x>790 || getRects().get(i).x<0 || getRects().get(i).y<0 || getRects().get(i).y>790)xShift=0;
   
  }
 }
}
