From 8122b834ca550981146439caae40e518540ab88a Mon Sep 17 00:00:00 2001 From: Jerry Date: Wed, 26 Apr 2023 17:07:49 +0800 Subject: [PATCH] u --- vis.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 vis.py diff --git a/vis.py b/vis.py new file mode 100644 index 0000000..ebe4e10 --- /dev/null +++ b/vis.py @@ -0,0 +1,36 @@ +# Example file showing a basic pygame "game loop" +import pygame +import json + +with open("/tmp/map1.json") as f: + maps = json.load(f) +# pygame setup +pygame.init() +screen = pygame.display.set_mode((1920, 1080), flags=pygame.FULLSCREEN) +clock = pygame.time.Clock() +running = True + +screen.fill("black") +it = iter(maps.values()) +#for _ in range(8*8*16*16*(15*8)+18000*5): +# next(it) +while running: + # poll for events + # pygame.QUIT event means the user clicked X to close your window + for event in pygame.event.get(): + if event.type == pygame.QUIT: + running = False + + # fill the screen with a color to wipe away anything from last frame + + # RENDER YOUR GAME HERE + + # flip() the display to put your work on screen + i = next(it) + screen.set_at((i % 1920, i // 1920), 'white') + pygame.display.flip() + + + #clock.tick(120) # limits FPS to 60 + +pygame.quit()