@Override
	public void run() {
		while(running == true) {
			if(inGame == true) {
				Point bottomLeftPoint = new Point(player.x + 1, player.y + player.height);
				Point bottomRightPoint = new Point(player.x + player.width - 1, player.y + player.height);
				Point leftBottomMovingPoint = new Point(player.x, player.y + player.height - 1);
				Point rightBottomMovingPoint = new Point(player.x + player.width, player.y + player.height - 1);
				Point leftTopMovingPoint = new Point(player.x, player.y + 1);
				Point rightTopMovingPoint = new Point(player.x + player.width, player.y + 1);
				Point topLeftPoint = new Point(player.x + 1, player.y);
				Point topRightPoint = new Point(player.x + player.width - 1, player.y);

				//falling
				if(player.getVerticalMovingBehavior().equals(onGroundBehavior)) {
					for(Floor floorChecker : floors) {
						if(!floorChecker.contains(bottomLeftPoint) || !floorChecker.contains(bottomRightPoint)) {
							player.setVerticalMovingBehavior(fallingBehavior);
						}
					}
				}
				if(!player.getVerticalMovingBehavior().equals(jumpingBehavior)) {
					for(Floor floorChecker : floors) {
						if(floorChecker.contains(bottomLeftPoint) || floorChecker.contains(bottomRightPoint)) {
							player.setVerticalMovingBehavior(onGroundBehavior);
						}
					}
				}

				//jumping
				for(Floor floorChecker : floors) {
					if(floorChecker.contains(topLeftPoint) || floorChecker.contains(topRightPoint)) {
						player.setVerticalMovingBehavior(fallingBehavior);
					}
				}

				//moving left
				for(Floor floorChecker : floors) {
					if(floorChecker.contains(leftBottomMovingPoint) || floorChecker.contains(leftTopMovingPoint)) {
						player.setHorizontalMovingBehavior(noMoveBehavior);
					}
				}
				
				//moving right
				for(Floor floorChecker : floors) {
					if(floorChecker.contains(rightBottomMovingPoint) || floorChecker.contains(rightTopMovingPoint)) {
						player.setHorizontalMovingBehavior(noMoveBehavior);
					}
				}

				player.move(this, player);
				fpsSetter();
				repaint();
			}
		}
	}