diff --git a/project/main.py b/project/main.py index 2c0dfbd..98f6d76 100644 --- a/project/main.py +++ b/project/main.py @@ -51,12 +51,13 @@ if what_to_run == 'level': ghost_character.position_scale = PositionScale((90, 50), (1, 1)) sprite_manager.add_ui_element(DrawLayers.OBJECTS, ghost_character) - text_1 = TextLabel("Frame: 0", 2, 110, 50, alignment="left") - text_1.position_scale.scale = (0.3, 0.3) - sprite_manager.add_ui_element(DrawLayers.UI, text_1) + calculated_frame_rate_text = TextLabel("Frame rate: 0", 2, 110, 70, alignment="left") + calculated_frame_rate_text.position_scale.scale = (0.3, 0.3) + sprite_manager.add_ui_element(DrawLayers.UI, calculated_frame_rate_text) while True: clock.tick(frame_rate) + calculated_frame_rate_text.text = f"Frame rate: {round(clock.get_fps())}" pygame_events: list[pygame.event.Event] = pygame.event.get() key_manager.update_key_events(pygame_events)