public void tick() {
		/*
		Quadtree tree = new Quadtree(0, new Rectangle(sizeX,sizeY));
		tree.addAll(entities);
		for(Entity e : entities) {
			if(e.color != Color.RED){ 
				Vector2D gravVect = new Vector2D(0,0);
				for(Entity e2 : entities) {
					if(e2 != e) {
						Vector2D gComp = new Vector2D(e.posX, e.posY, e2.posX, e2.posY).setMagnitude(e.getGravForce(e2));
						gravVect = gravVect.add(gComp);
					}
				}
				e.addVelVect(gravVect);
				e.moveTick();
			}
		}
		for(Entity e : entities) {
			ArrayList<Entity> candidates = tree.retrieveFast(e);
			for (Entity e2 : candidates) {
				if(e.isTouching(e2)) {
					e.setVelocity(new Vector2D(0,0));
					e.color = Color.RED;
					e2.setVelocity(new Vector2D(0,0));
					e2.color = Color.RED;
				}
			}
			if(e.posX-e.radius <= 0) {
				e.setSpeedX(Math.abs(e.getSpeedX()));
			}
			if(e.posY-e.radius <= 0) {
				e.setSpeedY(Math.abs(e.getSpeedY()));
			}
			if(e.posX+e.radius >= sizeX) {
				e.setSpeedX(-Math.abs(e.getSpeedX()));
			}
			if(e.posY+e.radius >= sizeY) {
				e.setSpeedY(-Math.abs(e.getSpeedY()));
			}

		}
		 */
		for(Entity e : entities) {
			if(pressed) {
				//double distSqToPointer = (targetX - e.posX)*(targetX - e.posX) + (targetY - e.posY)*(targetY - e.posY);
				//if(distSqToPointer < 100*100) {
					e.accelToward(targetX, targetY);
				//}
				//e.intercept(targetX,targetY,targetVel);
			}
			e.moveTick();
		}
			/*
			if(e.posX-e.radius <= 0) {
				e.setSpeedX(Math.abs(e.getSpeedX()));
			}
			if(e.posY-e.radius <= 0) {
				e.setSpeedY(Math.abs(e.getSpeedY()));
			}
			if(e.posX+e.radius >= sizeX) {
				e.setSpeedX(-Math.abs(e.getSpeedX()));
			}
			if(e.posY+e.radius >= sizeY) {
				e.setSpeedY(-Math.abs(e.getSpeedY()));
			}
			 */
			//}
			//e1.intercept(e2);
			//e1.moveTick();
			//e2.moveTick();
		}