def METHOD_NAME(_obj, _event):
    global apply_force, fpss
    cnt = next(counter)
    showm.render()
    if cnt % 1 == 0:
        fps = showm.frame_rate
        fpss = np.append(fpss, fps)
        tb.message = (
            'Avg. FPS: ' + str(np.round(np.mean(fpss), 0)) + '\nSim Steps: ' + str(cnt)
        )
    # Get the position and orientation of the ball.
    ball_pos, ball_orn = p.getBasePositionAndOrientation(ball)
    # Apply force for 5 times for the first step of simulation.
    if apply_force:
        # Apply the force.
        p.applyExternalForce(
            ball, -1, forceObj=[-10000, 0, 0], posObj=ball_pos, flags=p.WORLD_FRAME
        )
        apply_force = False
    # Set position and orientation of the ball.
    sync_actor(ball_actor, ball)
    # Updating the position and orientation of each individual brick.
    for i, brick_row in enumerate(brick_actors):
        for j, brick_actor in enumerate(brick_row):
            sync_actor(brick_actor, brick_Ids[i][j])
    # Simulate a step.
    p.stepSimulation()
    # Exit after 2000 steps of simulation.
    if cnt == 2000:
        showm.exit()