void doRectCollision()
	{
		Vec2D collisionForce = new Vec2D();
		pos.add(dir);
		AABB tempRect = getCollisionRectangle();
		// ask the game what this is colliding with, and squeeze out of it!
		ArrayList<HasRectangle> collide = game.getCollisionsFor(this, tempRect);
		HasRectangle hr;
		AABB r;
		for(int i = 0; i < collide.size(); ++i)
		{
			hr = collide.get(i);
			r = getCollisionRectangle(hr);
			tempRect.squeezOutOf(r, collisionForce);
		}
		colliding = !collisionForce.isZero();
		// move back according to collision
		pos.add(collisionForce);
		// check vertical collision force
		double backPedalDistance = Math.abs(dir.y+collisionForce.y);
		if(collisionForce.y != 0 && backPedalDistance < MIN_COLLISION_RESOLUTION){
			if(dir.y > 0)
				this.falling = false;
			dir.y = 0;
		}
		// how much horizontal collision force is being applied?
		backPedalDistance = Math.abs(dir.x+collisionForce.x);
		if(collisionForce.x != 0 && backPedalDistance < MIN_COLLISION_RESOLUTION){
			dir.x = 0;
		}
		// check if this should be falling
		if(canFall && !falling){
			tempRect.min.y = tempRect.max.y;
			tempRect.max.y++;
			collide = game.getCollisionsFor(this, tempRect);
			if(collide.size() > 0){
				r = getCollisionRectangle(collide.get(0));
				footing = r.getWidth();
			} else {
				footing = 0;
				falling = true;
			}
		}
	}