public void update(float delta) {
		int nBlocks=0;
		processInput();
		processCollisions();
		// We update the ball and check how many blocks are left
		for (Entity entity : world.getEntities()) {
			entity.update(delta);
			if (entity.getObjectID() == ObjectIDType.BALL) {
				if (((Ball)entity).getState()==Ball.State.MOVING) {
					// Now we check if it is out of bounds and make it bounce
					if (entity.getPosition().x < 0) {
						entity.getPosition().x = 0;
						entity.getVelocity().x = -entity.getVelocity().x;
					}
					if (entity.getPosition().x > world.getUnitsX()-entity.getBounds().width) {
						entity.getPosition().x = world.getUnitsX()-entity.getBounds().width;
						entity.getVelocity().x = -entity.getVelocity().x;
					}
					if (entity.getPosition().y < 0) {
						world.setState(State.LIVELOST);
					}
					if (entity.getPosition().y > world.getUnitsY()-entity.getBounds().height) {
						entity.getPosition().y = world.getUnitsY()-entity.getBounds().height;
						entity.getVelocity().y = -entity.getVelocity().y;
					}
				}
			}
			if (entity.getObjectID() == ObjectIDType.BLOCK) {
				nBlocks++;
			}
		}
		if (nBlocks == 0) {
			world.setState(State.EMPTY);
		}
		world.update(delta);
	}